diff options
Diffstat (limited to 'secure/lib/libcrypto/man/RSA_generate_key.3')
-rw-r--r-- | secure/lib/libcrypto/man/RSA_generate_key.3 | 43 |
1 files changed, 28 insertions, 15 deletions
diff --git a/secure/lib/libcrypto/man/RSA_generate_key.3 b/secure/lib/libcrypto/man/RSA_generate_key.3 index 0425128..05acc68 100644 --- a/secure/lib/libcrypto/man/RSA_generate_key.3 +++ b/secure/lib/libcrypto/man/RSA_generate_key.3 @@ -133,58 +133,71 @@ .\" ======================================================================== .\" .IX Title "RSA_generate_key 3" -.TH RSA_generate_key 3 "2015-07-09" "1.0.1p" "OpenSSL" +.TH RSA_generate_key 3 "2015-07-09" "1.0.2d" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" -RSA_generate_key \- generate RSA key pair +RSA_generate_key_ex, RSA_generate_key \- generate RSA key pair .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& #include <openssl/rsa.h> \& +\& int RSA_generate_key_ex(RSA *rsa, int bits, BIGNUM *e, BN_GENCB *cb); +.Ve +.PP +Deprecated: +.PP +.Vb 2 \& RSA *RSA_generate_key(int num, unsigned long e, \& void (*callback)(int,int,void *), void *cb_arg); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" -\&\fIRSA_generate_key()\fR generates a key pair and returns it in a newly -allocated \fB\s-1RSA\s0\fR structure. The pseudo-random number generator must -be seeded prior to calling \fIRSA_generate_key()\fR. +\&\fIRSA_generate_key_ex()\fR generates a key pair and stores it in the \fB\s-1RSA\s0\fR +structure provided in \fBrsa\fR. The pseudo-random number generator must +be seeded prior to calling \fIRSA_generate_key_ex()\fR. .PP -The modulus size will be \fBnum\fR bits, and the public exponent will be +The modulus size will be of length \fBbits\fR, and the public exponent will be \&\fBe\fR. Key sizes with \fBnum\fR < 1024 should be considered insecure. The exponent is an odd number, typically 3, 17 or 65537. .PP A callback function may be used to provide feedback about the -progress of the key generation. If \fBcallback\fR is not \fB\s-1NULL\s0\fR, it -will be called as follows: +progress of the key generation. If \fBcb\fR is not \fB\s-1NULL\s0\fR, it +will be called as follows using the \fIBN_GENCB_call()\fR function +described on the \fIBN_generate_prime\fR\|(3) page. .IP "\(bu" 4 While a random prime number is generated, it is called as described in \fIBN_generate_prime\fR\|(3). .IP "\(bu" 4 When the n\-th randomly generated prime is rejected as not -suitable for the key, \fBcallback(2, n, cb_arg)\fR is called. +suitable for the key, \fBBN_GENCB_call(cb, 2, n)\fR is called. .IP "\(bu" 4 When a random p has been found with p\-1 relatively prime to \fBe\fR, -it is called as \fBcallback(3, 0, cb_arg)\fR. +it is called as \fBBN_GENCB_call(cb, 3, 0)\fR. .PP -The process is then repeated for prime q with \fBcallback(3, 1, cb_arg)\fR. +The process is then repeated for prime q with \fBBN_GENCB_call(cb, 3, 1)\fR. +.PP +RSA_generate_key is deprecated (new applications should use +RSA_generate_key_ex instead). RSA_generate_key works in the same was as +RSA_generate_key_ex except it uses \*(L"old style\*(R" call backs. See +\&\fIBN_generate_prime\fR\|(3) for further details. .SH "RETURN VALUE" .IX Header "RETURN VALUE" -If key generation fails, \fIRSA_generate_key()\fR returns \fB\s-1NULL\s0\fR; the -error codes can be obtained by \fIERR_get_error\fR\|(3). +If key generation fails, \fIRSA_generate_key()\fR returns \fB\s-1NULL\s0\fR. +.PP +The error codes can be obtained by \fIERR_get_error\fR\|(3). .SH "BUGS" .IX Header "BUGS" -\&\fBcallback(2, x, cb_arg)\fR is used with two different meanings. +\&\fBBN_GENCB_call(cb, 2, x)\fR is used with two different meanings. .PP \&\fIRSA_generate_key()\fR goes into an infinite loop for illegal input values. .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fIERR_get_error\fR\|(3), \fIrand\fR\|(3), \fIrsa\fR\|(3), -\&\fIRSA_free\fR\|(3) +\&\fIRSA_free\fR\|(3), \fIBN_generate_prime\fR\|(3) .SH "HISTORY" .IX Header "HISTORY" The \fBcb_arg\fR argument was added in SSLeay 0.9.0. |