#include <gnutls_int.h>
#include <gnutls_datum.h>
#include <gnutls_global.h>
#include <gnutls_errors.h>
#include <gnutls_rsa_export.h>
#include <gnutls_sig.h>
#include <common.h>
#include <gnutls_x509.h>
#include <x509_b64.h>
#include <x509.h>
#include <mpi.h>
#include <extensions.h>
Go to the source code of this file.
Defines | |
#define | CALC_COEFF 1 |
#define | PEM_KEY_RSA "RSA PRIVATE KEY" |
Functions | |
int | MHD_gnutls_x509_privkey_init (MHD_gnutls_x509_privkey_t *key) |
void | MHD_gnutls_x509_privkey_deinit (MHD_gnutls_x509_privkey_t key) |
ASN1_TYPE | MHD__gnutls_privkey_decode_pkcs1_rsa_key (const MHD_gnutls_datum_t *raw_key, MHD_gnutls_x509_privkey_t pkey) |
int | MHD_gnutls_x509_privkey_import (MHD_gnutls_x509_privkey_t key, const MHD_gnutls_datum_t *data, MHD_gnutls_x509_crt_fmt_t format) |
#define CALC_COEFF 1 |
Definition at line 41 of file x509_privkey.c.
#define PEM_KEY_RSA "RSA PRIVATE KEY" |
ASN1_TYPE MHD__gnutls_privkey_decode_pkcs1_rsa_key | ( | const MHD_gnutls_datum_t * | raw_key, | |
MHD_gnutls_x509_privkey_t | pkey | |||
) |
Definition at line 96 of file x509_privkey.c.
References ASN1_SUCCESS, MHD_gnutls_datum_t::data, MHD__asn1_create_element(), MHD__asn1_delete_structure(), MHD__asn1_der_decoding(), MHD__gnutls_getMHD__gnutls_asn, MHD__gnutls_mpi_get_nbits, MHD__gnutls_mpi_invm, MHD__gnutls_mpi_snew, MHD__gnutls_x509_read_int(), MHD_gnutls_assert, MHD_gtls_mpi_release(), MHD_gtls_x509_privkey_int::params, MHD_gtls_x509_privkey_int::params_size, RSA_PRIVATE_PARAMS, and MHD_gnutls_datum_t::size.
Referenced by MHD_gnutls_x509_privkey_import().
void MHD_gnutls_x509_privkey_deinit | ( | MHD_gnutls_x509_privkey_t | key | ) |
MHD_gnutls_x509_privkey_deinit - This function deinitializes memory used by a MHD_gnutls_x509_privkey_t structure : The structure to be initialized
This function will deinitialize a private key structure.
Definition at line 75 of file x509_privkey.c.
References MHD_gtls_x509_privkey_int::key, MHD__asn1_delete_structure(), MHD_gnutls_free, MHD_gtls_mpi_release(), MHD_gtls_x509_privkey_int::params, and MHD_gtls_x509_privkey_int::params_size.
Referenced by call_get_cert_callback(), MHD__gnutls_rsa_params_deinit(), and MHD__gnutls_x509_raw_privkey_to_gkey().
int MHD_gnutls_x509_privkey_import | ( | MHD_gnutls_x509_privkey_t | key, | |
const MHD_gnutls_datum_t * | data, | |||
MHD_gnutls_x509_crt_fmt_t | format | |||
) |
MHD_gnutls_x509_privkey_import - This function will import a DER or PEM encoded key : The structure to store the parsed key : The DER or PEM encoded certificate. : One of DER or PEM
This function will convert the given DER or PEM encoded key to the native MHD_gnutls_x509_privkey_t format. The output will be stored in .
If the key is PEM encoded it should have a header of "RSA PRIVATE KEY", or "DSA PRIVATE KEY".
Returns 0 on success.
Definition at line 216 of file x509_privkey.c.
References MHD_gnutls_datum_t::data, GNUTLS_E_ASN1_DER_ERROR, GNUTLS_E_INVALID_REQUEST, GNUTLS_X509_FMT_PEM, MHD_gtls_x509_privkey_int::key, MHD__gnutls_fbase64_decode(), MHD__gnutls_free_datum, MHD__gnutls_privkey_decode_pkcs1_rsa_key(), MHD_gnutls_assert, MHD_GNUTLS_PK_RSA, MHD_GNUTLS_PK_UNKNOWN, PEM_KEY_RSA, MHD_gtls_x509_privkey_int::pk_algorithm, and MHD_gnutls_datum_t::size.
Referenced by MHD__gnutls_x509_raw_privkey_to_gkey().
int MHD_gnutls_x509_privkey_init | ( | MHD_gnutls_x509_privkey_t * | key | ) |
MHD_gnutls_x509_privkey_init - This function initializes a MHD_gnutls_crl structure : The structure to be initialized
This function will initialize an private key structure.
Returns 0 on success.
Definition at line 53 of file x509_privkey.c.
References ASN1_TYPE_EMPTY, GNUTLS_E_MEMORY_ERROR, MHD_gnutls_calloc, and MHD_GNUTLS_PK_UNKNOWN.
Referenced by MHD__gnutls_x509_raw_privkey_to_gkey().