summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/man/RSA_get0_key.3
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/lib/libcrypto/man/RSA_get0_key.3148
1 files changed, 148 insertions, 0 deletions
diff --git a/src/lib/libcrypto/man/RSA_get0_key.3 b/src/lib/libcrypto/man/RSA_get0_key.3
new file mode 100644
index 0000000000..213dba396d
--- /dev/null
+++ b/src/lib/libcrypto/man/RSA_get0_key.3
@@ -0,0 +1,148 @@
1.\" $OpenBSD: RSA_get0_key.3,v 1.1 2018/02/17 16:59:48 schwarze Exp $
2.\" selective merge up to: OpenSSL 665d899f Aug 2 02:19:43 2017 +0800
3.\"
4.\" This file was written by Richard Levitte <levitte@openssl.org>
5.\" Copyright (c) 2016 The OpenSSL Project. All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\"
11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer.
13.\"
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\" notice, this list of conditions and the following disclaimer in
16.\" the documentation and/or other materials provided with the
17.\" distribution.
18.\"
19.\" 3. All advertising materials mentioning features or use of this
20.\" software must display the following acknowledgment:
21.\" "This product includes software developed by the OpenSSL Project
22.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
23.\"
24.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
25.\" endorse or promote products derived from this software without
26.\" prior written permission. For written permission, please contact
27.\" openssl-core@openssl.org.
28.\"
29.\" 5. Products derived from this software may not be called "OpenSSL"
30.\" nor may "OpenSSL" appear in their names without prior written
31.\" permission of the OpenSSL Project.
32.\"
33.\" 6. Redistributions of any form whatsoever must retain the following
34.\" acknowledgment:
35.\" "This product includes software developed by the OpenSSL Project
36.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
37.\"
38.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
39.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
40.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
41.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
42.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
44.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
45.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
46.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
47.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49.\" OF THE POSSIBILITY OF SUCH DAMAGE.
50.\"
51.Dd $Mdocdate: February 17 2018 $
52.Dt RSA_GET0_KEY 3
53.Os
54.Sh NAME
55.Nm RSA_get0_key ,
56.Nm RSA_set0_key
57.Nd get and set data in an RSA object
58.Sh SYNOPSIS
59.In openssl/rsa.h
60.Ft void
61.Fo RSA_get0_key
62.Fa "const RSA *r"
63.Fa "const BIGNUM **n"
64.Fa "const BIGNUM **e"
65.Fa "const BIGNUM **d"
66.Fc
67.Ft int
68.Fo RSA_set0_key
69.Fa "RSA *r"
70.Fa "BIGNUM *n"
71.Fa "BIGNUM *e"
72.Fa "BIGNUM *d"
73.Fc
74.Sh DESCRIPTION
75An
76.Vt RSA
77object contains the components for the public and private key.
78.Fa n
79is the modulus common to both public and private key,
80.Fa e
81is the public exponent and
82.Fa d
83is the private exponent.
84These parameters can be obtained by calling
85.Fn RSA_get0_key .
86If they have not been set yet, then
87.Pf * Fa n ,
88.Pf * Fa e ,
89and
90.Pf * Fa d
91will be set to
92.Dv NULL .
93Otherwise, they are set to pointers to the internal representations
94of the values that should not be freed by the caller.
95If any of the arguments is
96.Dv NULL ,
97the respective parameter is not retrieved.
98.Pp
99The
100.Fa n ,
101.Fa e ,
102and
103.Fa d
104parameter values can be set by calling
105.Fn RSA_set0_key .
106The values
107.Fa n
108and
109.Fa e
110must be
111.Pf non- Dv NULL
112the first time this function is called on a given
113.Vt RSA
114object.
115The value
116.Fa d
117may be
118.Dv NULL .
119On subsequent calls, any of these values may be
120.Dv NULL ,
121which means that the corresponding field is left untouched.
122Calling this function transfers the memory management of the values to
123the RSA object.
124Therefore, the values that have been passed in
125should not be freed by the caller.
126.Pp
127Values retrieved with
128.Fn RSA_get0_key
129are owned by the
130.Vt RSA
131object used in the call and may therefore
132.Em not
133be passed to
134.Fn RSA_set0_key .
135If needed, duplicate the received value using
136.Xr BN_dup 3
137and pass the duplicate.
138.Sh RETURN VALUES
139.Fn RSA_set0_key
140returns 1 on success or 0 on failure.
141.Sh SEE ALSO
142.Xr RSA_check_key 3 ,
143.Xr RSA_generate_key 3 ,
144.Xr RSA_new 3 ,
145.Xr RSA_print 3 ,
146.Xr RSA_size 3
147.Sh HISTORY
148These functions first appeared in OpenSSL 1.1.0.