diff options
Diffstat (limited to '')
| -rw-r--r-- | src/lib/libcrypto/man/RSA_generate_key.3 | 105 |
1 files changed, 105 insertions, 0 deletions
diff --git a/src/lib/libcrypto/man/RSA_generate_key.3 b/src/lib/libcrypto/man/RSA_generate_key.3 new file mode 100644 index 0000000000..a9e72c6594 --- /dev/null +++ b/src/lib/libcrypto/man/RSA_generate_key.3 | |||
| @@ -0,0 +1,105 @@ | |||
| 1 | .Dd $Mdocdate: November 4 2016 $ | ||
| 2 | .Dt RSA_GENERATE_KEY 3 | ||
| 3 | .Os | ||
| 4 | .Sh NAME | ||
| 5 | .Nm RSA_generate_key_ex , | ||
| 6 | .Nm RSA_generate_key | ||
| 7 | .Nd generate RSA key pair | ||
| 8 | .Sh SYNOPSIS | ||
| 9 | .In openssl/rsa.h | ||
| 10 | .Ft int | ||
| 11 | .Fo RSA_generate_key_ex | ||
| 12 | .Fa "RSA *rsa" | ||
| 13 | .Fa "int bits" | ||
| 14 | .Fa "BIGNUM *e" | ||
| 15 | .Fa "BN_GENCB *cb" | ||
| 16 | .Fc | ||
| 17 | .Pp | ||
| 18 | Deprecated: | ||
| 19 | .Pp | ||
| 20 | .Ft RSA * | ||
| 21 | .Fo RSA_generate_key | ||
| 22 | .Fa "int num" | ||
| 23 | .Fa "unsigned long e" | ||
| 24 | .Fa "void (*callback)(int, int, void *)" | ||
| 25 | .Fa "void *cb_arg" | ||
| 26 | .Fc | ||
| 27 | .Sh DESCRIPTION | ||
| 28 | .Fn RSA_generate_key_ex | ||
| 29 | generates a key pair and stores it in | ||
| 30 | .Fa rsa . | ||
| 31 | .Pp | ||
| 32 | The modulus size will be of length | ||
| 33 | .Fa bits , | ||
| 34 | and the public exponent will be | ||
| 35 | .Fa e . | ||
| 36 | Key sizes with | ||
| 37 | .Fa num | ||
| 38 | < 1024 should be considered insecure. | ||
| 39 | The exponent is an odd number, typically 3, 17 or 65537. | ||
| 40 | .Pp | ||
| 41 | A callback function may be used to provide feedback about the progress | ||
| 42 | of the key generation. | ||
| 43 | If | ||
| 44 | .Fa cb | ||
| 45 | is not | ||
| 46 | .Dv NULL , | ||
| 47 | it will be called as follows using the | ||
| 48 | .Xr BN_GENCB_call 3 | ||
| 49 | function: | ||
| 50 | .Bl -bullet | ||
| 51 | .It | ||
| 52 | While a random prime number is generated, it is called as described in | ||
| 53 | .Xr BN_generate_prime 3 . | ||
| 54 | .It | ||
| 55 | When the | ||
| 56 | .Fa n Ns -th | ||
| 57 | randomly generated prime is rejected as not suitable for | ||
| 58 | the key, | ||
| 59 | .Fn BN_GENCB_call cb 2 n | ||
| 60 | is called. | ||
| 61 | .It | ||
| 62 | When a random p has been found with p-1 relatively prime to | ||
| 63 | .Fa e , | ||
| 64 | it is called as | ||
| 65 | .Fn BN_GENCB_call cb 3 0 . | ||
| 66 | .El | ||
| 67 | .Pp | ||
| 68 | The process is then repeated for prime q with | ||
| 69 | .Fn BN_GENCB_call cb 3 1 . | ||
| 70 | .Pp | ||
| 71 | .Fn RSA_generate_key | ||
| 72 | is deprecated. | ||
| 73 | New applications should use | ||
| 74 | .Fn RSA_generate_key_ex | ||
| 75 | instead. | ||
| 76 | .Fn RSA_generate_key | ||
| 77 | works in the same was as | ||
| 78 | .Fn RSA_generate_key_ex | ||
| 79 | except it uses "old style" call backs. | ||
| 80 | See | ||
| 81 | .Xr BN_generate_prime 3 | ||
| 82 | for further details. | ||
| 83 | .Sh RETURN VALUE | ||
| 84 | If key generation fails, | ||
| 85 | .Fn RSA_generate_key | ||
| 86 | returns | ||
| 87 | .Dv NULL . | ||
| 88 | .Pp | ||
| 89 | The error codes can be obtained by | ||
| 90 | .Xr ERR_get_error 3 . | ||
| 91 | .Sh SEE ALSO | ||
| 92 | .Xr BN_generate_prime 3 , | ||
| 93 | .Xr ERR_get_error 3 , | ||
| 94 | .Xr rsa 3 , | ||
| 95 | .Xr RSA_free 3 | ||
| 96 | .Sh HISTORY | ||
| 97 | The | ||
| 98 | .Fa cb_arg | ||
| 99 | argument was added in SSLeay 0.9.0. | ||
| 100 | .Sh BUGS | ||
| 101 | .Fn BN_GENCB_call cb 2 x | ||
| 102 | is used with two different meanings. | ||
| 103 | .Pp | ||
| 104 | .Fn RSA_generate_key | ||
| 105 | goes into an infinite loop for illegal input values. | ||
