summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/man/PEM_write_bio_ASN1_stream.3
diff options
context:
space:
mode:
authorschwarze <>2021-12-13 18:55:22 +0000
committerschwarze <>2021-12-13 18:55:22 +0000
commit955d19a4816fb3b32a101d4d83d85a802005bede (patch)
tree9527dbe32b07b25b277bbe90b36c17c0573b5b0d /src/lib/libcrypto/man/PEM_write_bio_ASN1_stream.3
parent0743c8765d7d888788f5102487bbff54a6174fdb (diff)
downloadopenbsd-955d19a4816fb3b32a101d4d83d85a802005bede.tar.gz
openbsd-955d19a4816fb3b32a101d4d83d85a802005bede.tar.bz2
openbsd-955d19a4816fb3b32a101d4d83d85a802005bede.zip
new manual page PEM_write_bio_ASN1_stream(3);
certainly not perfect, but arguably better than the even terser PEM_write_bio_CMS_stream(3) and PEM_write_bio_PKCS7_stream(3)
Diffstat (limited to 'src/lib/libcrypto/man/PEM_write_bio_ASN1_stream.3')
-rw-r--r--src/lib/libcrypto/man/PEM_write_bio_ASN1_stream.390
1 files changed, 90 insertions, 0 deletions
diff --git a/src/lib/libcrypto/man/PEM_write_bio_ASN1_stream.3 b/src/lib/libcrypto/man/PEM_write_bio_ASN1_stream.3
new file mode 100644
index 0000000000..7b965e7b76
--- /dev/null
+++ b/src/lib/libcrypto/man/PEM_write_bio_ASN1_stream.3
@@ -0,0 +1,90 @@
1.\" $OpenBSD: PEM_write_bio_ASN1_stream.3,v 1.1 2021/12/13 18:55:22 schwarze Exp $
2.\"
3.\" Copyright (c) 2021 Ingo Schwarze <schwarze@openbsd.org>
4.\"
5.\" Permission to use, copy, modify, and distribute this software for any
6.\" purpose with or without fee is hereby granted, provided that the above
7.\" copyright notice and this permission notice appear in all copies.
8.\"
9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16.\"
17.Dd $Mdocdate: December 13 2021 $
18.Dt PEM_WRITE_BIO_ASN1_STREAM 3
19.Os
20.Sh NAME
21.Nm PEM_write_bio_ASN1_stream
22.Nd generic PEM encoder
23.Sh SYNOPSIS
24.In openssl/asn1.h
25.Ft int
26.Fo PEM_write_bio_ASN1_stream
27.Fa "BIO *out_bio"
28.Fa "ASN1_VALUE *val_in"
29.Fa "BIO *in_bio"
30.Fa "int flags"
31.Fa "const char *hdr"
32.Fa "const ASN1_ITEM *it"
33.Fc
34.Sh DESCRIPTION
35.Fn PEM_write_bio_ASN1_stream
36writes the
37.Fa val_in
38argument of type
39.Fa it
40to
41.Fa out_bio
42in PEM format, that is, BER- and base64-encoded and surrounded by
43.Qq -----BEGIN ...-----
44and
45.Qq -----END ...-----
46lines with the
47.Fa hdr
48argument in place of the ellipses.
49.Pp
50The
51.Fa flags
52are passed through to
53.Xr i2d_ASN1_bio_stream 3 .
54In particular, if the bit
55.Dv SMIME_STREAM
56is set, streaming is performed, reading the content from
57.Fa in_bio .
58Streaming is only supported if
59.Fa val_in
60is of the type
61.Vt CMS_ContentInfo
62or
63.Vt PKCS7 .
64.Pp
65If the bit
66.Dv SMIME_STREAM
67is not set, the arguments
68.Fa in_bio
69and
70.Fa flags
71are ignored and distinguished encoding rules (DER) are used.
72.Sh RETURN VALUES
73.Fn PEM_write_bio_ASN1_stream
74is intended to return 1 on success or 0 on failure.
75.Sh SEE ALSO
76.Xr ASN1_item_i2d_bio 3 ,
77.Xr BIO_f_base64 3 ,
78.Xr BIO_new 3 ,
79.Xr i2d_ASN1_bio_stream 3 ,
80.Xr PEM_write_bio 3 ,
81.Xr PEM_write_bio_CMS_stream 3 ,
82.Xr PEM_write_bio_PKCS7_stream 3
83.Sh HISTORY
84.Fn PEM_write_bio_ASN1_stream
85first appeared in OpenSSL 1.0.0 and has been available since
86.Ox 4.9 .
87.Sh BUGS
88Many kinds of errors are silently ignored.
89This function may return 1 even if it only produced partial output
90or no output at all.