pkcs12

pkcs12

Synopsis




enum        gnutls_pkcs12_bag_type_t;
#define     MAX_BAG_ELEMENTS
struct      bag_element;
#define     BAG_PKCS8_KEY
#define     BAG_PKCS8_ENCRYPTED_KEY
#define     BAG_CERTIFICATE
#define     BAG_CRL
#define     DATA_OID
#define     ENC_DATA_OID
#define     FRIENDLY_NAME_OID
#define     KEY_ID_OID
typedef     gnutls_pkcs12_t;
typedef     gnutls_pkcs12_bag_t;
int         gnutls_pkcs12_init              (gnutls_pkcs12_t *pkcs12);
void        gnutls_pkcs12_deinit            (gnutls_pkcs12_t pkcs12);
int         gnutls_pkcs12_import            (gnutls_pkcs12_t pkcs12,
                                             const gnutls_datum_t *data,
                                             gnutls_x509_crt_fmt_t format,
                                             unsigned int flags);
int         gnutls_pkcs12_get_bag           (gnutls_pkcs12_t pkcs12,
                                             int indx,
                                             gnutls_pkcs12_bag_t bag);
int         gnutls_pkcs12_bag_init          (gnutls_pkcs12_bag_t *bag);
void        gnutls_pkcs12_bag_deinit        (gnutls_pkcs12_bag_t bag);
enum        schema_id;

Description

Details

enum gnutls_pkcs12_bag_type_t

typedef enum gnutls_pkcs12_bag_type_t
{
  GNUTLS_BAG_EMPTY = 0,

  GNUTLS_BAG_PKCS8_ENCRYPTED_KEY = 1,
  GNUTLS_BAG_PKCS8_KEY,
  GNUTLS_BAG_CERTIFICATE,
  GNUTLS_BAG_CRL,
  GNUTLS_BAG_ENCRYPTED = 10,
  GNUTLS_BAG_UNKNOWN = 20
} gnutls_pkcs12_bag_type_t;


MAX_BAG_ELEMENTS

#define     MAX_BAG_ELEMENTS


struct bag_element

struct bag_element {
  gnutls_datum_t data;
  gnutls_pkcs12_bag_type_t type;
  gnutls_datum_t local_key_id;
  char *friendly_name;
};


BAG_PKCS8_KEY

#define     BAG_PKCS8_KEY


BAG_PKCS8_ENCRYPTED_KEY

#define     BAG_PKCS8_ENCRYPTED_KEY


BAG_CERTIFICATE

#define     BAG_CERTIFICATE


BAG_CRL

#define     BAG_CRL


DATA_OID

#define     DATA_OID


ENC_DATA_OID

#define     ENC_DATA_OID


FRIENDLY_NAME_OID

#define     FRIENDLY_NAME_OID


KEY_ID_OID

#define     KEY_ID_OID


gnutls_pkcs12_t


gnutls_pkcs12_bag_t


gnutls_pkcs12_init ()

int         gnutls_pkcs12_init              (gnutls_pkcs12_t *pkcs12);

This function will initialize a PKCS12 structure. PKCS12 structures usually contain lists of X.509 Certificates and X.509 Certificate revocation lists.

pkcs12 :
Returns :

gnutls_pkcs12_deinit ()

void        gnutls_pkcs12_deinit            (gnutls_pkcs12_t pkcs12);

This function will deinitialize a PKCS12 structure.

pkcs12 :

gnutls_pkcs12_import ()

int         gnutls_pkcs12_import            (gnutls_pkcs12_t pkcs12,
                                             const gnutls_datum_t *data,
                                             gnutls_x509_crt_fmt_t format,
                                             unsigned int flags);

This function will convert the given DER or PEM encoded PKCS12 to the native gnutls_pkcs12_t format. The output will be stored in 'pkcs12'.

If the PKCS12 is PEM encoded it should have a header of "PKCS12".

pkcs12 :
data :
format :
flags :
Returns :

gnutls_pkcs12_get_bag ()

int         gnutls_pkcs12_get_bag           (gnutls_pkcs12_t pkcs12,
                                             int indx,
                                             gnutls_pkcs12_bag_t bag);

This function will return a Bag from the PKCS12 structure.

pkcs12 :
indx :
bag :
Returns :

gnutls_pkcs12_bag_init ()

int         gnutls_pkcs12_bag_init          (gnutls_pkcs12_bag_t *bag);

This function will initialize a PKCS12 bag structure. PKCS12 Bags usually contain private keys, lists of X.509 Certificates and X.509 Certificate revocation lists.

bag :
Returns :

gnutls_pkcs12_bag_deinit ()

void        gnutls_pkcs12_bag_deinit        (gnutls_pkcs12_bag_t bag);

This function will deinitialize a PKCS12 Bag structure.

bag :

enum schema_id

typedef enum schema_id
{
  PBES2,			/* the stuff in PKCS #5 */
  PKCS12_3DES_SHA1,		/* the fucking stuff in PKCS #12 */
  PKCS12_ARCFOUR_SHA1,
  PKCS12_RC2_40_SHA1
} schema_id;