summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib/libcrypto/man/EVP_PKEY_new.326
1 files changed, 22 insertions, 4 deletions
diff --git a/src/lib/libcrypto/man/EVP_PKEY_new.3 b/src/lib/libcrypto/man/EVP_PKEY_new.3
index 54b863b88f..994e1680b9 100644
--- a/src/lib/libcrypto/man/EVP_PKEY_new.3
+++ b/src/lib/libcrypto/man/EVP_PKEY_new.3
@@ -1,5 +1,5 @@
1.\" $OpenBSD: EVP_PKEY_new.3,v 1.4 2018/02/14 02:15:46 schwarze Exp $ 1.\" $OpenBSD: EVP_PKEY_new.3,v 1.5 2018/02/14 23:49:52 schwarze Exp $
2.\" OpenSSL 9b86974e Aug 17 15:21:33 2015 -0400 2.\" full merge up to: OpenSSL 99d63d42 Oct 26 13:56:48 2016 -0400
3.\" 3.\"
4.\" This file was written by Dr. Stephen Henson <steve@openssl.org>. 4.\" This file was written by Dr. Stephen Henson <steve@openssl.org>.
5.\" Copyright (c) 2002 The OpenSSL Project. All rights reserved. 5.\" Copyright (c) 2002 The OpenSSL Project. All rights reserved.
@@ -53,12 +53,17 @@
53.Os 53.Os
54.Sh NAME 54.Sh NAME
55.Nm EVP_PKEY_new , 55.Nm EVP_PKEY_new ,
56.Nm EVP_PKEY_up_ref ,
56.Nm EVP_PKEY_free 57.Nm EVP_PKEY_free
57.Nd private key allocation functions 58.Nd private key allocation functions
58.Sh SYNOPSIS 59.Sh SYNOPSIS
59.In openssl/evp.h 60.In openssl/evp.h
60.Ft EVP_PKEY * 61.Ft EVP_PKEY *
61.Fn EVP_PKEY_new void 62.Fn EVP_PKEY_new void
63.Ft int
64.Fo EVP_PKEY_up_ref
65.Fa "EVP_PKEY *key"
66.Fc
62.Ft void 67.Ft void
63.Fo EVP_PKEY_free 68.Fo EVP_PKEY_free
64.Fa "EVP_PKEY *key" 69.Fa "EVP_PKEY *key"
@@ -74,12 +79,19 @@ The
74function allocates an empty 79function allocates an empty
75.Vt EVP_PKEY 80.Vt EVP_PKEY
76structure. 81structure.
82The reference count is set to 1.
77To add a private key to it, use the functions described in 83To add a private key to it, use the functions described in
78.Xr EVP_PKEY_set1_RSA 3 . 84.Xr EVP_PKEY_set1_RSA 3 .
79.Pp 85.Pp
86.Fn EVP_PKEY_up_ref
87increments the reference count of
88.Fa key
89by 1.
90.Pp
80.Fn EVP_PKEY_free 91.Fn EVP_PKEY_free
81frees up the private key 92decrements the reference count of
82.Fa key . 93.Fa key
94by 1, and if the reference count reaches zero, frees it up.
83If 95If
84.Fa key 96.Fa key
85is a 97is a
@@ -92,6 +104,9 @@ returns either the newly allocated
92structure or 104structure or
93.Dv NULL 105.Dv NULL
94if an error occurred. 106if an error occurred.
107.Pp
108.Fn EVP_PKEY_up_ref
109returns 1 for success or 0 for failure.
95.Sh SEE ALSO 110.Sh SEE ALSO
96.Xr EVP_PKEY_asn1_set_free 3 , 111.Xr EVP_PKEY_asn1_set_free 3 ,
97.Xr EVP_PKEY_set1_RSA 3 112.Xr EVP_PKEY_set1_RSA 3
@@ -100,3 +115,6 @@ if an error occurred.
100and 115and
101.Fn EVP_PKEY_free 116.Fn EVP_PKEY_free
102exist in all versions of OpenSSL. 117exist in all versions of OpenSSL.
118.Pp
119.Fn EVP_PKEY_up_ref
120first appeared in OpenSSL 1.1.0.