.\" $OpenBSD: i2d_ASN1_bio_stream.3,v 1.3 2021/12/13 18:55:22 schwarze Exp $ .\" .\" Copyright (c) 2021 Ingo Schwarze .\" .\" Permission to use, copy, modify, and distribute this software for any .\" purpose with or without fee is hereby granted, provided that the above .\" copyright notice and this permission notice appear in all copies. .\" .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" .Dd $Mdocdate: December 13 2021 $ .Dt I2D_ASN1_BIO_STREAM 3 .Os .Sh NAME .Nm i2d_ASN1_bio_stream .Nd generic BER streamer .Sh SYNOPSIS .In openssl/asn1.h .Ft int .Fo i2d_ASN1_bio_stream .Fa "BIO *out_bio" .Fa "ASN1_VALUE *val_in" .Fa "BIO *in_bio" .Fa "int flags" .Fa "const ASN1_ITEM *it" .Fc .Sh DESCRIPTION If the bit .Dv SMIME_STREAM is not set in the .Fa flags argument, .Fn i2d_ASN1_bio_stream does the same as .Xr ASN1_item_i2d_bio 3 , ignoring the .Fa in_bio and .Fa flags arguments. .Pp If the bit .Dv SMIME_STREAM is set, it creates a streaming BIO with .Xr BIO_new_NDEF 3 , copies the data from .Fa in_bio to it using .Xr SMIME_crlf_copy 3 , finalizes the output with .Xr BIO_flush 3 , and frees the newly created BIOs up to but not including .Fa out_bio . .Pp If .Fa it is .Va PKCS7_it , this function behaves exactly as .Xr i2d_PKCS7_bio_stream 3 ; for .Va CMS_ContentInfo_it , it behaves exactly as .Xr i2d_CMS_bio_stream 3 . For other values of .Fa it , the function fails. .Sh RETURN VALUES .Fn i2d_ASN1_bio_stream is intended to return 1 on success or 0 on failure. .Sh SEE ALSO .Xr ASN1_item_i2d_bio 3 , .Xr ASN1_item_ndef_i2d 3 , .Xr BIO_flush 3 , .Xr BIO_new 3 , .Xr BIO_new_NDEF 3 , .Xr BIO_push 3 , .Xr i2d_CMS_bio_stream 3 , .Xr i2d_PKCS7_bio_stream 3 , .Xr PEM_write_bio_ASN1_stream 3 , .Xr SMIME_crlf_copy 3 , .Xr SMIME_write_ASN1 3 .Sh HISTORY .Fn i2d_ASN1_bio_stream first appeared in OpenSSL 1.0.0 and has been available since .Ox 4.9 . .Sh BUGS Many kinds of errors are silently ignored. This function may return 1 even if it only produced partial output or no output at all.