summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/man/i2d_ASN1_bio_stream.3
blob: 17ac95778c78fc7a28a1673ddab54f581bd5d930 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
.\" $OpenBSD: i2d_ASN1_bio_stream.3,v 1.3 2021/12/13 18:55:22 schwarze Exp $
.\"
.\" Copyright (c) 2021 Ingo Schwarze <schwarze@openbsd.org>
.\"
.\" 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.