diff options
Diffstat (limited to 'src/lib/libcrypto/man')
| -rw-r--r-- | src/lib/libcrypto/man/RSA_get0_key.3 | 118 |
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 |
| 75 | An | 105 | An |
| 76 | .Vt RSA | 106 | .Vt RSA |
| @@ -81,20 +111,41 @@ is the modulus common to both public and private key, | |||
| 81 | is the public exponent and | 111 | is the public exponent and |
| 82 | .Fa d | 112 | .Fa d |
| 83 | is the private exponent. | 113 | is the private exponent. |
| 84 | These parameters can be obtained by calling | 114 | .Fa p , |
| 115 | .Fa q , | ||
| 116 | .Fa dmp1 , | ||
| 117 | .Fa dmq1 , | ||
| 118 | and | ||
| 119 | .Fa iqmp | ||
| 120 | are the factors for the second representation of a private key | ||
| 121 | (see PKCS#1 section 3 Key Types), where | ||
| 122 | .Fa p | ||
| 123 | and | ||
| 124 | .Fa q | ||
| 125 | are the first and second factor of | ||
| 126 | .Fa n . | ||
| 127 | .Fa dmp1 , | ||
| 128 | .Fa dmq1 , | ||
| 129 | and | ||
| 130 | .Fa iqmp | ||
| 131 | are the exponents and coefficient for CRT calculations. | ||
| 132 | .Pp | ||
| 133 | The | ||
| 134 | .Fa n , | ||
| 135 | .Fa e , | ||
| 136 | and | ||
| 137 | .Fa d | ||
| 138 | parameters can be obtained by calling | ||
| 85 | .Fn RSA_get0_key . | 139 | .Fn RSA_get0_key . |
| 86 | If they have not been set yet, then | 140 | If they have not been set yet, then |
| 87 | .Pf * Fa n , | 141 | .Pf * Fa n , |
| 88 | .Pf * Fa e , | 142 | .Pf * Fa e , |
| 89 | and | 143 | and |
| 90 | .Pf * Fa d | 144 | .Pf * Fa d |
| 91 | will be set to | 145 | are set to |
| 92 | .Dv NULL . | 146 | .Dv NULL . |
| 93 | Otherwise, they are set to pointers to the internal representations | 147 | Otherwise, they are set to pointers to the internal representations |
| 94 | of the values that should not be freed by the caller. | 148 | of the values that should not be freed by the caller. |
| 95 | If any of the arguments is | ||
| 96 | .Dv NULL , | ||
| 97 | the respective parameter is not retrieved. | ||
| 98 | .Pp | 149 | .Pp |
| 99 | The | 150 | The |
| 100 | .Fa n , | 151 | .Fa n , |
| @@ -124,20 +175,63 @@ the RSA object. | |||
| 124 | Therefore, the values that have been passed in | 175 | Therefore, the values that have been passed in |
| 125 | should not be freed by the caller. | 176 | should not be freed by the caller. |
| 126 | .Pp | 177 | .Pp |
| 178 | In a similar fashion, the | ||
| 179 | .Fa p | ||
| 180 | and | ||
| 181 | .Fa q | ||
| 182 | parameters can be obtained and set with | ||
| 183 | .Fn RSA_get0_factors | ||
| 184 | and | ||
| 185 | .Fn RSA_set0_factors , | ||
| 186 | and the | ||
| 187 | .Fa dmp1 , | ||
| 188 | .Fa dmq1 , | ||
| 189 | and | ||
| 190 | .Fa iqmp | ||
| 191 | parameters can be obtained and set with | ||
| 192 | .Fn RSA_get0_crt_params | ||
| 193 | and | ||
| 194 | .Fn RSA_set0_crt_params . | ||
| 195 | .Pp | ||
| 196 | For | ||
| 197 | .Fn RSA_get0_key , | ||
| 198 | .Fn RSA_get0_factors , | ||
| 199 | and | ||
| 200 | .Fn RSA_get0_crt_params , | ||
| 201 | .Dv NULL | ||
| 202 | value | ||
| 203 | .Vt BIGNUM ** | ||
| 204 | output arguments are permitted. | ||
| 205 | The functions | ||
| 206 | ignore | ||
| 207 | .Dv NULL | ||
| 208 | arguments but return values for other, | ||
| 209 | .Pf non- Dv NULL , | ||
| 210 | arguments. | ||
| 211 | .Pp | ||
| 127 | Values retrieved with | 212 | Values retrieved with |
| 128 | .Fn RSA_get0_key | 213 | .Fn RSA_get0_key , |
| 214 | .Fn RSA_get0_factors , | ||
| 215 | and | ||
| 216 | .Fn RSA_get0_crt_params | ||
| 129 | are owned by the | 217 | are owned by the |
| 130 | .Vt RSA | 218 | .Vt RSA |
| 131 | object used in the call and may therefore | 219 | object used in the call and may therefore |
| 132 | .Em not | 220 | .Em not |
| 133 | be passed to | 221 | be passed to |
| 134 | .Fn RSA_set0_key . | 222 | .Fn RSA_set0_key , |
| 223 | .Fn RSA_set0_factors , | ||
| 224 | or | ||
| 225 | .Fn RSA_set0_crt_params . | ||
| 135 | If needed, duplicate the received value using | 226 | If needed, duplicate the received value using |
| 136 | .Xr BN_dup 3 | 227 | .Xr BN_dup 3 |
| 137 | and pass the duplicate. | 228 | and pass the duplicate. |
| 138 | .Sh RETURN VALUES | 229 | .Sh RETURN VALUES |
| 139 | .Fn RSA_set0_key | 230 | .Fn RSA_set0_key , |
| 140 | returns 1 on success or 0 on failure. | 231 | .Fn RSA_set0_factors , |
| 232 | and | ||
| 233 | .Fn RSA_set0_crt_params | ||
| 234 | return 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 , |
