OpenBSD manual page server

Manual Page Search Parameters

D2I_PKCS7(3) Library Functions Manual D2I_PKCS7(3)

d2i_PKCS7, i2d_PKCS7, d2i_PKCS7_bio, i2d_PKCS7_bio, d2i_PKCS7_fp, i2d_PKCS7_fp, d2i_PKCS7_DIGEST, i2d_PKCS7_DIGEST, d2i_PKCS7_ENCRYPT, i2d_PKCS7_ENCRYPT, d2i_PKCS7_ENC_CONTENT, i2d_PKCS7_ENC_CONTENT, d2i_PKCS7_ENVELOPE, i2d_PKCS7_ENVELOPE, d2i_PKCS7_ISSUER_AND_SERIAL, i2d_PKCS7_ISSUER_AND_SERIAL, d2i_PKCS7_RECIP_INFO, i2d_PKCS7_RECIP_INFO, d2i_PKCS7_SIGNED, i2d_PKCS7_SIGNED, d2i_PKCS7_SIGNER_INFO, i2d_PKCS7_SIGNER_INFO, d2i_PKCS7_SIGN_ENVELOPE, i2d_PKCS7_SIGN_ENVELOPEdecode and encode PKCS#7 data structures

#include <openssl/pkcs7.h>

PKCS7 *
d2i_PKCS7(PKCS7 **val_out, const unsigned char **der_in, long length);

int
i2d_PKCS7(PKCS7 *val_in, unsigned char **der_out);

PKCS7 *
d2i_PKCS7_bio(BIO *in_bio, PKCS7 **val_out);

int
i2d_PKCS7_bio(BIO *out_bio, PKCS7 *val_in);

PKCS7 *
d2i_PKCS7_fp(FILE *in_fp, PKCS7 **val_out);

int
i2d_PKCS7_fp(FILE *out_fp, PKCS7 *val_in);

PKCS7_DIGEST *
d2i_PKCS7_DIGEST(PKCS7_DIGEST **val_out, const unsigned char **der_in, long length);

int
i2d_PKCS7_DIGEST(PKCS7_DIGEST *val_in, unsigned char **der_out);

PKCS7_ENCRYPT *
d2i_PKCS7_ENCRYPT(PKCS7_ENCRYPT **val_out, const unsigned char **der_in, long length);

int
i2d_PKCS7_ENCRYPT(PKCS7_ENCRYPT *val_in, unsigned char **der_out);

PKCS7_ENC_CONTENT *
d2i_PKCS7_ENC_CONTENT(PKCS7_ENC_CONTENT **val_out, const unsigned char **der_in, long length);

int
i2d_PKCS7_ENC_CONTENT(PKCS7_ENC_CONTENT *val_in, unsigned char **der_out);

PKCS7_ENVELOPE *
d2i_PKCS7_ENVELOPE(PKCS7_ENVELOPE **val_out, const unsigned char **der_in, long length);

int
i2d_PKCS7_ENVELOPE(PKCS7_ENVELOPE *val_in, unsigned char **der_out);

PKCS7_ISSUER_AND_SERIAL *
d2i_PKCS7_ISSUER_AND_SERIAL(PKCS7_ISSUER_AND_SERIAL **val_out, const unsigned char **der_in, long length);

int
i2d_PKCS7_ISSUER_AND_SERIAL(PKCS7_ISSUER_AND_SERIAL *val_in, unsigned char **der_out);

PKCS7_RECIP_INFO *
d2i_PKCS7_RECIP_INFO(PKCS7_RECIP_INFO **val_out, const unsigned char **der_in, long length);

int
i2d_PKCS7_RECIP_INFO(PKCS7_RECIP_INFO *val_in, unsigned char **der_out);

PKCS7_SIGNED *
d2i_PKCS7_SIGNED(PKCS7_SIGNED **val_out, const unsigned char **der_in, long length);

int
i2d_PKCS7_SIGNED(PKCS7_SIGNED *val_in, unsigned char **der_out);

PKCS7_SIGNER_INFO *
d2i_PKCS7_SIGNER_INFO(PKCS7_SIGNER_INFO **val_out, const unsigned char **der_in, long length);

int
i2d_PKCS7_SIGNER_INFO(PKCS7_SIGNER_INFO *val_in, unsigned char **der_out);

PKCS7_SIGN_ENVELOPE *
d2i_PKCS7_SIGN_ENVELOPE(PKCS7_SIGN_ENVELOPE **val_out, const unsigned char **der_in, long length);

int
i2d_PKCS7_SIGN_ENVELOPE(PKCS7_SIGN_ENVELOPE *val_in, unsigned char **der_out);

These functions decode and encode PKCS#7 data structures. For details about the semantics, examples, caveats, and bugs, see ASN1_item_d2i(3).

() and () decode and encode an ASN.1 ContentInfo structure defined in RFC 2315 section 7. (), (), (), and () are similar except that they decode or encode using a BIO or FILE pointer.

() and () decode and encode an ASN.1 DigestedData structure defined in RFC 2315 section 12.

() and () decode and encode an ASN.1 EncryptedData structure defined in RFC 2315 section 13.

() and () decode and encode an ASN.1 EncryptedContentInfo structure defined in RFC 2315 section 10.1.

() and () decode and encode an ASN.1 EnvelopedData structure defined in RFC 2315 section 10.

() and () decode and encode an ASN.1 IssuerAndSerialNumber structure defined in RFC 2315 section 6.7.

() and () decode and encode an ASN.1 RecipientInfo structure defined in RFC 2315 section 10.2.

() and () decode and encode an ASN.1 SignedData structure defined in RFC 2315 section 9.

() and () decode and encode an ASN.1 SignerInfo structure defined in RFC 2315 section 9.2.

() and () decode and encode an ASN.1 SignedAndEnvelopedData structure defined in RFC 2315 section 11.

d2i_PKCS7(), d2i_PKCS7_bio(), and d2i_PKCS7_fp() return a PKCS7 object or NULL if an error occurs.

d2i_PKCS7_DIGEST(), d2i_PKCS7_ENCRYPT(), d2i_PKCS7_ENC_CONTENT(), d2i_PKCS7_ENVELOPE(), d2i_PKCS7_ISSUER_AND_SERIAL(), d2i_PKCS7_RECIP_INFO(), d2i_PKCS7_SIGNED(), d2i_PKCS7_SIGNER_INFO(), and d2i_PKCS7_SIGN_ENVELOPE() return an object of the respective type or NULL if an error occurs.

i2d_PKCS7(), i2d_PKCS7_DIGEST(), i2d_PKCS7_ENCRYPT(), i2d_PKCS7_ENC_CONTENT(), i2d_PKCS7_ENVELOPE(), i2d_PKCS7_ISSUER_AND_SERIAL(), i2d_PKCS7_RECIP_INFO(), i2d_PKCS7_SIGNED(), i2d_PKCS7_SIGNER_INFO(), and i2d_PKCS7_SIGN_ENVELOPE() return the number of bytes successfully encoded or a negative value if an error occurs.

i2d_PKCS7_bio() and i2d_PKCS7_fp() return 1 for success or 0 if an error occurs.

ASN1_item_d2i(3), i2d_PKCS7_bio_stream(3), PEM_write_bio_PKCS7_stream(3), PEM_write_PKCS7(3), PKCS7_new(3), SMIME_write_PKCS7(3)

RFC 2315: PKCS #7: Cryptographic Message Syntax Version 1.5

d2i_PKCS7(), i2d_PKCS7(), d2i_PKCS7_bio(), i2d_PKCS7_bio(), d2i_PKCS7_fp(), i2d_PKCS7_fp(), d2i_PKCS7_DIGEST(), i2d_PKCS7_DIGEST(), d2i_PKCS7_ENCRYPT(), i2d_PKCS7_ENCRYPT(), d2i_PKCS7_ENC_CONTENT(), i2d_PKCS7_ENC_CONTENT(), d2i_PKCS7_ENVELOPE(), i2d_PKCS7_ENVELOPE(), d2i_PKCS7_ISSUER_AND_SERIAL(), i2d_PKCS7_ISSUER_AND_SERIAL(), d2i_PKCS7_RECIP_INFO(), i2d_PKCS7_RECIP_INFO(), d2i_PKCS7_SIGNED(), i2d_PKCS7_SIGNED(), d2i_PKCS7_SIGNER_INFO(), i2d_PKCS7_SIGNER_INFO(), d2i_PKCS7_SIGN_ENVELOPE(), and i2d_PKCS7_SIGN_ENVELOPE() first appeared in SSLeay 0.5.1 and have been available since OpenBSD 2.4.

April 25, 2023 OpenBSD-current