summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/doc/RSA_generate_key.pod
diff options
context:
space:
mode:
authormiod <>2014-07-11 16:18:14 +0000
committermiod <>2014-07-11 16:18:14 +0000
commit42ef36c6813822962aff009ee1ca5eaf04d6c5c7 (patch)
treed06ffa1565a72fd493dbed6024d44e5daa26be91 /src/lib/libcrypto/doc/RSA_generate_key.pod
parent687488572f223f89cf98909e87b4d1a3fbb14bfd (diff)
downloadopenbsd-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.pod37
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
5RSA_generate_key - generate RSA key pair 5RSA_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
13Deprecated:
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
16RSA_generate_key() generates a key pair and returns it in a newly 20RSA_generate_key_ex() generates a key pair and stores it in the B<RSA>
17allocated B<RSA> structure. 21structure provided in B<rsa>.
18 22
19The modulus size will be B<num> bits, and the public exponent will be 23The modulus size will be of length B<bits>, and the public exponent will be
20B<e>. Key sizes with B<num> E<lt> 1024 should be considered insecure. 24B<e>. Key sizes with B<num> E<lt> 1024 should be considered insecure.
21The exponent is an odd number, typically 3, 17 or 65537. 25The exponent is an odd number, typically 3, 17 or 65537.
22 26
23A callback function may be used to provide feedback about the 27A callback function may be used to provide feedback about the
24progress of the key generation. If B<callback> is not B<NULL>, it 28progress of the key generation. If B<cb> is not B<NULL>, it
25will be called as follows: 29will be called as follows using the BN_GENCB_call() function
30described 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
36When the n-th randomly generated prime is rejected as not 41When the n-th randomly generated prime is rejected as not
37suitable for the key, B<callback(2, n, cb_arg)> is called. 42suitable for the key, B<BN_GENCB_call(cb, 2, n)> is called.
38 43
39=item * 44=item *
40 45
41When a random p has been found with p-1 relatively prime to B<e>, 46When a random p has been found with p-1 relatively prime to B<e>,
42it is called as B<callback(3, 0, cb_arg)>. 47it is called as B<BN_GENCB_call(cb, 3, 0)>.
43 48
44=back 49=back
45 50
46The process is then repeated for prime q with B<callback(3, 1, cb_arg)>. 51The process is then repeated for prime q with B<BN_GENCB_call(cb, 3, 1)>.
52
53RSA_generate_key is deprecated (new applications should use
54RSA_generate_key_ex instead). RSA_generate_key works in the same was as
55RSA_generate_key_ex except it uses "old style" call backs. See
56L<BN_generate_prime(3)|BN_generate_prime(3)> for further details.
47 57
48=head1 RETURN VALUE 58=head1 RETURN VALUE
49 59
50If key generation fails, RSA_generate_key() returns B<NULL>; the 60If key generation fails, RSA_generate_key() returns B<NULL>.
51error codes can be obtained by L<ERR_get_error(3)|ERR_get_error(3)>. 61
62The 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
55B<callback(2, x, cb_arg)> is used with two different meanings. 66B<BN_GENCB_call(cb, 2, x)> is used with two different meanings.
56 67
57RSA_generate_key() goes into an infinite loop for illegal input values. 68RSA_generate_key() goes into an infinite loop for illegal input values.
58 69
59=head1 SEE ALSO 70=head1 SEE ALSO
60 71
61L<ERR_get_error(3)|ERR_get_error(3)>, L<rand(3)|rand(3)>, L<rsa(3)|rsa(3)>, 72L<ERR_get_error(3)|ERR_get_error(3)>, L<rand(3)|rand(3)>, L<rsa(3)|rsa(3)>,
62L<RSA_free(3)|RSA_free(3)> 73L<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