3 * Functions for RSA private key reading and use
5 * Wireshark - Network traffic analyzer
6 * By Gerald Combs <gerald@wireshark.org>
7 * Copyright 2007 Gerald Combs
9 * SPDX-License-Identifier: GPL-2.0-or-later
15 #include <wireshark.h>
20 #include <gnutls/abstract.h>
21 WS_DLL_PUBLIC gcry_sexp_t
rsa_privkey_to_sexp(gnutls_x509_privkey_t priv_key
, char **err
);
24 * Load an RSA private key from specified file
25 * @param fp the file that contain the key data
26 * @param [out] err error message upon failure; NULL upon success
27 * @return a pointer to the loaded key on success, or NULL upon failure
29 WS_DLL_PUBLIC gnutls_x509_privkey_t
rsa_load_pem_key(FILE* fp
, char **err
);
32 * Load a RSA private key from a PKCS#12 file (DER or PEM format)
33 * @param fp the file that contains the key data
34 * @param cert_passwd password to decrypt the PKCS#12 file
35 * @param [out] err error message upon failure; NULL upon success
36 * @return a pointer to the loaded key on success; NULL upon failure
38 WS_DLL_PUBLIC gnutls_x509_privkey_t
rsa_load_pkcs12(FILE* fp
, const char *cert_passwd
, char** err
);
41 WS_DLL_PUBLIC
void rsa_private_key_free(void * key
);
44 #endif /* __RSA_H__ */