summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschwarze <>2021-10-26 10:01:23 +0000
committerschwarze <>2021-10-26 10:01:23 +0000
commitb248a05249e04992fd8e79e4fcdcb27358d175bc (patch)
tree7341c2387ffc39642e2363af1cc20510a90cd863
parentfa1f14e289e900bc95217fa67f0aba88712ea0ae (diff)
downloadopenbsd-b248a05249e04992fd8e79e4fcdcb27358d175bc.tar.gz
openbsd-b248a05249e04992fd8e79e4fcdcb27358d175bc.tar.bz2
openbsd-b248a05249e04992fd8e79e4fcdcb27358d175bc.zip
document d2i_X509_PUBKEY(3) and i2d_X509_PUBKEY(3);
while here, apply the usual conventions for naming d2i and i2d arguments
-rw-r--r--src/lib/libcrypto/man/X509_PUBKEY_new.380
1 files changed, 57 insertions, 23 deletions
diff --git a/src/lib/libcrypto/man/X509_PUBKEY_new.3 b/src/lib/libcrypto/man/X509_PUBKEY_new.3
index 69afcb5adb..648b028d5d 100644
--- a/src/lib/libcrypto/man/X509_PUBKEY_new.3
+++ b/src/lib/libcrypto/man/X509_PUBKEY_new.3
@@ -1,10 +1,10 @@
1.\" $OpenBSD: X509_PUBKEY_new.3,v 1.16 2020/06/19 14:04:25 schwarze Exp $ 1.\" $OpenBSD: X509_PUBKEY_new.3,v 1.17 2021/10/26 10:01:23 schwarze Exp $
2.\" full merge up to: OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 2.\" full merge up to: OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400
3.\" 3.\"
4.\" This file is a derived work. 4.\" This file is a derived work.
5.\" The changes are covered by the following Copyright and license: 5.\" The changes are covered by the following Copyright and license:
6.\" 6.\"
7.\" Copyright (c) 2020 Ingo Schwarze <schwarze@openbsd.org> 7.\" Copyright (c) 2020, 2021 Ingo Schwarze <schwarze@openbsd.org>
8.\" 8.\"
9.\" Permission to use, copy, modify, and distribute this software for any 9.\" Permission to use, copy, modify, and distribute this software for any
10.\" purpose with or without fee is hereby granted, provided that the above 10.\" purpose with or without fee is hereby granted, provided that the above
@@ -65,7 +65,7 @@
65.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 65.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
66.\" OF THE POSSIBILITY OF SUCH DAMAGE. 66.\" OF THE POSSIBILITY OF SUCH DAMAGE.
67.\" 67.\"
68.Dd $Mdocdate: June 19 2020 $ 68.Dd $Mdocdate: October 26 2021 $
69.Dt X509_PUBKEY_NEW 3 69.Dt X509_PUBKEY_NEW 3
70.Os 70.Os
71.Sh NAME 71.Sh NAME
@@ -74,6 +74,8 @@
74.Nm X509_PUBKEY_set , 74.Nm X509_PUBKEY_set ,
75.Nm X509_PUBKEY_get0 , 75.Nm X509_PUBKEY_get0 ,
76.Nm X509_PUBKEY_get , 76.Nm X509_PUBKEY_get ,
77.Nm d2i_X509_PUBKEY ,
78.Nm i2d_X509_PUBKEY ,
77.Nm d2i_PUBKEY , 79.Nm d2i_PUBKEY ,
78.Nm i2d_PUBKEY , 80.Nm i2d_PUBKEY ,
79.Nm d2i_PUBKEY_bio , 81.Nm d2i_PUBKEY_bio ,
@@ -104,36 +106,47 @@
104.Fo X509_PUBKEY_get 106.Fo X509_PUBKEY_get
105.Fa "X509_PUBKEY *key" 107.Fa "X509_PUBKEY *key"
106.Fc 108.Fc
109.Ft X509_PUBKEY *
110.Fo d2i_X509_PUBKEY
111.Fa "X509_PUBKEY **val_out"
112.Fa "const unsigned char **der_in"
113.Fa "long length"
114.Fc
115.Ft int
116.Fo i2d_X509_PUBKEY
117.Fa "X509_PUBKEY *val_in"
118.Fa "unsigned char **der_out"
119.Fc
107.Ft EVP_PKEY * 120.Ft EVP_PKEY *
108.Fo d2i_PUBKEY 121.Fo d2i_PUBKEY
109.Fa "EVP_PKEY **a" 122.Fa "EVP_PKEY **val_out"
110.Fa "const unsigned char **pp" 123.Fa "const unsigned char **der_in"
111.Fa "long length" 124.Fa "long length"
112.Fc 125.Fc
113.Ft int 126.Ft int
114.Fo i2d_PUBKEY 127.Fo i2d_PUBKEY
115.Fa "EVP_PKEY *a" 128.Fa "EVP_PKEY *val_in"
116.Fa "unsigned char **pp" 129.Fa "unsigned char **der_out"
117.Fc 130.Fc
118.Ft EVP_PKEY * 131.Ft EVP_PKEY *
119.Fo d2i_PUBKEY_bio 132.Fo d2i_PUBKEY_bio
120.Fa "BIO *bp" 133.Fa "BIO *bp"
121.Fa "EVP_PKEY **a" 134.Fa "EVP_PKEY **val_out"
122.Fc 135.Fc
123.Ft EVP_PKEY * 136.Ft EVP_PKEY *
124.Fo d2i_PUBKEY_fp 137.Fo d2i_PUBKEY_fp
125.Fa "FILE *fp" 138.Fa "FILE *fp"
126.Fa "EVP_PKEY **a" 139.Fa "EVP_PKEY **val_out"
127.Fc 140.Fc
128.Ft int 141.Ft int
129.Fo i2d_PUBKEY_fp 142.Fo i2d_PUBKEY_fp
130.Fa "FILE *fp" 143.Fa "FILE *fp"
131.Fa "EVP_PKEY *pkey" 144.Fa "EVP_PKEY *val_in"
132.Fc 145.Fc
133.Ft int 146.Ft int
134.Fo i2d_PUBKEY_bio 147.Fo i2d_PUBKEY_bio
135.Fa "BIO *bp" 148.Fa "BIO *bp"
136.Fa "EVP_PKEY *pkey" 149.Fa "EVP_PKEY *val_in"
137.Fc 150.Fc
138.Ft int 151.Ft int
139.Fo X509_PUBKEY_set0_param 152.Fo X509_PUBKEY_set0_param
@@ -202,14 +215,18 @@ count on the returned key is incremented so it must be freed using
202.Xr EVP_PKEY_free 3 215.Xr EVP_PKEY_free 3
203after use. 216after use.
204.Pp 217.Pp
205.Fn d2i_PUBKEY 218.Fn d2i_X509_PUBKEY ,
219.Fn i2d_X509_PUBKEY ,
220.Fn d2i_PUBKEY ,
206and 221and
207.Fn i2d_PUBKEY 222.Fn i2d_PUBKEY
208decode and encode an 223decode and encode an ASN.1
209.Vt EVP_PKEY
210structure using
211.Vt SubjectPublicKeyInfo 224.Vt SubjectPublicKeyInfo
212format. 225structure using either the
226.Vt X509_PUBKEY
227or the
228.Vt EVP_PKEY
229object type, respectively.
213For details about the semantics, examples, caveats, and bugs, see 230For details about the semantics, examples, caveats, and bugs, see
214.Xr ASN1_item_d2i 3 . 231.Xr ASN1_item_d2i 3 .
215.Fn d2i_PUBKEY_bio , 232.Fn d2i_PUBKEY_bio ,
@@ -217,7 +234,11 @@ For details about the semantics, examples, caveats, and bugs, see
217.Fn i2d_PUBKEY_bio 234.Fn i2d_PUBKEY_bio
218and 235and
219.Fn i2d_PUBKEY_fp 236.Fn i2d_PUBKEY_fp
220are similar except they decode or encode using a 237are similar to
238.Fn d2i_PUBKEY
239and
240.Fn i2d_PUBKEY
241except they decode or encode using a
221.Vt BIO 242.Vt BIO
222or 243or
223.Vt FILE 244.Vt FILE
@@ -267,20 +288,29 @@ and sets an error code that can be obtained by
267.Xr ERR_get_error 3 . 288.Xr ERR_get_error 3 .
268Otherwise it returns a pointer to the newly allocated structure. 289Otherwise it returns a pointer to the newly allocated structure.
269.Pp 290.Pp
270.Fn X509_PUBKEY_get0 , 291.Fn X509_PUBKEY_get0
271.Fn X509_PUBKEY_get , 292returns an internal pointer or
293.Dv NULL
294if an error occurs.
295.Pp
296.Fn X509_PUBKEY_get
297returns a pointer to an object that had its reference count incremented or
298.Dv NULL
299if an error occurs.
300.Pp
301.Fn d2i_X509_PUBKEY ,
272.Fn d2i_PUBKEY , 302.Fn d2i_PUBKEY ,
273.Fn d2i_PUBKEY_bio , 303.Fn d2i_PUBKEY_bio ,
274and 304and
275.Fn d2i_PUBKEY_fp 305.Fn d2i_PUBKEY_fp
276return a pointer to an 306return a pointer to a valid object or
277.Vt EVP_PKEY
278structure or
279.Dv NULL 307.Dv NULL
280if an error occurs. 308if an error occurs.
281.Pp 309.Pp
310.Fn i2d_X509_PUBKEY
311and
282.Fn i2d_PUBKEY 312.Fn i2d_PUBKEY
283returns the number of bytes successfully encoded or a negative value 313return the number of bytes successfully encoded or a negative value
284if an error occurs. 314if an error occurs.
285.Pp 315.Pp
286.Fn X509_PUBKEY_set , 316.Fn X509_PUBKEY_set ,
@@ -336,6 +366,10 @@ Certificate Revocation List (CRL) Profile
336and 366and
337.Fn X509_PUBKEY_free 367.Fn X509_PUBKEY_free
338appeared in SSLeay 0.4 or earlier. 368appeared in SSLeay 0.4 or earlier.
369.Fn d2i_X509_PUBKEY
370and
371.Fn i2d_X509_PUBKEY
372first appeared in SSLeay 0.5.1.
339.Fn X509_PUBKEY_set 373.Fn X509_PUBKEY_set
340and 374and
341.Fn X509_PUBKEY_get 375.Fn X509_PUBKEY_get