summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorschwarze <>2018-02-19 13:28:05 +0000
committerschwarze <>2018-02-19 13:28:05 +0000
commit81f4e9f88878bd6d85ff53bc11569a5913fd92ab (patch)
tree280ec3591dbaef615c11b9717383e1fb339a280d /src
parentdde57d4871f890e72012d945b908e09282cc81ce (diff)
downloadopenbsd-81f4e9f88878bd6d85ff53bc11569a5913fd92ab.tar.gz
openbsd-81f4e9f88878bd6d85ff53bc11569a5913fd92ab.tar.bz2
openbsd-81f4e9f88878bd6d85ff53bc11569a5913fd92ab.zip
In rsa.h rev. 1.34 2018/02/18 12:53:46, tb@ provided RSA_get0_factors(3)
and RSA_set0_factors(3) and in rev. 1.36 2018/02/18 12:57:14 RSA_get0_crt_params(3) and RSA_set0_crt_params(3). Merge the documentation from OpenSSL.
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/man/RSA_get0_key.3118
1 files changed, 106 insertions, 12 deletions
diff --git a/src/lib/libcrypto/man/RSA_get0_key.3 b/src/lib/libcrypto/man/RSA_get0_key.3
index 213dba396d..0da1c54462 100644
--- a/src/lib/libcrypto/man/RSA_get0_key.3
+++ b/src/lib/libcrypto/man/RSA_get0_key.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: RSA_get0_key.3,v 1.1 2018/02/17 16:59:48 schwarze Exp $ 1.\" $OpenBSD: RSA_get0_key.3,v 1.2 2018/02/19 13:28:05 schwarze Exp $
2.\" selective merge up to: OpenSSL 665d899f Aug 2 02:19:43 2017 +0800 2.\" selective merge up to: OpenSSL 665d899f Aug 2 02:19:43 2017 +0800
3.\" 3.\"
4.\" This file was written by Richard Levitte <levitte@openssl.org> 4.\" This file was written by Richard Levitte <levitte@openssl.org>
@@ -48,12 +48,16 @@
48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49.\" OF THE POSSIBILITY OF SUCH DAMAGE. 49.\" OF THE POSSIBILITY OF SUCH DAMAGE.
50.\" 50.\"
51.Dd $Mdocdate: February 17 2018 $ 51.Dd $Mdocdate: February 19 2018 $
52.Dt RSA_GET0_KEY 3 52.Dt RSA_GET0_KEY 3
53.Os 53.Os
54.Sh NAME 54.Sh NAME
55.Nm RSA_get0_key , 55.Nm RSA_get0_key ,
56.Nm RSA_set0_key 56.Nm RSA_set0_key ,
57.Nm RSA_get0_factors ,
58.Nm RSA_set0_factors ,
59.Nm RSA_get0_crt_params ,
60.Nm RSA_set0_crt_params
57.Nd get and set data in an RSA object 61.Nd get and set data in an RSA object
58.Sh SYNOPSIS 62.Sh SYNOPSIS
59.In openssl/rsa.h 63.In openssl/rsa.h
@@ -71,6 +75,32 @@
71.Fa "BIGNUM *e" 75.Fa "BIGNUM *e"
72.Fa "BIGNUM *d" 76.Fa "BIGNUM *d"
73.Fc 77.Fc
78.Ft void
79.Fo RSA_get0_factors
80.Fa "const RSA *r"
81.Fa "const BIGNUM **p"
82.Fa "const BIGNUM **q"
83.Fc
84.Ft int
85.Fo RSA_set0_factors
86.Fa "RSA *r"
87.Fa "BIGNUM *p"
88.Fa "BIGNUM *q"
89.Fc
90.Ft void
91.Fo RSA_get0_crt_params
92.Fa "const RSA *r"
93.Fa "const BIGNUM **dmp1"
94.Fa "const BIGNUM **dmq1"
95.Fa "const BIGNUM **iqmp"
96.Fc
97.Ft int
98.Fo RSA_set0_crt_params
99.Fa "RSA *r"
100.Fa "BIGNUM *dmp1"
101.Fa "BIGNUM *dmq1"
102.Fa "BIGNUM *iqmp"
103.Fc
74.Sh DESCRIPTION 104.Sh DESCRIPTION
75An 105An
76.Vt RSA 106.Vt RSA
@@ -81,20 +111,41 @@ is the modulus common to both public and private key,
81is the public exponent and 111is the public exponent and
82.Fa d 112.Fa d
83is the private exponent. 113is the private exponent.
84These parameters can be obtained by calling 114.Fa p ,
115.Fa q ,
116.Fa dmp1 ,
117.Fa dmq1 ,
118and
119.Fa iqmp
120are the factors for the second representation of a private key
121(see PKCS#1 section 3 Key Types), where
122.Fa p
123and
124.Fa q
125are the first and second factor of
126.Fa n .
127.Fa dmp1 ,
128.Fa dmq1 ,
129and
130.Fa iqmp
131are the exponents and coefficient for CRT calculations.
132.Pp
133The
134.Fa n ,
135.Fa e ,
136and
137.Fa d
138parameters can be obtained by calling
85.Fn RSA_get0_key . 139.Fn RSA_get0_key .
86If they have not been set yet, then 140If they have not been set yet, then
87.Pf * Fa n , 141.Pf * Fa n ,
88.Pf * Fa e , 142.Pf * Fa e ,
89and 143and
90.Pf * Fa d 144.Pf * Fa d
91will be set to 145are set to
92.Dv NULL . 146.Dv NULL .
93Otherwise, they are set to pointers to the internal representations 147Otherwise, they are set to pointers to the internal representations
94of the values that should not be freed by the caller. 148of 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 149.Pp
99The 150The
100.Fa n , 151.Fa n ,
@@ -124,20 +175,63 @@ the RSA object.
124Therefore, the values that have been passed in 175Therefore, the values that have been passed in
125should not be freed by the caller. 176should not be freed by the caller.
126.Pp 177.Pp
178In a similar fashion, the
179.Fa p
180and
181.Fa q
182parameters can be obtained and set with
183.Fn RSA_get0_factors
184and
185.Fn RSA_set0_factors ,
186and the
187.Fa dmp1 ,
188.Fa dmq1 ,
189and
190.Fa iqmp
191parameters can be obtained and set with
192.Fn RSA_get0_crt_params
193and
194.Fn RSA_set0_crt_params .
195.Pp
196For
197.Fn RSA_get0_key ,
198.Fn RSA_get0_factors ,
199and
200.Fn RSA_get0_crt_params ,
201.Dv NULL
202value
203.Vt BIGNUM **
204output arguments are permitted.
205The functions
206ignore
207.Dv NULL
208arguments but return values for other,
209.Pf non- Dv NULL ,
210arguments.
211.Pp
127Values retrieved with 212Values retrieved with
128.Fn RSA_get0_key 213.Fn RSA_get0_key ,
214.Fn RSA_get0_factors ,
215and
216.Fn RSA_get0_crt_params
129are owned by the 217are owned by the
130.Vt RSA 218.Vt RSA
131object used in the call and may therefore 219object used in the call and may therefore
132.Em not 220.Em not
133be passed to 221be passed to
134.Fn RSA_set0_key . 222.Fn RSA_set0_key ,
223.Fn RSA_set0_factors ,
224or
225.Fn RSA_set0_crt_params .
135If needed, duplicate the received value using 226If needed, duplicate the received value using
136.Xr BN_dup 3 227.Xr BN_dup 3
137and pass the duplicate. 228and pass the duplicate.
138.Sh RETURN VALUES 229.Sh RETURN VALUES
139.Fn RSA_set0_key 230.Fn RSA_set0_key ,
140returns 1 on success or 0 on failure. 231.Fn RSA_set0_factors ,
232and
233.Fn RSA_set0_crt_params
234return 1 on success or 0 on failure.
141.Sh SEE ALSO 235.Sh SEE ALSO
142.Xr RSA_check_key 3 , 236.Xr RSA_check_key 3 ,
143.Xr RSA_generate_key 3 , 237.Xr RSA_generate_key 3 ,