libressl-PKCS12_SAFEBAG_new3
Pkcs#12 container for one piece of information
Usage
Crypto Library (libcrypto, -lcrypto)
#include <openssl/pkcs12.h>
PKCS12_SAFEBAG *
PKCS12_SAFEBAG_new(void);
void
PKCS12_SAFEBAG_free(PKCS12_SAFEBAG *safebag);
PKCS12_BAGS *
PKCS12_BAGS_new(void);
void
PKCS12_BAGS_free(PKCS12_BAGS *bag);
Overview
PKCS12_SAFEBAG_new() allocates and initializes an empty PKCS12_SAFEBAG object, representing an ASN.1 SafeBag structure defined in RFC 7292 section 4.2. It can hold a pointer to a PKCS12_BAGS object together with a type identifier and optional attributes. PKCS12_SAFEBAG_free() frees safebag.
PKCS12_BAGS_new() allocates and initializes an empty PKCS12_BAGS object, representing the bagValue field of an ASN.1 SafeBag structure. It is used in PKCS12_SAFEBAG and can hold a DER-encoded X.509 certificate, a base64-encoded SDSI certificate, a DER-encoded X.509 CRL, or other user-defined information.
If an instance of PKCS12_SAFEBAG contains PKCS8_PRIV_KEY_INFO, X509_SIG, or nested PKCS12_SAFEBAG objects, the respective pointers are stored directly in the PKCS12_SAFEBAG object rather than in the contained PKCS12_BAGS object as required by RFC 7292.
Return values
PKCS12_SAFEBAG_new() and PKCS12_BAGS_new() return the new PKCS12_SAFEBAG or PKCS12_BAGS object, respectively, or NULL if an error occurs.