Skip to content

i2d_ASN1_bio_stream

NAME

i2d_ASN1_bio_stream, i2d_CMS_bio_stream, i2d_PKCS7_bio_stream - output ASN.1 structures in BER format

SYNOPSIS

#include <openssl/asn1.h>

int i2d_ASN1_bio_stream(BIO *out, ASN1_VALUE *val, BIO *in, int flags,
                        const ASN1_ITEM *it);

#include <openssl/cms.h>

int i2d_CMS_bio_stream(BIO *out, CMS_ContentInfo *cms, BIO *data, int flags);

#include <openssl/pkcs7.h>

int i2d_PKCS7_bio_stream(BIO *out, PKCS7 *p7, BIO *data, int flags);

DESCRIPTION

i2d_ASN1_bio_stream() outputs an ASN1_VALUE structure in BER format. The it parameter specifies the ASN1_ITEM that describes the structure type. If the SMIME_STREAM flag is set in flags, streaming mode is used where content from BIO in is processed through an encoding BIO chain for structures that support indefinite length encoding. If SMIME_STREAM is not set, in is ignored and the structure is written directly to out.

i2d_CMS_bio_stream() outputs a CMS_ContentInfo structure in BER format. It is otherwise identical to the function SMIME_write_CMS().

i2d_PKCS7_bio_stream() outputs a PKCS7 structure in BER format. It is otherwise identical to the function SMIME_write_PKCS7().

Both i2d_CMS_bio_stream() and i2d_PKCS7_bio_stream() are implemented using i2d_ASN1_bio_stream() internally.

NOTES

These functions are effectively versions of the corresponding i2d functions that support streaming.

BUGS

The prefix "i2d" is arguably wrong because these functions output BER format.

RETURN VALUES

These functions return 1 for success or 0 for failure.

SEE ALSO

ERR_get_error(3), CMS_sign(3), CMS_verify(3), CMS_encrypt(3), CMS_decrypt(3), PKCS7_sign(3), PKCS7_verify(3), PKCS7_encrypt(3), PKCS7_decrypt(3), SMIME_write_CMS(3), SMIME_write_PKCS7(3), PEM_write_bio_CMS_stream(3), PEM_write_bio_PKCS7_stream(3)

HISTORY

i2d_ASN1_bio_stream(), i2d_CMS_bio_stream() and i2d_PKCS7_bio_stream() were added in OpenSSL 1.0.0.

Copyright 2008-2016 The OpenSSL Project Authors. All Rights Reserved.

Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at https://www.openssl.org/source/license.html.