summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorschwarze <>2021-11-06 15:00:25 +0000
committerschwarze <>2021-11-06 15:00:25 +0000
commit799657a69a1e18c0e3e5eb094ab7533af4643905 (patch)
tree5079523fad37826c35f37cd971af0b9f93751fd7 /src/lib
parentf01f56497c4c06d0958a4016fdb914ec1d2d496c (diff)
downloadopenbsd-799657a69a1e18c0e3e5eb094ab7533af4643905.tar.gz
openbsd-799657a69a1e18c0e3e5eb094ab7533af4643905.tar.bz2
openbsd-799657a69a1e18c0e3e5eb094ab7533af4643905.zip
Improve formatting. The line breaks in the lists of methods were very ugly.
While here, put descriptions right after the prototypes they describe. No content change.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libcrypto/man/EVP_PKEY_asn1_new.3192
1 files changed, 76 insertions, 116 deletions
diff --git a/src/lib/libcrypto/man/EVP_PKEY_asn1_new.3 b/src/lib/libcrypto/man/EVP_PKEY_asn1_new.3
index a363a9615f..75d25d7f11 100644
--- a/src/lib/libcrypto/man/EVP_PKEY_asn1_new.3
+++ b/src/lib/libcrypto/man/EVP_PKEY_asn1_new.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: EVP_PKEY_asn1_new.3,v 1.6 2021/10/25 13:48:12 schwarze Exp $ 1.\" $OpenBSD: EVP_PKEY_asn1_new.3,v 1.7 2021/11/06 15:00:25 schwarze Exp $
2.\" selective merge up to: 2.\" selective merge up to:
3.\" OpenSSL man3/EVP_PKEY_ASN1_METHOD b0004708 Nov 1 00:45:24 2017 +0800 3.\" OpenSSL man3/EVP_PKEY_ASN1_METHOD b0004708 Nov 1 00:45:24 2017 +0800
4.\" 4.\"
@@ -49,7 +49,7 @@
49.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 49.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
50.\" OF THE POSSIBILITY OF SUCH DAMAGE. 50.\" OF THE POSSIBILITY OF SUCH DAMAGE.
51.\" 51.\"
52.Dd $Mdocdate: October 25 2021 $ 52.Dd $Mdocdate: November 6 2021 $
53.Dt EVP_PKEY_ASN1_NEW 3 53.Dt EVP_PKEY_ASN1_NEW 3
54.Os 54.Os
55.Sh NAME 55.Sh NAME
@@ -150,205 +150,167 @@ key algorithm present by the
150.Vt EVP_PKEY 150.Vt EVP_PKEY
151object. 151object.
152.Bd -unfilled 152.Bd -unfilled
153.Ft int Fo (*pub_decode) 153.Ft int Fn (*pub_decode) "EVP_PKEY *pk" "X509_PUBKEY *pub"
154.Fa "EVP_PKEY *pk" 154.Ft int Fn (*pub_encode) "X509_PUBKEY *pub" "const EVP_PKEY *pk"
155.Fa "X509_PUBKEY *pub"
156.Fc
157.Ft int Fo (*pub_encode)
158.Fa "X509_PUBKEY *pub"
159.Fa "const EVP_PKEY *pk"
160.Fc
161.Ft int Fo (*pub_cmp)
162.Fa "const EVP_PKEY *a"
163.Fa "const EVP_PKEY *b"
164.Fc
165.Ft int Fo (*pub_print)
166.Fa "BIO *out"
167.Fa "const EVP_PKEY *pkey"
168.Fa "int indent"
169.Fa "ASN1_PCTX *pctx"
170.Fc
171.Ed 155.Ed
172.Pp 156.Pp
173The 157Decode and encode
174.Fn pub_decode
175and
176.Fn pub_encode
177methods are called to decode and encode
178.Vt X509_PUBKEY 158.Vt X509_PUBKEY
179ASN.1 parameters to and from 159ASN.1 parameters to and from
180.Fa pk . 160.Fa pk .
181They must return 0 on error and 1 on success. 161These methods must return 0 on error and 1 on success.
182They are called by 162They are called by
183.Xr X509_PUBKEY_get 3 163.Xr X509_PUBKEY_get 3
184and 164and
185.Xr X509_PUBKEY_set 3 . 165.Xr X509_PUBKEY_set 3 .
166.Bd -unfilled
167.Ft int Fn (*pub_cmp) "const EVP_PKEY *a" "const EVP_PKEY *b"
168.Ed
186.Pp 169.Pp
187The 170Compare two public keys.
188.Fn pub_cmp 171This method must return 1 when the keys are equal and 0 otherwise.
189method is called when two public keys are compared.
190It must return 1 when the keys are equal and 0 otherwise.
191It is called by 172It is called by
192.Xr EVP_PKEY_cmp 3 . 173.Xr EVP_PKEY_cmp 3 .
174.Bd -filled
175.Ft int Fo (*pub_print)
176.Fa "BIO *out"
177.Fa "const EVP_PKEY *pkey"
178.Fa "int indent"
179.Fa "ASN1_PCTX *pctx"
180.Fc
181.Ed
193.Pp 182.Pp
194The 183Print a public key in humanly readable text to
195.Fn pub_print
196method is called to print a public key in humanly readable text to
197.Fa out , 184.Fa out ,
198indented 185indented
199.Fa indent 186.Fa indent
200spaces. 187spaces.
201It must return 0 on error and 1 on success. 188This method must return 0 on error and 1 on success.
202It is called by 189It is called by
203.Xr EVP_PKEY_print_public 3 . 190.Xr EVP_PKEY_print_public 3 .
204.Bd -unfilled 191.Bd -unfilled
205.Ft int Fo (*priv_decode) 192.Ft int Fn (*priv_decode) "EVP_PKEY *pk" "const PKCS8_PRIV_KEY_INFO *p8inf"
206.Fa "EVP_PKEY *pk" 193.Ft int Fn (*priv_encode) "PKCS8_PRIV_KEY_INFO *p8" "const EVP_PKEY *pk"
207.Fa "const PKCS8_PRIV_KEY_INFO *p8inf"
208.Fc
209.Ft int Fo (*priv_encode)
210.Fa "PKCS8_PRIV_KEY_INFO *p8"
211.Fa "const EVP_PKEY *pk"
212.Fc
213.Ft int Fo (*priv_print)
214.Fa "BIO *out"
215.Fa "const EVP_PKEY *pkey"
216.Fa "int indent"
217.Fa "ASN1_PCTX *pctx"
218.Fc
219.Ed 194.Ed
220.Pp 195.Pp
221The 196Decode and encode
222.Fn priv_decode
223and
224.Fn priv_encode
225methods are called to decode and encode
226.Vt PKCS8_PRIV_KEY_INFO 197.Vt PKCS8_PRIV_KEY_INFO
227form private key to and from 198form private key to and from
228.Fa pk . 199.Fa pk .
229They must return 0 on error, 1 on success. 200These methods must return 0 on error, 1 on success.
230They are called by 201They are called by
231.Xr EVP_PKCS82PKEY 3 202.Xr EVP_PKCS82PKEY 3
232and 203and
233.Xr EVP_PKEY2PKCS8 3 . 204.Xr EVP_PKEY2PKCS8 3 .
205.Bd -filled
206.Ft int Fo (*priv_print)
207.Fa "BIO *out"
208.Fa "const EVP_PKEY *pkey"
209.Fa "int indent"
210.Fa "ASN1_PCTX *pctx"
211.Fc
212.Ed
234.Pp 213.Pp
235The 214Print a private key in humanly readable text to
236.Fn priv_print
237method is called to print a private key in humanly readable text to
238.Fa out , 215.Fa out ,
239indented 216indented
240.Fa indent 217.Fa indent
241spaces. 218spaces.
242It must return 0 on error and 1 on success. 219This method must return 0 on error and 1 on success.
243It is called by 220It is called by
244.Xr EVP_PKEY_print_private 3 . 221.Xr EVP_PKEY_print_private 3 .
245.Bd -unfilled 222.Bd -unfilled
246.Ft int Fn (*pkey_size) "const EVP_PKEY *pk" 223.Ft int Fn (*pkey_size) "const EVP_PKEY *pk"
247.Ft int Fn (*pkey_bits) "const EVP_PKEY *pk";
248.Ed 224.Ed
249.Pp 225.Pp
250The 226Returns the key size in bytes.
251.Fn pkey_size 227This method is called by
252method returns the key size in bytes.
253It is called by
254.Xr EVP_PKEY_size 3 . 228.Xr EVP_PKEY_size 3 .
229.Bd -unfilled
230.Ft int Fn (*pkey_bits) "const EVP_PKEY *pk"
231.Ed
255.Pp 232.Pp
256The 233Returns the key size in bits.
257.Fn pkey_bits 234This method is called by
258method returns the key size in bits.
259It is called by
260.Xr EVP_PKEY_bits 3 . 235.Xr EVP_PKEY_bits 3 .
261.Bd -unfilled 236.Bd -filled
262.Ft int Fo (*param_decode) 237.Ft int Fo (*param_decode)
263.Fa "EVP_PKEY *pkey" 238.Fa "EVP_PKEY *pkey"
264.Fa "const unsigned char **pder" 239.Fa "const unsigned char **pder"
265.Fa "int derlen" 240.Fa "int derlen"
266.Fc 241.Fc
242.br
267.Ft int Fo (*param_encode) 243.Ft int Fo (*param_encode)
268.Fa "const EVP_PKEY *pkey" 244.Fa "const EVP_PKEY *pkey"
269.Fa "unsigned char **pder" 245.Fa "unsigned char **pder"
270.Fc 246.Fc
271.Ft int Fo (*param_missing)
272.Fa "const EVP_PKEY *pk"
273.Fc
274.Ft int Fo (*param_copy)
275.Fa "EVP_PKEY *to"
276.Fa "const EVP_PKEY *from"
277.Fc
278.Ft int Fo (*param_cmp)
279.Fa "const EVP_PKEY *a"
280.Fa "const EVP_PKEY *b"
281.Fc
282.Ft int Fo (*param_print)
283.Fa "BIO *out"
284.Fa "const EVP_PKEY *pkey"
285.Fa "int indent"
286.Fa "ASN1_PCTX *pctx"
287.Fc
288.Ed 247.Ed
289.Pp 248.Pp
290The 249Decode and encode DER formatted parameters to and from
291.Fn param_decode
292and
293.Fn param_encode
294methods are called to decode and encode DER formatted parameters to and from
295.Fa pk . 250.Fa pk .
296They must return 0 on error and 1 on success. 251These methods must return 0 on error and 1 on success.
297They are called by 252They are called by
298.Fn PEM_read_bio_Parameters . 253.Fn PEM_read_bio_Parameters .
254.Bd -unfilled
255.Ft int Fn (*param_missing) "const EVP_PKEY *pk"
256.Ed
299.Pp 257.Pp
300The 258Return 0 if a key parameter is missing or 1 otherwise.
301.Fn param_missing 259This method is called by
302method returns 0 if a key parameter is missing or otherwise 1.
303It is called by
304.Xr EVP_PKEY_missing_parameters 3 . 260.Xr EVP_PKEY_missing_parameters 3 .
261.Bd -unfilled
262.Ft int Fn (*param_copy) "EVP_PKEY *to" "const EVP_PKEY *from"
263.Ed
305.Pp 264.Pp
306The 265Copy key parameters from
307.Fn param_copy
308method copies key parameters from
309.Fa from 266.Fa from
310to 267to
311.Fa to . 268.Fa to .
312It must return 0 on error and 1 on success. 269This method must return 0 on error and 1 on success.
313It is called by 270It is called by
314.Xr EVP_PKEY_copy_parameters 3 . 271.Xr EVP_PKEY_copy_parameters 3 .
272.Bd -unfilled
273.Ft int Fn (*param_cmp) "const EVP_PKEY *a" "const EVP_PKEY *b"
274.Ed
315.Pp 275.Pp
316The 276Compare the parameters of the keys
317.Fn param_cmp
318method compares the parameters of the keys
319.Fa a 277.Fa a
320and 278and
321.Fa b . 279.Fa b .
322It must return 1 when the keys are equal, 0 when not equal, and a 280This method must return 1 when the keys are equal, 0 when not equal, and a
323negative number on error. 281negative number on error.
324It is called by 282It is called by
325.Xr EVP_PKEY_cmp_parameters 3 . 283.Xr EVP_PKEY_cmp_parameters 3 .
284.Bd -filled
285.Ft int Fo (*param_print)
286.Fa "BIO *out"
287.Fa "const EVP_PKEY *pkey"
288.Fa "int indent"
289.Fa "ASN1_PCTX *pctx"
290.Fc
291.Ed
326.Pp 292.Pp
327The 293Print the private key parameters in humanly readable text to
328.Fn param_print
329method prints the private key parameters in humanly readable text to
330.Fa out , 294.Fa out ,
331indented 295indented
332.Fa indent 296.Fa indent
333spaces. 297spaces.
334It must return 0 on error and 1 on success. 298This method must return 0 on error and 1 on success.
335It is called by 299It is called by
336.Xr EVP_PKEY_print_params 3 . 300.Xr EVP_PKEY_print_params 3 .
337.Bd -unfilled 301.Bd -unfilled
338.Ft void Fn (*pkey_free) "EVP_PKEY *pkey" 302.Ft void Fn (*pkey_free) "EVP_PKEY *pkey"
339.Ed 303.Ed
340.Pp 304.Pp
341The 305Free the internals of
342.Fn pkey_free
343method helps freeing the internals of
344.Fa pkey . 306.Fa pkey .
345It is called by 307This method is called by
346.Xr EVP_PKEY_free 3 , 308.Xr EVP_PKEY_free 3 ,
347.Xr EVP_PKEY_set_type 3 , 309.Xr EVP_PKEY_set_type 3 ,
348.Fn EVP_PKEY_set_type_str , 310.Fn EVP_PKEY_set_type_str ,
349and 311and
350.Xr EVP_PKEY_assign 3 . 312.Xr EVP_PKEY_assign 3 .
351.Bd -unfilled 313.Bd -filled
352.Ft int Fo (*pkey_ctrl) 314.Ft int Fo (*pkey_ctrl)
353.Fa "EVP_PKEY *pkey" 315.Fa "EVP_PKEY *pkey"
354.Fa "int op" 316.Fa "int op"
@@ -357,10 +319,8 @@ and
357.Fc 319.Fc
358.Ed 320.Ed
359.Pp 321.Pp
360The 322Add extra algorithm specific control.
361.Fn pkey_ctrl 323This method is called by
362method adds extra algorithm specific control.
363It is called by
364.Xr EVP_PKEY_get_default_digest_nid 3 , 324.Xr EVP_PKEY_get_default_digest_nid 3 ,
365.Fn PKCS7_SIGNER_INFO_set , 325.Fn PKCS7_SIGNER_INFO_set ,
366.Fn PKCS7_RECIP_INFO_set , 326.Fn PKCS7_RECIP_INFO_set ,