diff options
author | miod <> | 2014-07-11 16:18:14 +0000 |
---|---|---|
committer | miod <> | 2014-07-11 16:18:14 +0000 |
commit | 42ef36c6813822962aff009ee1ca5eaf04d6c5c7 (patch) | |
tree | d06ffa1565a72fd493dbed6024d44e5daa26be91 /src/lib/libcrypto/doc/RSA_generate_key.pod | |
parent | 687488572f223f89cf98909e87b4d1a3fbb14bfd (diff) | |
download | openbsd-42ef36c6813822962aff009ee1ca5eaf04d6c5c7.tar.gz openbsd-42ef36c6813822962aff009ee1ca5eaf04d6c5c7.tar.bz2 openbsd-42ef36c6813822962aff009ee1ca5eaf04d6c5c7.zip |
Huge documentation update for libcrypto and libssl, mostly from Matt Caswell,
Jeff Trawick, Jean-Paul Calderone, Michal Bozon, Jeffrey Walton and Rich Salz,
via OpenSSL trunk (with some parts not applying to us, such as SSLv2 support,
at least partially removed).
Diffstat (limited to 'src/lib/libcrypto/doc/RSA_generate_key.pod')
-rw-r--r-- | src/lib/libcrypto/doc/RSA_generate_key.pod | 37 |
1 files changed, 24 insertions, 13 deletions
diff --git a/src/lib/libcrypto/doc/RSA_generate_key.pod b/src/lib/libcrypto/doc/RSA_generate_key.pod index 867390884b..00026f04df 100644 --- a/src/lib/libcrypto/doc/RSA_generate_key.pod +++ b/src/lib/libcrypto/doc/RSA_generate_key.pod | |||
@@ -2,27 +2,32 @@ | |||
2 | 2 | ||
3 | =head1 NAME | 3 | =head1 NAME |
4 | 4 | ||
5 | RSA_generate_key - generate RSA key pair | 5 | RSA_generate_key_ex, RSA_generate_key - generate RSA key pair |
6 | 6 | ||
7 | =head1 SYNOPSIS | 7 | =head1 SYNOPSIS |
8 | 8 | ||
9 | #include <openssl/rsa.h> | 9 | #include <openssl/rsa.h> |
10 | 10 | ||
11 | int RSA_generate_key_ex(RSA *rsa, int bits, BIGNUM *e, BN_GENCB *cb); | ||
12 | |||
13 | Deprecated: | ||
14 | |||
11 | RSA *RSA_generate_key(int num, unsigned long e, | 15 | RSA *RSA_generate_key(int num, unsigned long e, |
12 | void (*callback)(int,int,void *), void *cb_arg); | 16 | void (*callback)(int,int,void *), void *cb_arg); |
13 | 17 | ||
14 | =head1 DESCRIPTION | 18 | =head1 DESCRIPTION |
15 | 19 | ||
16 | RSA_generate_key() generates a key pair and returns it in a newly | 20 | RSA_generate_key_ex() generates a key pair and stores it in the B<RSA> |
17 | allocated B<RSA> structure. | 21 | structure provided in B<rsa>. |
18 | 22 | ||
19 | The modulus size will be B<num> bits, and the public exponent will be | 23 | The modulus size will be of length B<bits>, and the public exponent will be |
20 | B<e>. Key sizes with B<num> E<lt> 1024 should be considered insecure. | 24 | B<e>. Key sizes with B<num> E<lt> 1024 should be considered insecure. |
21 | The exponent is an odd number, typically 3, 17 or 65537. | 25 | The exponent is an odd number, typically 3, 17 or 65537. |
22 | 26 | ||
23 | A callback function may be used to provide feedback about the | 27 | A callback function may be used to provide feedback about the |
24 | progress of the key generation. If B<callback> is not B<NULL>, it | 28 | progress of the key generation. If B<cb> is not B<NULL>, it |
25 | will be called as follows: | 29 | will be called as follows using the BN_GENCB_call() function |
30 | described on the L<BN_generate_prime(3)|BN_generate_prime(3)> page: | ||
26 | 31 | ||
27 | =over 4 | 32 | =over 4 |
28 | 33 | ||
@@ -34,32 +39,38 @@ described in L<BN_generate_prime(3)|BN_generate_prime(3)>. | |||
34 | =item * | 39 | =item * |
35 | 40 | ||
36 | When the n-th randomly generated prime is rejected as not | 41 | When the n-th randomly generated prime is rejected as not |
37 | suitable for the key, B<callback(2, n, cb_arg)> is called. | 42 | suitable for the key, B<BN_GENCB_call(cb, 2, n)> is called. |
38 | 43 | ||
39 | =item * | 44 | =item * |
40 | 45 | ||
41 | When a random p has been found with p-1 relatively prime to B<e>, | 46 | When a random p has been found with p-1 relatively prime to B<e>, |
42 | it is called as B<callback(3, 0, cb_arg)>. | 47 | it is called as B<BN_GENCB_call(cb, 3, 0)>. |
43 | 48 | ||
44 | =back | 49 | =back |
45 | 50 | ||
46 | The process is then repeated for prime q with B<callback(3, 1, cb_arg)>. | 51 | The process is then repeated for prime q with B<BN_GENCB_call(cb, 3, 1)>. |
52 | |||
53 | RSA_generate_key is deprecated (new applications should use | ||
54 | RSA_generate_key_ex instead). RSA_generate_key works in the same was as | ||
55 | RSA_generate_key_ex except it uses "old style" call backs. See | ||
56 | L<BN_generate_prime(3)|BN_generate_prime(3)> for further details. | ||
47 | 57 | ||
48 | =head1 RETURN VALUE | 58 | =head1 RETURN VALUE |
49 | 59 | ||
50 | If key generation fails, RSA_generate_key() returns B<NULL>; the | 60 | If key generation fails, RSA_generate_key() returns B<NULL>. |
51 | error codes can be obtained by L<ERR_get_error(3)|ERR_get_error(3)>. | 61 | |
62 | The error codes can be obtained by L<ERR_get_error(3)|ERR_get_error(3)>. | ||
52 | 63 | ||
53 | =head1 BUGS | 64 | =head1 BUGS |
54 | 65 | ||
55 | B<callback(2, x, cb_arg)> is used with two different meanings. | 66 | B<BN_GENCB_call(cb, 2, x)> is used with two different meanings. |
56 | 67 | ||
57 | RSA_generate_key() goes into an infinite loop for illegal input values. | 68 | RSA_generate_key() goes into an infinite loop for illegal input values. |
58 | 69 | ||
59 | =head1 SEE ALSO | 70 | =head1 SEE ALSO |
60 | 71 | ||
61 | L<ERR_get_error(3)|ERR_get_error(3)>, L<rand(3)|rand(3)>, L<rsa(3)|rsa(3)>, | 72 | L<ERR_get_error(3)|ERR_get_error(3)>, L<rand(3)|rand(3)>, L<rsa(3)|rsa(3)>, |
62 | L<RSA_free(3)|RSA_free(3)> | 73 | L<RSA_free(3)|RSA_free(3)>, L<BN_generate_prime(3)|BN_generate_prime(3)> |
63 | 74 | ||
64 | =head1 HISTORY | 75 | =head1 HISTORY |
65 | 76 | ||