OpenBSD manual page server

Manual Page Search Parameters

PEM_WRITE_BIO_ASN1_STREAM(3) Library Functions Manual PEM_WRITE_BIO_ASN1_STREAM(3)

PEM_write_bio_ASN1_streamgeneric PEM encoder

#include <openssl/asn1.h>

int
PEM_write_bio_ASN1_stream(BIO *out_bio, ASN1_VALUE *val_in, BIO *in_bio, int flags, const char *hdr, const ASN1_ITEM *it);

() writes the val_in argument of type it to out_bio in PEM format, that is, BER- and base64-encoded and surrounded by "-----BEGIN ...-----" and "-----END ...-----" lines with the hdr argument in place of the ellipses.

The flags are passed through to i2d_ASN1_bio_stream(3). In particular, if the bit SMIME_STREAM is set, streaming is performed, reading the content from in_bio. Streaming is only supported if val_in is of the type CMS_ContentInfo or PKCS7.

If the bit SMIME_STREAM is not set, the arguments in_bio and flags are ignored and distinguished encoding rules (DER) are used.

PEM_write_bio_ASN1_stream() is intended to return 1 on success or 0 on failure.

ASN1_item_i2d_bio(3), BIO_f_base64(3), BIO_new(3), i2d_ASN1_bio_stream(3), PEM_write_bio(3), PEM_write_bio_CMS_stream(3), PEM_write_bio_PKCS7_stream(3)

PEM_write_bio_ASN1_stream() first appeared in OpenSSL 1.0.0 and has been available since OpenBSD 4.9.

Many kinds of errors are silently ignored. This function may return 1 even if it only produced partial output or no output at all.

December 13, 2021 OpenBSD-7.1