summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschwarze <>2019-08-23 15:18:13 +0000
committerschwarze <>2019-08-23 15:18:13 +0000
commitf7bbe3235ccbb7ed2e4ee069b411ed477ed5345f (patch)
treeea37bb434b16e053658791843eb92bc38a53688c
parentbd32a855e77be70d4bf689296862e8f1c7c23c06 (diff)
downloadopenbsd-f7bbe3235ccbb7ed2e4ee069b411ed477ed5345f.tar.gz
openbsd-f7bbe3235ccbb7ed2e4ee069b411ed477ed5345f.tar.bz2
openbsd-f7bbe3235ccbb7ed2e4ee069b411ed477ed5345f.zip
document RSAPrivateKey_dup(3) and RSAPublicKey_dup(3)
-rw-r--r--src/lib/libcrypto/man/RSA_new.366
1 files changed, 55 insertions, 11 deletions
diff --git a/src/lib/libcrypto/man/RSA_new.3 b/src/lib/libcrypto/man/RSA_new.3
index 2b07793acf..b0009b8581 100644
--- a/src/lib/libcrypto/man/RSA_new.3
+++ b/src/lib/libcrypto/man/RSA_new.3
@@ -1,8 +1,26 @@
1.\" $OpenBSD: RSA_new.3,v 1.14 2019/06/10 14:58:48 schwarze Exp $ 1.\" $OpenBSD: RSA_new.3,v 1.15 2019/08/23 15:18:13 schwarze Exp $
2.\" OpenSSL doc/man3/RSA_new.pod 99d63d46 Oct 26 13:56:48 2016 -0400 2.\" full merge up to:
3.\" OpenSSL doc/crypto/rsa.pod 35d2e327 Jun 3 16:19:49 2016 -0400 3.\" OpenSSL doc/man3/RSA_new.pod e9b77246 Jan 20 19:58:49 2017 +0100
4.\" OpenSSL doc/crypto/rsa.pod 35d2e327 Jun 3 16:19:49 2016 -0400 (final)
4.\" 5.\"
5.\" This file was written by Ulf Moeller <ulf@openssl.org>. 6.\" This file is a derived work.
7.\" The changes are covered by the following Copyright and license:
8.\"
9.\" Copyright (c) 2018, 2019 Ingo Schwarze <schwarze@openbsd.org>
10.\"
11.\" Permission to use, copy, modify, and distribute this software for any
12.\" purpose with or without fee is hereby granted, provided that the above
13.\" copyright notice and this permission notice appear in all copies.
14.\"
15.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
16.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
17.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
18.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
19.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
20.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
21.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
22.\"
23.\" The original file was written by Ulf Moeller <ulf@openssl.org>.
6.\" Copyright (c) 2000, 2002, 2016 The OpenSSL Project. All rights reserved. 24.\" Copyright (c) 2000, 2002, 2016 The OpenSSL Project. All rights reserved.
7.\" 25.\"
8.\" Redistribution and use in source and binary forms, with or without 26.\" Redistribution and use in source and binary forms, with or without
@@ -49,11 +67,13 @@
49.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 67.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
50.\" OF THE POSSIBILITY OF SUCH DAMAGE. 68.\" OF THE POSSIBILITY OF SUCH DAMAGE.
51.\" 69.\"
52.Dd $Mdocdate: June 10 2019 $ 70.Dd $Mdocdate: August 23 2019 $
53.Dt RSA_NEW 3 71.Dt RSA_NEW 3
54.Os 72.Os
55.Sh NAME 73.Sh NAME
56.Nm RSA_new , 74.Nm RSA_new ,
75.Nm RSAPrivateKey_dup ,
76.Nm RSAPublicKey_dup ,
57.Nm RSA_up_ref , 77.Nm RSA_up_ref ,
58.Nm RSA_free 78.Nm RSA_free
59.Nd allocate and free RSA objects 79.Nd allocate and free RSA objects
@@ -61,6 +81,14 @@
61.In openssl/rsa.h 81.In openssl/rsa.h
62.Ft RSA * 82.Ft RSA *
63.Fn RSA_new void 83.Fn RSA_new void
84.Ft RSA *
85.Fo RSAPrivateKey_dup
86.Fa "RSA *rsa"
87.Fc
88.Ft RSA *
89.Fo RSAPublicKey_dup
90.Fa "RSA *rsa"
91.Fc
64.Ft int 92.Ft int
65.Fo RSA_up_ref 93.Fo RSA_up_ref
66.Fa "RSA *rsa" 94.Fa "RSA *rsa"
@@ -83,6 +111,15 @@ with a
83.Dv NULL 111.Dv NULL
84argument. 112argument.
85.Pp 113.Pp
114.Fn RSAPrivateKey_dup
115calls
116.Fn RSA_new
117and copies the public and private key components from
118.Fa rsa
119into the new structure.
120.Fn RSAPublicKey_dup
121does the same except that it copies the public key components only.
122.Pp
86.Fn RSA_up_ref 123.Fn RSA_up_ref
87increments the reference count by 1. 124increments the reference count by 1.
88.Pp 125.Pp
@@ -162,13 +199,15 @@ For this reason, applications should generally avoid using
162structure elements directly and instead use API functions to query 199structure elements directly and instead use API functions to query
163or modify keys. 200or modify keys.
164.Sh RETURN VALUES 201.Sh RETURN VALUES
165If the allocation fails, 202.Fn RSA_new ,
166.Fn RSA_new 203.Fn RSAPrivateKey_dup ,
167returns 204and
205.Fn RSAPublicKey_dup
206return a pointer to the newly allocated structure, or
168.Dv NULL 207.Dv NULL
169and sets an error code that can be obtained by 208if an error occurs.
209An error code can be obtained by
170.Xr ERR_get_error 3 . 210.Xr ERR_get_error 3 .
171Otherwise it returns a pointer to the newly allocated structure.
172.Pp 211.Pp
173.Fn RSA_up_ref 212.Fn RSA_up_ref
174returns 1 for success or 0 for failure. 213returns 1 for success or 0 for failure.
@@ -202,7 +241,12 @@ RSA was covered by a US patent which expired in September 2000.
202.Fn RSA_new 241.Fn RSA_new
203and 242and
204.Fn RSA_free 243.Fn RSA_free
205appeared in SSLeay 0.4 or earlier and have been available since 244appeared in SSLeay 0.4 or earlier.
245.Fn RSAPrivateKey_dup
246first appeared in SSLeay 0.5.1 and
247.Fn RSAPublicKey_dup
248in SSLeay 0.5.2.
249These functions have been available since
206.Ox 2.4 . 250.Ox 2.4 .
207.Pp 251.Pp
208.Fn RSA_up_ref 252.Fn RSA_up_ref