summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/doc
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/doc')
-rw-r--r--src/lib/libcrypto/doc/RSA_blinding_on.pod41
-rw-r--r--src/lib/libcrypto/doc/RSA_check_key.pod67
-rw-r--r--src/lib/libcrypto/doc/RSA_generate_key.pod79
-rw-r--r--src/lib/libcrypto/doc/RSA_get_ex_new_index.pod122
-rw-r--r--src/lib/libcrypto/doc/RSA_new.pod39
-rw-r--r--src/lib/libcrypto/doc/RSA_padding_add_PKCS1_type_1.pod121
-rw-r--r--src/lib/libcrypto/doc/RSA_print.pod49
-rw-r--r--src/lib/libcrypto/doc/RSA_private_encrypt.pod69
-rw-r--r--src/lib/libcrypto/doc/RSA_public_encrypt.pod82
-rw-r--r--src/lib/libcrypto/doc/RSA_set_method.pod201
-rw-r--r--src/lib/libcrypto/doc/RSA_sign.pod61
-rw-r--r--src/lib/libcrypto/doc/RSA_sign_ASN1_OCTET_STRING.pod57
-rw-r--r--src/lib/libcrypto/doc/RSA_size.pod33
-rw-r--r--src/lib/libcrypto/doc/d2i_RSAPublicKey.pod63
-rw-r--r--src/lib/libcrypto/doc/rsa.pod123
15 files changed, 0 insertions, 1207 deletions
diff --git a/src/lib/libcrypto/doc/RSA_blinding_on.pod b/src/lib/libcrypto/doc/RSA_blinding_on.pod
deleted file mode 100644
index f96e3cf7c9..0000000000
--- a/src/lib/libcrypto/doc/RSA_blinding_on.pod
+++ /dev/null
@@ -1,41 +0,0 @@
1=pod
2
3=head1 NAME
4
5RSA_blinding_on, RSA_blinding_off - protect the RSA operation from timing
6attacks
7
8=head1 SYNOPSIS
9
10 #include <openssl/rsa.h>
11
12 int RSA_blinding_on(RSA *rsa, BN_CTX *ctx);
13
14 void RSA_blinding_off(RSA *rsa);
15
16=head1 DESCRIPTION
17
18RSA is vulnerable to timing attacks. In a setup where attackers can
19measure the time of RSA decryption or signature operations, blinding
20must be used to protect the RSA operation from that attack.
21
22RSA_blinding_on() turns blinding on for key B<rsa> and generates a
23random blinding factor. B<ctx> is B<NULL> or a pre-allocated and
24initialized B<BN_CTX>.
25
26RSA_blinding_off() turns blinding off and frees the memory used for
27the blinding factor.
28
29=head1 RETURN VALUES
30
31RSA_blinding_on() returns 1 on success, and 0 if an error occurred.
32
33=head1 SEE ALSO
34
35L<rsa(3)|rsa(3)>, L<rand(3)|rand(3)>
36
37=head1 HISTORY
38
39RSA_blinding_on() and RSA_blinding_off() appeared in SSLeay 0.9.0.
40
41=cut
diff --git a/src/lib/libcrypto/doc/RSA_check_key.pod b/src/lib/libcrypto/doc/RSA_check_key.pod
deleted file mode 100644
index a5198f3db5..0000000000
--- a/src/lib/libcrypto/doc/RSA_check_key.pod
+++ /dev/null
@@ -1,67 +0,0 @@
1=pod
2
3=head1 NAME
4
5RSA_check_key - validate private RSA keys
6
7=head1 SYNOPSIS
8
9 #include <openssl/rsa.h>
10
11 int RSA_check_key(RSA *rsa);
12
13=head1 DESCRIPTION
14
15This function validates RSA keys. It checks that B<p> and B<q> are
16in fact prime, and that B<n = p*q>.
17
18It also checks that B<d*e = 1 mod (p-1*q-1)>,
19and that B<dmp1>, B<dmq1> and B<iqmp> are set correctly or are B<NULL>.
20
21As such, this function can not be used with any arbitrary RSA key object,
22even if it is otherwise fit for regular RSA operation. See B<NOTES> for more
23information.
24
25=head1 RETURN VALUE
26
27RSA_check_key() returns 1 if B<rsa> is a valid RSA key, and 0 otherwise.
28-1 is returned if an error occurs while checking the key.
29
30If the key is invalid or an error occurred, the reason code can be
31obtained using L<ERR_get_error(3)|ERR_get_error(3)>.
32
33=head1 NOTES
34
35This function does not work on RSA public keys that have only the modulus
36and public exponent elements populated. It performs integrity checks on all
37the RSA key material, so the RSA key structure must contain all the private
38key data too.
39
40Unlike most other RSA functions, this function does B<not> work
41transparently with any underlying ENGINE implementation because it uses the
42key data in the RSA structure directly. An ENGINE implementation can
43override the way key data is stored and handled, and can even provide
44support for HSM keys - in which case the RSA structure may contain B<no>
45key data at all! If the ENGINE in question is only being used for
46acceleration or analysis purposes, then in all likelihood the RSA key data
47is complete and untouched, but this can't be assumed in the general case.
48
49=head1 BUGS
50
51A method of verifying the RSA key using opaque RSA API functions might need
52to be considered. Right now RSA_check_key() simply uses the RSA structure
53elements directly, bypassing the RSA_METHOD table altogether (and
54completely violating encapsulation and object-orientation in the process).
55The best fix will probably be to introduce a "check_key()" handler to the
56RSA_METHOD function table so that alternative implementations can also
57provide their own verifiers.
58
59=head1 SEE ALSO
60
61L<rsa(3)|rsa(3)>, L<ERR_get_error(3)|ERR_get_error(3)>
62
63=head1 HISTORY
64
65RSA_check_key() appeared in OpenSSL 0.9.4.
66
67=cut
diff --git a/src/lib/libcrypto/doc/RSA_generate_key.pod b/src/lib/libcrypto/doc/RSA_generate_key.pod
deleted file mode 100644
index 00026f04df..0000000000
--- a/src/lib/libcrypto/doc/RSA_generate_key.pod
+++ /dev/null
@@ -1,79 +0,0 @@
1=pod
2
3=head1 NAME
4
5RSA_generate_key_ex, RSA_generate_key - generate RSA key pair
6
7=head1 SYNOPSIS
8
9 #include <openssl/rsa.h>
10
11 int RSA_generate_key_ex(RSA *rsa, int bits, BIGNUM *e, BN_GENCB *cb);
12
13Deprecated:
14
15 RSA *RSA_generate_key(int num, unsigned long e,
16 void (*callback)(int,int,void *), void *cb_arg);
17
18=head1 DESCRIPTION
19
20RSA_generate_key_ex() generates a key pair and stores it in the B<RSA>
21structure provided in B<rsa>.
22
23The modulus size will be of length B<bits>, and the public exponent will be
24B<e>. Key sizes with B<num> E<lt> 1024 should be considered insecure.
25The exponent is an odd number, typically 3, 17 or 65537.
26
27A callback function may be used to provide feedback about the
28progress of the key generation. If B<cb> is not B<NULL>, it
29will be called as follows using the BN_GENCB_call() function
30described on the L<BN_generate_prime(3)|BN_generate_prime(3)> page:
31
32=over 4
33
34=item *
35
36While a random prime number is generated, it is called as
37described in L<BN_generate_prime(3)|BN_generate_prime(3)>.
38
39=item *
40
41When the n-th randomly generated prime is rejected as not
42suitable for the key, B<BN_GENCB_call(cb, 2, n)> is called.
43
44=item *
45
46When a random p has been found with p-1 relatively prime to B<e>,
47it is called as B<BN_GENCB_call(cb, 3, 0)>.
48
49=back
50
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.
57
58=head1 RETURN VALUE
59
60If key generation fails, RSA_generate_key() returns B<NULL>.
61
62The error codes can be obtained by L<ERR_get_error(3)|ERR_get_error(3)>.
63
64=head1 BUGS
65
66B<BN_GENCB_call(cb, 2, x)> is used with two different meanings.
67
68RSA_generate_key() goes into an infinite loop for illegal input values.
69
70=head1 SEE ALSO
71
72L<ERR_get_error(3)|ERR_get_error(3)>, L<rand(3)|rand(3)>, L<rsa(3)|rsa(3)>,
73L<RSA_free(3)|RSA_free(3)>, L<BN_generate_prime(3)|BN_generate_prime(3)>
74
75=head1 HISTORY
76
77The B<cb_arg> argument was added in SSLeay 0.9.0.
78
79=cut
diff --git a/src/lib/libcrypto/doc/RSA_get_ex_new_index.pod b/src/lib/libcrypto/doc/RSA_get_ex_new_index.pod
deleted file mode 100644
index b1ac1167dd..0000000000
--- a/src/lib/libcrypto/doc/RSA_get_ex_new_index.pod
+++ /dev/null
@@ -1,122 +0,0 @@
1=pod
2
3=head1 NAME
4
5RSA_get_ex_new_index, RSA_set_ex_data, RSA_get_ex_data - add application
6specific data to RSA structures
7
8=head1 SYNOPSIS
9
10 #include <openssl/rsa.h>
11
12 int RSA_get_ex_new_index(long argl, void *argp,
13 CRYPTO_EX_new *new_func,
14 CRYPTO_EX_dup *dup_func,
15 CRYPTO_EX_free *free_func);
16
17 int RSA_set_ex_data(RSA *r, int idx, void *arg);
18
19 void *RSA_get_ex_data(RSA *r, int idx);
20
21 typedef int CRYPTO_EX_new(void *parent, void *ptr, CRYPTO_EX_DATA *ad,
22 int idx, long argl, void *argp);
23 typedef void CRYPTO_EX_free(void *parent, void *ptr, CRYPTO_EX_DATA *ad,
24 int idx, long argl, void *argp);
25 typedef int CRYPTO_EX_dup(CRYPTO_EX_DATA *to, CRYPTO_EX_DATA *from, void *from_d,
26 int idx, long argl, void *argp);
27
28=head1 DESCRIPTION
29
30Several OpenSSL structures can have application specific data attached to them.
31This has several potential uses, it can be used to cache data associated with
32a structure (for example the hash of some part of the structure) or some
33additional data (for example a handle to the data in an external library).
34
35Since the application data can be anything at all it is passed and retrieved
36as a B<void *> type.
37
38The B<RSA_get_ex_new_index()> function is initially called to "register" some
39new application specific data. It takes three optional function pointers which
40are called when the parent structure (in this case an RSA structure) is
41initially created, when it is copied and when it is freed up. If any or all of
42these function pointer arguments are not used they should be set to NULL. The
43precise manner in which these function pointers are called is described in more
44detail below. B<RSA_get_ex_new_index()> also takes additional long and pointer
45parameters which will be passed to the supplied functions but which otherwise
46have no special meaning. It returns an B<index> which should be stored
47(typically in a static variable) and passed used in the B<idx> parameter in
48the remaining functions. Each successful call to B<RSA_get_ex_new_index()>
49will return an index greater than any previously returned, this is important
50because the optional functions are called in order of increasing index value.
51
52B<RSA_set_ex_data()> is used to set application specific data, the data is
53supplied in the B<arg> parameter and its precise meaning is up to the
54application.
55
56B<RSA_get_ex_data()> is used to retrieve application specific data. The data
57is returned to the application, this will be the same value as supplied to
58a previous B<RSA_set_ex_data()> call.
59
60B<new_func()> is called when a structure is initially allocated (for example
61with B<RSA_new()>. The parent structure members will not have any meaningful
62values at this point. This function will typically be used to allocate any
63application specific structure.
64
65B<free_func()> is called when a structure is being freed up. The dynamic parent
66structure members should not be accessed because they will be freed up when
67this function is called.
68
69B<new_func()> and B<free_func()> take the same parameters. B<parent> is a
70pointer to the parent RSA structure. B<ptr> is a the application specific data
71(this wont be of much use in B<new_func()>. B<ad> is a pointer to the
72B<CRYPTO_EX_DATA> structure from the parent RSA structure: the functions
73B<CRYPTO_get_ex_data()> and B<CRYPTO_set_ex_data()> can be called to manipulate
74it. The B<idx> parameter is the index: this will be the same value returned by
75B<RSA_get_ex_new_index()> when the functions were initially registered. Finally
76the B<argl> and B<argp> parameters are the values originally passed to the same
77corresponding parameters when B<RSA_get_ex_new_index()> was called.
78
79B<dup_func()> is called when a structure is being copied. Pointers to the
80destination and source B<CRYPTO_EX_DATA> structures are passed in the B<to> and
81B<from> parameters respectively. The B<from_d> parameter is passed a pointer to
82the source application data when the function is called, when the function
83returns the value is copied to the destination: the application can thus modify
84the data pointed to by B<from_d> and have different values in the source and
85destination. The B<idx>, B<argl> and B<argp> parameters are the same as those
86in B<new_func()> and B<free_func()>.
87
88=head1 RETURN VALUES
89
90B<RSA_get_ex_new_index()> returns a new index or -1 on failure (note 0 is a
91valid index value).
92
93B<RSA_set_ex_data()> returns 1 on success or 0 on failure.
94
95B<RSA_get_ex_data()> returns the application data or 0 on failure. 0 may also
96be valid application data but currently it can only fail if given an invalid
97B<idx> parameter.
98
99B<new_func()> and B<dup_func()> should return 0 for failure and 1 for success.
100
101On failure an error code can be obtained from
102L<ERR_get_error(3)|ERR_get_error(3)>.
103
104=head1 BUGS
105
106B<dup_func()> is currently never called.
107
108The return value of B<new_func()> is ignored.
109
110The B<new_func()> function isn't very useful because no meaningful values are
111present in the parent RSA structure when it is called.
112
113=head1 SEE ALSO
114
115L<rsa(3)|rsa(3)>, L<CRYPTO_set_ex_data(3)|CRYPTO_set_ex_data(3)>
116
117=head1 HISTORY
118
119RSA_get_ex_new_index(), RSA_set_ex_data() and RSA_get_ex_data() are
120available since SSLeay 0.9.0.
121
122=cut
diff --git a/src/lib/libcrypto/doc/RSA_new.pod b/src/lib/libcrypto/doc/RSA_new.pod
deleted file mode 100644
index 0c85dc1d62..0000000000
--- a/src/lib/libcrypto/doc/RSA_new.pod
+++ /dev/null
@@ -1,39 +0,0 @@
1=pod
2
3=head1 NAME
4
5RSA_new, RSA_free - allocate and free RSA objects
6
7=head1 SYNOPSIS
8
9 #include <openssl/rsa.h>
10
11 RSA * RSA_new(void);
12
13 void RSA_free(RSA *rsa);
14
15=head1 DESCRIPTION
16
17RSA_new() allocates and initializes an B<RSA> structure. It is equivalent to
18calling RSA_new_method(NULL).
19
20RSA_free() frees the B<RSA> structure and its components. The key is
21erased before the memory is returned to the system.
22
23=head1 RETURN VALUES
24
25If the allocation fails, RSA_new() returns B<NULL> and sets an error code that
26can be obtained by L<ERR_get_error(3)|ERR_get_error(3)>. Otherwise it returns a
27pointer to the newly allocated structure.
28
29=head1 SEE ALSO
30
31L<ERR_get_error(3)|ERR_get_error(3)>, L<rsa(3)|rsa(3)>,
32L<RSA_generate_key(3)|RSA_generate_key(3)>,
33L<RSA_new_method(3)|RSA_new_method(3)>
34
35=head1 HISTORY
36
37RSA_new() and RSA_free() are available in all versions of SSLeay and OpenSSL.
38
39=cut
diff --git a/src/lib/libcrypto/doc/RSA_padding_add_PKCS1_type_1.pod b/src/lib/libcrypto/doc/RSA_padding_add_PKCS1_type_1.pod
deleted file mode 100644
index 1c90b2b44d..0000000000
--- a/src/lib/libcrypto/doc/RSA_padding_add_PKCS1_type_1.pod
+++ /dev/null
@@ -1,121 +0,0 @@
1=pod
2
3=head1 NAME
4
5RSA_padding_add_PKCS1_type_1, RSA_padding_check_PKCS1_type_1,
6RSA_padding_add_PKCS1_type_2, RSA_padding_check_PKCS1_type_2,
7RSA_padding_add_PKCS1_OAEP, RSA_padding_check_PKCS1_OAEP,
8RSA_padding_add_SSLv23, RSA_padding_check_SSLv23,
9RSA_padding_add_none, RSA_padding_check_none - asymmetric encryption
10padding
11
12=head1 SYNOPSIS
13
14 #include <openssl/rsa.h>
15
16 int RSA_padding_add_PKCS1_type_1(unsigned char *to, int tlen,
17 unsigned char *f, int fl);
18
19 int RSA_padding_check_PKCS1_type_1(unsigned char *to, int tlen,
20 unsigned char *f, int fl, int rsa_len);
21
22 int RSA_padding_add_PKCS1_type_2(unsigned char *to, int tlen,
23 unsigned char *f, int fl);
24
25 int RSA_padding_check_PKCS1_type_2(unsigned char *to, int tlen,
26 unsigned char *f, int fl, int rsa_len);
27
28 int RSA_padding_add_PKCS1_OAEP(unsigned char *to, int tlen,
29 unsigned char *f, int fl, unsigned char *p, int pl);
30
31 int RSA_padding_check_PKCS1_OAEP(unsigned char *to, int tlen,
32 unsigned char *f, int fl, int rsa_len, unsigned char *p, int pl);
33
34 int RSA_padding_add_SSLv23(unsigned char *to, int tlen,
35 unsigned char *f, int fl);
36
37 int RSA_padding_check_SSLv23(unsigned char *to, int tlen,
38 unsigned char *f, int fl, int rsa_len);
39
40 int RSA_padding_add_none(unsigned char *to, int tlen,
41 unsigned char *f, int fl);
42
43 int RSA_padding_check_none(unsigned char *to, int tlen,
44 unsigned char *f, int fl, int rsa_len);
45
46=head1 DESCRIPTION
47
48The RSA_padding_xxx_xxx() functions are called from the RSA encrypt,
49decrypt, sign and verify functions. Normally they should not be called
50from application programs.
51
52However, they can also be called directly to implement padding for other
53asymmetric ciphers. RSA_padding_add_PKCS1_OAEP() and
54RSA_padding_check_PKCS1_OAEP() may be used in an application combined
55with B<RSA_NO_PADDING> in order to implement OAEP with an encoding
56parameter.
57
58RSA_padding_add_xxx() encodes B<fl> bytes from B<f> so as to fit into
59B<tlen> bytes and stores the result at B<to>. An error occurs if B<fl>
60does not meet the size requirements of the encoding method.
61
62The following encoding methods are implemented:
63
64=over 4
65
66=item PKCS1_type_1
67
68PKCS #1 v2.0 EMSA-PKCS1-v1_5 (PKCS #1 v1.5 block type 1); used for signatures
69
70=item PKCS1_type_2
71
72PKCS #1 v2.0 EME-PKCS1-v1_5 (PKCS #1 v1.5 block type 2)
73
74=item PKCS1_OAEP
75
76PKCS #1 v2.0 EME-OAEP
77
78=item SSLv23
79
80PKCS #1 EME-PKCS1-v1_5 with SSL-specific modification
81
82=item none
83
84simply copy the data
85
86=back
87
88RSA_padding_check_xxx() verifies that the B<fl> bytes at B<f> contain
89a valid encoding for a B<rsa_len> byte RSA key in the respective
90encoding method and stores the recovered data of at most B<tlen> bytes
91(for B<RSA_NO_PADDING>: of size B<tlen>)
92at B<to>.
93
94For RSA_padding_xxx_OAEP(), B<p> points to the encoding parameter
95of length B<pl>. B<p> may be B<NULL> if B<pl> is 0.
96
97=head1 RETURN VALUES
98
99The RSA_padding_add_xxx() functions return 1 on success, 0 on error.
100The RSA_padding_check_xxx() functions return the length of the
101recovered data, -1 on error. Error codes can be obtained by calling
102L<ERR_get_error(3)|ERR_get_error(3)>.
103
104=head1 SEE ALSO
105
106L<RSA_public_encrypt(3)|RSA_public_encrypt(3)>,
107L<RSA_private_decrypt(3)|RSA_private_decrypt(3)>,
108L<RSA_sign(3)|RSA_sign(3)>, L<RSA_verify(3)|RSA_verify(3)>
109
110=head1 HISTORY
111
112RSA_padding_add_PKCS1_type_1(), RSA_padding_check_PKCS1_type_1(),
113RSA_padding_add_PKCS1_type_2(), RSA_padding_check_PKCS1_type_2(),
114RSA_padding_add_SSLv23(), RSA_padding_check_SSLv23(),
115RSA_padding_add_none() and RSA_padding_check_none() appeared in
116SSLeay 0.9.0.
117
118RSA_padding_add_PKCS1_OAEP() and RSA_padding_check_PKCS1_OAEP() were
119added in OpenSSL 0.9.2b.
120
121=cut
diff --git a/src/lib/libcrypto/doc/RSA_print.pod b/src/lib/libcrypto/doc/RSA_print.pod
deleted file mode 100644
index c971e91f4d..0000000000
--- a/src/lib/libcrypto/doc/RSA_print.pod
+++ /dev/null
@@ -1,49 +0,0 @@
1=pod
2
3=head1 NAME
4
5RSA_print, RSA_print_fp,
6DSAparams_print, DSAparams_print_fp, DSA_print, DSA_print_fp,
7DHparams_print, DHparams_print_fp - print cryptographic parameters
8
9=head1 SYNOPSIS
10
11 #include <openssl/rsa.h>
12
13 int RSA_print(BIO *bp, RSA *x, int offset);
14 int RSA_print_fp(FILE *fp, RSA *x, int offset);
15
16 #include <openssl/dsa.h>
17
18 int DSAparams_print(BIO *bp, DSA *x);
19 int DSAparams_print_fp(FILE *fp, DSA *x);
20 int DSA_print(BIO *bp, DSA *x, int offset);
21 int DSA_print_fp(FILE *fp, DSA *x, int offset);
22
23 #include <openssl/dh.h>
24
25 int DHparams_print(BIO *bp, DH *x);
26 int DHparams_print_fp(FILE *fp, DH *x);
27
28=head1 DESCRIPTION
29
30A human-readable hexadecimal output of the components of the RSA
31key, DSA parameters or key or DH parameters is printed to B<bp> or B<fp>.
32
33The output lines are indented by B<offset> spaces.
34
35=head1 RETURN VALUES
36
37These functions return 1 on success, 0 on error.
38
39=head1 SEE ALSO
40
41L<dh(3)|dh(3)>, L<dsa(3)|dsa(3)>, L<rsa(3)|rsa(3)>, L<BN_bn2bin(3)|BN_bn2bin(3)>
42
43=head1 HISTORY
44
45RSA_print(), RSA_print_fp(), DSA_print(), DSA_print_fp(), DH_print(),
46DH_print_fp() are available in all versions of SSLeay and OpenSSL.
47DSAparams_print() and DSAparams_print_fp() were added in SSLeay 0.8.
48
49=cut
diff --git a/src/lib/libcrypto/doc/RSA_private_encrypt.pod b/src/lib/libcrypto/doc/RSA_private_encrypt.pod
deleted file mode 100644
index aa2bc1bd76..0000000000
--- a/src/lib/libcrypto/doc/RSA_private_encrypt.pod
+++ /dev/null
@@ -1,69 +0,0 @@
1=pod
2
3=head1 NAME
4
5RSA_private_encrypt, RSA_public_decrypt - low level signature operations
6
7=head1 SYNOPSIS
8
9 #include <openssl/rsa.h>
10
11 int RSA_private_encrypt(int flen, unsigned char *from,
12 unsigned char *to, RSA *rsa, int padding);
13
14 int RSA_public_decrypt(int flen, unsigned char *from,
15 unsigned char *to, RSA *rsa, int padding);
16
17=head1 DESCRIPTION
18
19These functions handle RSA signatures at a low level.
20
21RSA_private_encrypt() signs the B<flen> bytes at B<from> (usually a
22message digest with an algorithm identifier) using the private key
23B<rsa> and stores the signature in B<to>. B<to> must point to
24B<RSA_size(rsa)> bytes of memory.
25
26B<padding> denotes one of the following modes:
27
28=over 4
29
30=item RSA_PKCS1_PADDING
31
32PKCS #1 v1.5 padding. This function does not handle the B<algorithmIdentifier>
33specified in PKCS #1. When generating or verifying PKCS #1 signatures,
34L<RSA_sign(3)|RSA_sign(3)> and L<RSA_verify(3)|RSA_verify(3)> should be used.
35
36=item RSA_NO_PADDING
37
38Raw RSA signature. This mode should I<only> be used to implement
39cryptographically sound padding modes in the application code.
40Signing user data directly with RSA is insecure.
41
42=back
43
44RSA_public_decrypt() recovers the message digest from the B<flen>
45bytes long signature at B<from> using the signer's public key
46B<rsa>. B<to> must point to a memory section large enough to hold the
47message digest (which is smaller than B<RSA_size(rsa) -
4811>). B<padding> is the padding mode that was used to sign the data.
49
50=head1 RETURN VALUES
51
52RSA_private_encrypt() returns the size of the signature (i.e.,
53RSA_size(rsa)). RSA_public_decrypt() returns the size of the
54recovered message digest.
55
56On error, -1 is returned; the error codes can be
57obtained by L<ERR_get_error(3)|ERR_get_error(3)>.
58
59=head1 SEE ALSO
60
61L<ERR_get_error(3)|ERR_get_error(3)>, L<rsa(3)|rsa(3)>,
62L<RSA_sign(3)|RSA_sign(3)>, L<RSA_verify(3)|RSA_verify(3)>
63
64=head1 HISTORY
65
66The B<padding> argument was added in SSLeay 0.8. RSA_NO_PADDING is
67available since SSLeay 0.9.0.
68
69=cut
diff --git a/src/lib/libcrypto/doc/RSA_public_encrypt.pod b/src/lib/libcrypto/doc/RSA_public_encrypt.pod
deleted file mode 100644
index 4bbee53f09..0000000000
--- a/src/lib/libcrypto/doc/RSA_public_encrypt.pod
+++ /dev/null
@@ -1,82 +0,0 @@
1=pod
2
3=head1 NAME
4
5RSA_public_encrypt, RSA_private_decrypt - RSA public key cryptography
6
7=head1 SYNOPSIS
8
9 #include <openssl/rsa.h>
10
11 int RSA_public_encrypt(int flen, unsigned char *from,
12 unsigned char *to, RSA *rsa, int padding);
13
14 int RSA_private_decrypt(int flen, unsigned char *from,
15 unsigned char *to, RSA *rsa, int padding);
16
17=head1 DESCRIPTION
18
19RSA_public_encrypt() encrypts the B<flen> bytes at B<from> (usually a
20session key) using the public key B<rsa> and stores the ciphertext in
21B<to>. B<to> must point to RSA_size(B<rsa>) bytes of memory.
22
23B<padding> denotes one of the following modes:
24
25=over 4
26
27=item RSA_PKCS1_PADDING
28
29PKCS #1 v1.5 padding. This currently is the most widely used mode.
30
31=item RSA_PKCS1_OAEP_PADDING
32
33EME-OAEP as defined in PKCS #1 v2.0 with SHA-1, MGF1 and an empty
34encoding parameter. This mode is recommended for all new applications.
35
36=item RSA_SSLV23_PADDING
37
38PKCS #1 v1.5 padding with an SSL-specific modification that denotes
39that the server is SSL3 capable.
40
41=item RSA_NO_PADDING
42
43Raw RSA encryption. This mode should I<only> be used to implement
44cryptographically sound padding modes in the application code.
45Encrypting user data directly with RSA is insecure.
46
47=back
48
49B<flen> must be less than RSA_size(B<rsa>) - 11 for the PKCS #1 v1.5
50based padding modes, less than RSA_size(B<rsa>) - 41 for
51RSA_PKCS1_OAEP_PADDING and exactly RSA_size(B<rsa>) for RSA_NO_PADDING.
52
53RSA_private_decrypt() decrypts the B<flen> bytes at B<from> using the
54private key B<rsa> and stores the plaintext in B<to>. B<to> must point
55to a memory section large enough to hold the decrypted data (which is
56smaller than RSA_size(B<rsa>)). B<padding> is the padding mode that
57was used to encrypt the data.
58
59=head1 RETURN VALUES
60
61RSA_public_encrypt() returns the size of the encrypted data (i.e.,
62RSA_size(B<rsa>)). RSA_private_decrypt() returns the size of the
63recovered plaintext.
64
65On error, -1 is returned; the error codes can be
66obtained by L<ERR_get_error(3)|ERR_get_error(3)>.
67
68=head1 CONFORMING TO
69
70SSL, PKCS #1 v2.0
71
72=head1 SEE ALSO
73
74L<ERR_get_error(3)|ERR_get_error(3)>, L<rand(3)|rand(3)>, L<rsa(3)|rsa(3)>,
75L<RSA_size(3)|RSA_size(3)>
76
77=head1 HISTORY
78
79The B<padding> argument was added in SSLeay 0.8. RSA_NO_PADDING is
80available since SSLeay 0.9.0, OAEP was added in OpenSSL 0.9.2b.
81
82=cut
diff --git a/src/lib/libcrypto/doc/RSA_set_method.pod b/src/lib/libcrypto/doc/RSA_set_method.pod
deleted file mode 100644
index 3f50a89e5c..0000000000
--- a/src/lib/libcrypto/doc/RSA_set_method.pod
+++ /dev/null
@@ -1,201 +0,0 @@
1=pod
2
3=head1 NAME
4
5RSA_set_default_method, RSA_get_default_method, RSA_set_method,
6RSA_get_method, RSA_PKCS1_SSLeay, RSA_null_method, RSA_flags,
7RSA_new_method, RSA_get_default_openssl_method,
8RSA_set_default_openssl_method - select RSA method
9
10=head1 SYNOPSIS
11
12 #include <openssl/rsa.h>
13
14 void RSA_set_default_method(const RSA_METHOD *meth);
15
16 RSA_METHOD *RSA_get_default_method(void);
17
18 int RSA_set_method(RSA *rsa, const RSA_METHOD *meth);
19
20 RSA_METHOD *RSA_get_method(const RSA *rsa);
21
22 RSA_METHOD *RSA_PKCS1_SSLeay(void);
23
24 RSA_METHOD *RSA_null_method(void);
25
26 int RSA_flags(const RSA *rsa);
27
28 RSA *RSA_new_method(RSA_METHOD *method);
29
30=head1 DESCRIPTION
31
32An B<RSA_METHOD> specifies the functions that OpenSSL uses for RSA
33operations. By modifying the method, alternative implementations such as
34hardware accelerators may be used. IMPORTANT: See the NOTES section for
35important information about how these RSA API functions are affected by the
36use of B<ENGINE> API calls.
37
38Initially, the default RSA_METHOD is the OpenSSL internal implementation,
39as returned by RSA_PKCS1_SSLeay().
40
41RSA_set_default_method() makes B<meth> the default method for all RSA
42structures created later. B<NB>: This is true only whilst no ENGINE has
43been set as a default for RSA, so this function is no longer recommended.
44
45RSA_get_default_method() returns a pointer to the current default
46RSA_METHOD. However, the meaningfulness of this result is dependent on
47whether the ENGINE API is being used, so this function is no longer
48recommended.
49
50RSA_set_method() selects B<meth> to perform all operations using the key
51B<rsa>. This will replace the RSA_METHOD used by the RSA key and if the
52previous method was supplied by an ENGINE, the handle to that ENGINE will
53be released during the change. It is possible to have RSA keys that only
54work with certain RSA_METHOD implementations (eg. from an ENGINE module
55that supports embedded hardware-protected keys), and in such cases
56attempting to change the RSA_METHOD for the key can have unexpected
57results.
58
59RSA_get_method() returns a pointer to the RSA_METHOD being used by B<rsa>.
60This method may or may not be supplied by an ENGINE implementation, but if
61it is, the return value can only be guaranteed to be valid as long as the
62RSA key itself is valid and does not have its implementation changed by
63RSA_set_method().
64
65RSA_flags() returns the B<flags> that are set for B<rsa>'s current
66RSA_METHOD. See the BUGS section.
67
68RSA_new_method() allocates and initializes an RSA structure so that
69B<engine> will be used for the RSA operations. If B<engine> is NULL, the
70default ENGINE for RSA operations is used, and if no default ENGINE is set,
71the RSA_METHOD controlled by RSA_set_default_method() is used.
72
73RSA_flags() returns the B<flags> that are set for B<rsa>'s current method.
74
75RSA_new_method() allocates and initializes an B<RSA> structure so that
76B<method> will be used for the RSA operations. If B<method> is B<NULL>,
77the default method is used.
78
79=head1 THE RSA_METHOD STRUCTURE
80
81 typedef struct rsa_meth_st
82 {
83 /* name of the implementation */
84 const char *name;
85
86 /* encrypt */
87 int (*rsa_pub_enc)(int flen, unsigned char *from,
88 unsigned char *to, RSA *rsa, int padding);
89
90 /* verify arbitrary data */
91 int (*rsa_pub_dec)(int flen, unsigned char *from,
92 unsigned char *to, RSA *rsa, int padding);
93
94 /* sign arbitrary data */
95 int (*rsa_priv_enc)(int flen, unsigned char *from,
96 unsigned char *to, RSA *rsa, int padding);
97
98 /* decrypt */
99 int (*rsa_priv_dec)(int flen, unsigned char *from,
100 unsigned char *to, RSA *rsa, int padding);
101
102 /* compute r0 = r0 ^ I mod rsa->n (May be NULL for some
103 implementations) */
104 int (*rsa_mod_exp)(BIGNUM *r0, BIGNUM *I, RSA *rsa);
105
106 /* compute r = a ^ p mod m (May be NULL for some implementations) */
107 int (*bn_mod_exp)(BIGNUM *r, BIGNUM *a, const BIGNUM *p,
108 const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx);
109
110 /* called at RSA_new */
111 int (*init)(RSA *rsa);
112
113 /* called at RSA_free */
114 int (*finish)(RSA *rsa);
115
116 /* RSA_FLAG_EXT_PKEY - rsa_mod_exp is called for private key
117 * operations, even if p,q,dmp1,dmq1,iqmp
118 * are NULL
119 * RSA_FLAG_SIGN_VER - enable rsa_sign and rsa_verify
120 * RSA_METHOD_FLAG_NO_CHECK - don't check pub/private match
121 */
122 int flags;
123
124 char *app_data; /* ?? */
125
126 /* sign. For backward compatibility, this is used only
127 * if (flags & RSA_FLAG_SIGN_VER)
128 */
129 int (*rsa_sign)(int type, unsigned char *m, unsigned int m_len,
130 unsigned char *sigret, unsigned int *siglen, RSA *rsa);
131
132 /* verify. For backward compatibility, this is used only
133 * if (flags & RSA_FLAG_SIGN_VER)
134 */
135 int (*rsa_verify)(int type, unsigned char *m, unsigned int m_len,
136 unsigned char *sigbuf, unsigned int siglen, RSA *rsa);
137
138 } RSA_METHOD;
139
140=head1 RETURN VALUES
141
142RSA_PKCS1_SSLeay(), RSA_PKCS1_null_method(), RSA_get_default_method()
143and RSA_get_method() return pointers to the respective RSA_METHODs.
144
145RSA_set_method() returns a pointer to the old RSA_METHOD implementation
146that was replaced. However, this return value should probably be ignored
147because if it was supplied by an ENGINE, the pointer could be invalidated
148at any time if the ENGINE is unloaded (in fact it could be unloaded as a
149result of the RSA_set_method() function releasing its handle to the
150ENGINE). For this reason, the return type may be replaced with a B<void>
151declaration in a future release.
152
153RSA_new_method() returns NULL and sets an error code that can be obtained
154by L<ERR_get_error(3)|ERR_get_error(3)> if the allocation fails. Otherwise
155it returns a pointer to the newly allocated structure.
156
157=head1 NOTES
158
159As of version 0.9.7, RSA_METHOD implementations are grouped together with
160other algorithmic APIs (eg. DSA_METHOD, EVP_CIPHER, etc) into B<ENGINE>
161modules. If a default ENGINE is specified for RSA functionality using an
162ENGINE API function, that will override any RSA defaults set using the RSA
163API (ie. RSA_set_default_method()). For this reason, the ENGINE API is the
164recommended way to control default implementations for use in RSA and other
165cryptographic algorithms.
166
167=head1 BUGS
168
169The behaviour of RSA_flags() is a mis-feature that is left as-is for now
170to avoid creating compatibility problems. RSA functionality, such as the
171encryption functions, are controlled by the B<flags> value in the RSA key
172itself, not by the B<flags> value in the RSA_METHOD attached to the RSA key
173(which is what this function returns). If the flags element of an RSA key
174is changed, the changes will be honoured by RSA functionality but will not
175be reflected in the return value of the RSA_flags() function - in effect
176RSA_flags() behaves more like an RSA_default_flags() function (which does
177not currently exist).
178
179=head1 SEE ALSO
180
181L<rsa(3)|rsa(3)>, L<RSA_new(3)|RSA_new(3)>
182
183=head1 HISTORY
184
185RSA_new_method() and RSA_set_default_method() appeared in SSLeay 0.8.
186RSA_get_default_method(), RSA_set_method() and RSA_get_method() as
187well as the rsa_sign and rsa_verify components of RSA_METHOD were
188added in OpenSSL 0.9.4.
189
190RSA_set_default_openssl_method() and RSA_get_default_openssl_method()
191replaced RSA_set_default_method() and RSA_get_default_method()
192respectively, and RSA_set_method() and RSA_new_method() were altered to use
193B<ENGINE>s rather than B<RSA_METHOD>s during development of the engine
194version of OpenSSL 0.9.6. For 0.9.7, the handling of defaults in the ENGINE
195API was restructured so that this change was reversed, and behaviour of the
196other functions resembled more closely the previous behaviour. The
197behaviour of defaults in the ENGINE API now transparently overrides the
198behaviour of defaults in the RSA API without requiring changing these
199function prototypes.
200
201=cut
diff --git a/src/lib/libcrypto/doc/RSA_sign.pod b/src/lib/libcrypto/doc/RSA_sign.pod
deleted file mode 100644
index 51587bdc41..0000000000
--- a/src/lib/libcrypto/doc/RSA_sign.pod
+++ /dev/null
@@ -1,61 +0,0 @@
1=pod
2
3=head1 NAME
4
5RSA_sign, RSA_verify - RSA signatures
6
7=head1 SYNOPSIS
8
9 #include <openssl/rsa.h>
10
11 int RSA_sign(int type, const unsigned char *m, unsigned int m_len,
12 unsigned char *sigret, unsigned int *siglen, RSA *rsa);
13
14 int RSA_verify(int type, const unsigned char *m, unsigned int m_len,
15 unsigned char *sigbuf, unsigned int siglen, RSA *rsa);
16
17=head1 DESCRIPTION
18
19RSA_sign() signs the message digest B<m> of size B<m_len> using the
20private key B<rsa> as specified in PKCS #1 v2.0. It stores the
21signature in B<sigret> and the signature size in B<siglen>. B<sigret>
22must point to RSA_size(B<rsa>) bytes of memory.
23Note that PKCS #1 adds meta-data, placing limits on the size of the
24key that can be used.
25See L<RSA_private_encrypt(3)|RSA_private_encrypt(3)> for lower-level
26operations.
27
28B<type> denotes the message digest algorithm that was used to generate
29B<m>. It usually is one of B<NID_sha1>, B<NID_ripemd160> and B<NID_md5>;
30see L<objects(3)|objects(3)> for details. If B<type> is B<NID_md5_sha1>,
31an SSL signature (MD5 and SHA1 message digests with PKCS #1 padding
32and no algorithm identifier) is created.
33
34RSA_verify() verifies that the signature B<sigbuf> of size B<siglen>
35matches a given message digest B<m> of size B<m_len>. B<type> denotes
36the message digest algorithm that was used to generate the signature.
37B<rsa> is the signer's public key.
38
39=head1 RETURN VALUES
40
41RSA_sign() returns 1 on success, 0 otherwise. RSA_verify() returns 1
42on successful verification, 0 otherwise.
43
44The error codes can be obtained by L<ERR_get_error(3)|ERR_get_error(3)>.
45
46=head1 CONFORMING TO
47
48SSL, PKCS #1 v2.0
49
50=head1 SEE ALSO
51
52L<ERR_get_error(3)|ERR_get_error(3)>, L<objects(3)|objects(3)>,
53L<rsa(3)|rsa(3)>, L<RSA_private_encrypt(3)|RSA_private_encrypt(3)>,
54L<RSA_public_decrypt(3)|RSA_public_decrypt(3)>
55
56=head1 HISTORY
57
58RSA_sign() and RSA_verify() are available in all versions of SSLeay
59and OpenSSL.
60
61=cut
diff --git a/src/lib/libcrypto/doc/RSA_sign_ASN1_OCTET_STRING.pod b/src/lib/libcrypto/doc/RSA_sign_ASN1_OCTET_STRING.pod
deleted file mode 100644
index 664b46174b..0000000000
--- a/src/lib/libcrypto/doc/RSA_sign_ASN1_OCTET_STRING.pod
+++ /dev/null
@@ -1,57 +0,0 @@
1=pod
2
3=head1 NAME
4
5RSA_sign_ASN1_OCTET_STRING, RSA_verify_ASN1_OCTET_STRING - RSA signatures
6
7=head1 SYNOPSIS
8
9 #include <openssl/rsa.h>
10
11 int RSA_sign_ASN1_OCTET_STRING(int dummy, unsigned char *m,
12 unsigned int m_len, unsigned char *sigret, unsigned int *siglen,
13 RSA *rsa);
14
15 int RSA_verify_ASN1_OCTET_STRING(int dummy, unsigned char *m,
16 unsigned int m_len, unsigned char *sigbuf, unsigned int siglen,
17 RSA *rsa);
18
19=head1 DESCRIPTION
20
21RSA_sign_ASN1_OCTET_STRING() signs the octet string B<m> of size
22B<m_len> using the private key B<rsa> represented in DER using PKCS #1
23padding. It stores the signature in B<sigret> and the signature size
24in B<siglen>. B<sigret> must point to B<RSA_size(rsa)> bytes of
25memory.
26
27B<dummy> is ignored.
28
29RSA_verify_ASN1_OCTET_STRING() verifies that the signature B<sigbuf>
30of size B<siglen> is the DER representation of a given octet string
31B<m> of size B<m_len>. B<dummy> is ignored. B<rsa> is the signer's
32public key.
33
34=head1 RETURN VALUES
35
36RSA_sign_ASN1_OCTET_STRING() returns 1 on success, 0 otherwise.
37RSA_verify_ASN1_OCTET_STRING() returns 1 on successful verification, 0
38otherwise.
39
40The error codes can be obtained by L<ERR_get_error(3)|ERR_get_error(3)>.
41
42=head1 BUGS
43
44These functions serve no recognizable purpose.
45
46=head1 SEE ALSO
47
48L<ERR_get_error(3)|ERR_get_error(3)>, L<objects(3)|objects(3)>,
49L<rand(3)|rand(3)>, L<rsa(3)|rsa(3)>, L<RSA_sign(3)|RSA_sign(3)>,
50L<RSA_verify(3)|RSA_verify(3)>
51
52=head1 HISTORY
53
54RSA_sign_ASN1_OCTET_STRING() and RSA_verify_ASN1_OCTET_STRING() were
55added in SSLeay 0.8.
56
57=cut
diff --git a/src/lib/libcrypto/doc/RSA_size.pod b/src/lib/libcrypto/doc/RSA_size.pod
deleted file mode 100644
index 5b7f835f95..0000000000
--- a/src/lib/libcrypto/doc/RSA_size.pod
+++ /dev/null
@@ -1,33 +0,0 @@
1=pod
2
3=head1 NAME
4
5RSA_size - get RSA modulus size
6
7=head1 SYNOPSIS
8
9 #include <openssl/rsa.h>
10
11 int RSA_size(const RSA *rsa);
12
13=head1 DESCRIPTION
14
15This function returns the RSA modulus size in bytes. It can be used to
16determine how much memory must be allocated for an RSA encrypted
17value.
18
19B<rsa-E<gt>n> must not be B<NULL>.
20
21=head1 RETURN VALUE
22
23The size in bytes.
24
25=head1 SEE ALSO
26
27L<rsa(3)|rsa(3)>
28
29=head1 HISTORY
30
31RSA_size() is available in all versions of SSLeay and OpenSSL.
32
33=cut
diff --git a/src/lib/libcrypto/doc/d2i_RSAPublicKey.pod b/src/lib/libcrypto/doc/d2i_RSAPublicKey.pod
deleted file mode 100644
index 11515d0ace..0000000000
--- a/src/lib/libcrypto/doc/d2i_RSAPublicKey.pod
+++ /dev/null
@@ -1,63 +0,0 @@
1=pod
2
3=head1 NAME
4
5d2i_RSAPublicKey, i2d_RSAPublicKey, d2i_RSAPrivateKey, i2d_RSAPrivateKey,
6d2i_RSA_PUBKEY, i2d_RSA_PUBKEY, i2d_Netscape_RSA,
7d2i_Netscape_RSA - RSA public and private key encoding functions.
8
9=head1 SYNOPSIS
10
11 #include <openssl/rsa.h>
12 #include <openssl/x509.h>
13
14 RSA * d2i_RSAPublicKey(RSA **a, const unsigned char **pp, long length);
15
16 int i2d_RSAPublicKey(RSA *a, unsigned char **pp);
17
18 RSA * d2i_RSA_PUBKEY(RSA **a, const unsigned char **pp, long length);
19
20 int i2d_RSA_PUBKEY(RSA *a, unsigned char **pp);
21
22 RSA * d2i_RSAPrivateKey(RSA **a, const unsigned char **pp, long length);
23
24 int i2d_RSAPrivateKey(RSA *a, unsigned char **pp);
25
26 int i2d_Netscape_RSA(RSA *a, unsigned char **pp, int (*cb)());
27
28 RSA * d2i_Netscape_RSA(RSA **a, const unsigned char **pp, long length, int (*cb)());
29
30=head1 DESCRIPTION
31
32d2i_RSAPublicKey() and i2d_RSAPublicKey() decode and encode a PKCS#1
33RSAPublicKey structure.
34
35d2i_RSA_PUBKEY() and i2d_RSA_PUBKEY() decode and encode an RSA public key using
36a SubjectPublicKeyInfo (certificate public key) structure.
37
38d2i_RSAPrivateKey(), i2d_RSAPrivateKey() decode and encode a PKCS#1
39RSAPrivateKey structure.
40
41d2i_Netscape_RSA(), i2d_Netscape_RSA() decode and encode an RSA private key in
42NET format.
43
44The usage of all of these functions is similar to the d2i_X509() and
45i2d_X509() described in the L<d2i_X509(3)|d2i_X509(3)> manual page.
46
47=head1 NOTES
48
49The B<RSA> structure passed to the private key encoding functions should have
50all the PKCS#1 private key components present.
51
52The data encoded by the private key functions is unencrypted and therefore
53offers no private key security.
54
55The NET format functions are present to provide compatibility with certain very
56old software. This format has some severe security weaknesses and should be
57avoided if possible.
58
59=head1 SEE ALSO
60
61L<d2i_X509(3)|d2i_X509(3)>
62
63=cut
diff --git a/src/lib/libcrypto/doc/rsa.pod b/src/lib/libcrypto/doc/rsa.pod
deleted file mode 100644
index 829ce24701..0000000000
--- a/src/lib/libcrypto/doc/rsa.pod
+++ /dev/null
@@ -1,123 +0,0 @@
1=pod
2
3=head1 NAME
4
5rsa - RSA public key cryptosystem
6
7=head1 SYNOPSIS
8
9 #include <openssl/rsa.h>
10 #include <openssl/engine.h>
11
12 RSA * RSA_new(void);
13 void RSA_free(RSA *rsa);
14
15 int RSA_public_encrypt(int flen, unsigned char *from,
16 unsigned char *to, RSA *rsa, int padding);
17 int RSA_private_decrypt(int flen, unsigned char *from,
18 unsigned char *to, RSA *rsa, int padding);
19 int RSA_private_encrypt(int flen, unsigned char *from,
20 unsigned char *to, RSA *rsa,int padding);
21 int RSA_public_decrypt(int flen, unsigned char *from,
22 unsigned char *to, RSA *rsa,int padding);
23
24 int RSA_sign(int type, unsigned char *m, unsigned int m_len,
25 unsigned char *sigret, unsigned int *siglen, RSA *rsa);
26 int RSA_verify(int type, unsigned char *m, unsigned int m_len,
27 unsigned char *sigbuf, unsigned int siglen, RSA *rsa);
28
29 int RSA_size(const RSA *rsa);
30
31 RSA *RSA_generate_key(int num, unsigned long e,
32 void (*callback)(int,int,void *), void *cb_arg);
33
34 int RSA_check_key(RSA *rsa);
35
36 int RSA_blinding_on(RSA *rsa, BN_CTX *ctx);
37 void RSA_blinding_off(RSA *rsa);
38
39 void RSA_set_default_method(const RSA_METHOD *meth);
40 const RSA_METHOD *RSA_get_default_method(void);
41 int RSA_set_method(RSA *rsa, const RSA_METHOD *meth);
42 const RSA_METHOD *RSA_get_method(const RSA *rsa);
43 RSA_METHOD *RSA_PKCS1_SSLeay(void);
44 RSA_METHOD *RSA_null_method(void);
45 int RSA_flags(const RSA *rsa);
46 RSA *RSA_new_method(ENGINE *engine);
47
48 int RSA_print(BIO *bp, RSA *x, int offset);
49 int RSA_print_fp(FILE *fp, RSA *x, int offset);
50
51 int RSA_get_ex_new_index(long argl, char *argp, int (*new_func)(),
52 int (*dup_func)(), void (*free_func)());
53 int RSA_set_ex_data(RSA *r,int idx,char *arg);
54 char *RSA_get_ex_data(RSA *r, int idx);
55
56 int RSA_sign_ASN1_OCTET_STRING(int dummy, unsigned char *m,
57 unsigned int m_len, unsigned char *sigret, unsigned int *siglen,
58 RSA *rsa);
59 int RSA_verify_ASN1_OCTET_STRING(int dummy, unsigned char *m,
60 unsigned int m_len, unsigned char *sigbuf, unsigned int siglen,
61 RSA *rsa);
62
63=head1 DESCRIPTION
64
65These functions implement RSA public key encryption and signatures
66as defined in PKCS #1 v2.0 [RFC 2437].
67
68The B<RSA> structure consists of several BIGNUM components. It can
69contain public as well as private RSA keys:
70
71 struct
72 {
73 BIGNUM *n; // public modulus
74 BIGNUM *e; // public exponent
75 BIGNUM *d; // private exponent
76 BIGNUM *p; // secret prime factor
77 BIGNUM *q; // secret prime factor
78 BIGNUM *dmp1; // d mod (p-1)
79 BIGNUM *dmq1; // d mod (q-1)
80 BIGNUM *iqmp; // q^-1 mod p
81 // ...
82 };
83 RSA
84
85In public keys, the private exponent and the related secret values are
86B<NULL>.
87
88B<p>, B<q>, B<dmp1>, B<dmq1> and B<iqmp> may be B<NULL> in private
89keys, but the RSA operations are much faster when these values are
90available.
91
92Note that RSA keys may use non-standard B<RSA_METHOD> implementations,
93either directly or by the use of B<ENGINE> modules. In some cases (eg. an
94ENGINE providing support for hardware-embedded keys), these BIGNUM values
95will not be used by the implementation or may be used for alternative data
96storage. For this reason, applications should generally avoid using RSA
97structure elements directly and instead use API functions to query or
98modify keys.
99
100=head1 CONFORMING TO
101
102SSL, PKCS #1 v2.0
103
104=head1 PATENTS
105
106RSA was covered by a US patent which expired in September 2000.
107
108=head1 SEE ALSO
109
110L<rsa(1)|rsa(1)>, L<bn(3)|bn(3)>, L<dsa(3)|dsa(3)>, L<dh(3)|dh(3)>,
111L<rand(3)|rand(3)>, L<engine(3)|engine(3)>, L<RSA_new(3)|RSA_new(3)>,
112L<RSA_public_encrypt(3)|RSA_public_encrypt(3)>,
113L<RSA_sign(3)|RSA_sign(3)>, L<RSA_size(3)|RSA_size(3)>,
114L<RSA_generate_key(3)|RSA_generate_key(3)>,
115L<RSA_check_key(3)|RSA_check_key(3)>,
116L<RSA_blinding_on(3)|RSA_blinding_on(3)>,
117L<RSA_set_method(3)|RSA_set_method(3)>, L<RSA_print(3)|RSA_print(3)>,
118L<RSA_get_ex_new_index(3)|RSA_get_ex_new_index(3)>,
119L<RSA_private_encrypt(3)|RSA_private_encrypt(3)>,
120L<RSA_sign_ASN1_OCTET_STRING(3)|RSA_sign_ASN1_OCTET_STRING(3)>,
121L<RSA_padding_add_PKCS1_type_1(3)|RSA_padding_add_PKCS1_type_1(3)>
122
123=cut