summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/doc/RSA_set_method.pod
diff options
context:
space:
mode:
authormarkus <>2002-09-05 12:51:50 +0000
committermarkus <>2002-09-05 12:51:50 +0000
commit15b5d84f9da2ce4bfae8580e56e34a859f74ad71 (patch)
treebf939e82d7fd73cc8a01cf6959002209972091bc /src/lib/libcrypto/doc/RSA_set_method.pod
parent027351f729b9e837200dae6e1520cda6577ab930 (diff)
downloadopenbsd-15b5d84f9da2ce4bfae8580e56e34a859f74ad71.tar.gz
openbsd-15b5d84f9da2ce4bfae8580e56e34a859f74ad71.tar.bz2
openbsd-15b5d84f9da2ce4bfae8580e56e34a859f74ad71.zip
import openssl-0.9.7-beta1
Diffstat (limited to 'src/lib/libcrypto/doc/RSA_set_method.pod')
-rw-r--r--src/lib/libcrypto/doc/RSA_set_method.pod83
1 files changed, 43 insertions, 40 deletions
diff --git a/src/lib/libcrypto/doc/RSA_set_method.pod b/src/lib/libcrypto/doc/RSA_set_method.pod
index deb1183a23..14917dd35f 100644
--- a/src/lib/libcrypto/doc/RSA_set_method.pod
+++ b/src/lib/libcrypto/doc/RSA_set_method.pod
@@ -3,30 +3,29 @@
3=head1 NAME 3=head1 NAME
4 4
5RSA_set_default_method, RSA_get_default_method, RSA_set_method, 5RSA_set_default_method, RSA_get_default_method, RSA_set_method,
6RSA_get_method, RSA_PKCS1_SSLeay, RSA_PKCS1_RSAref, 6RSA_get_method, RSA_PKCS1_SSLeay,
7RSA_PKCS1_null_method, RSA_flags, RSA_new_method - select RSA method 7RSA_null_method, RSA_flags, RSA_new_method - select RSA method
8 8
9=head1 SYNOPSIS 9=head1 SYNOPSIS
10 10
11 #include <openssl/rsa.h> 11 #include <openssl/rsa.h>
12 #include <openssl/engine.h>
12 13
13 void RSA_set_default_method(RSA_METHOD *meth); 14 void RSA_set_default_openssl_method(RSA_METHOD *meth);
14 15
15 RSA_METHOD *RSA_get_default_method(void); 16 RSA_METHOD *RSA_get_default_openssl_method(void);
16 17
17 RSA_METHOD *RSA_set_method(RSA *rsa, RSA_METHOD *meth); 18 int RSA_set_method(RSA *rsa, ENGINE *engine);
18 19
19 RSA_METHOD *RSA_get_method(RSA *rsa); 20 RSA_METHOD *RSA_get_method(RSA *rsa);
20 21
21 RSA_METHOD *RSA_PKCS1_SSLeay(void); 22 RSA_METHOD *RSA_PKCS1_SSLeay(void);
22 23
23 RSA_METHOD *RSA_PKCS1_RSAref(void);
24
25 RSA_METHOD *RSA_null_method(void); 24 RSA_METHOD *RSA_null_method(void);
26 25
27 int RSA_flags(RSA *rsa); 26 int RSA_flags(RSA *rsa);
28 27
29 RSA *RSA_new_method(RSA_METHOD *method); 28 RSA *RSA_new_method(ENGINE *engine);
30 29
31=head1 DESCRIPTION 30=head1 DESCRIPTION
32 31
@@ -34,35 +33,30 @@ An B<RSA_METHOD> specifies the functions that OpenSSL uses for RSA
34operations. By modifying the method, alternative implementations 33operations. By modifying the method, alternative implementations
35such as hardware accelerators may be used. 34such as hardware accelerators may be used.
36 35
37Initially, the default is to use the OpenSSL internal implementation, 36Initially, the default is to use the OpenSSL internal implementation.
38unless OpenSSL was configured with the C<rsaref> or C<-DRSA_NULL> 37RSA_PKCS1_SSLeay() returns a pointer to that method.
39options. RSA_PKCS1_SSLeay() returns a pointer to that method.
40
41RSA_PKCS1_RSAref() returns a pointer to a method that uses the RSAref
42library. This is the default method in the C<rsaref> configuration;
43the function is not available in other configurations.
44RSA_null_method() returns a pointer to a method that does not support
45the RSA transformation. It is the default if OpenSSL is compiled with
46C<-DRSA_NULL>. These methods may be useful in the USA because of a
47patent on the RSA cryptosystem.
48 38
49RSA_set_default_method() makes B<meth> the default method for all B<RSA> 39RSA_set_default_openssl_method() makes B<meth> the default method for all B<RSA>
50structures created later. 40structures created later. B<NB:> This is true only whilst the default engine
41for RSA operations remains as "openssl". ENGINEs provide an
42encapsulation for implementations of one or more algorithms at a time, and all
43the RSA functions mentioned here operate within the scope of the default
44"openssl" engine.
51 45
52RSA_get_default_method() returns a pointer to the current default 46RSA_get_default_openssl_method() returns a pointer to the current default
53method. 47method for the "openssl" engine.
54 48
55RSA_set_method() selects B<meth> for all operations using the key 49RSA_set_method() selects B<engine> for all operations using the key
56B<rsa>. 50B<rsa>.
57 51
58RSA_get_method() returns a pointer to the method currently selected 52RSA_get_method() returns a pointer to the RSA_METHOD from the currently
59for B<rsa>. 53selected ENGINE for B<rsa>.
60 54
61RSA_flags() returns the B<flags> that are set for B<rsa>'s current method. 55RSA_flags() returns the B<flags> that are set for B<rsa>'s current method.
62 56
63RSA_new_method() allocates and initializes an B<RSA> structure so that 57RSA_new_method() allocates and initializes an RSA structure so that
64B<method> will be used for the RSA operations. If B<method> is B<NULL>, 58B<engine> will be used for the RSA operations. If B<engine> is NULL,
65the default method is used. 59the default engine for RSA operations is used.
66 60
67=head1 THE RSA_METHOD STRUCTURE 61=head1 THE RSA_METHOD STRUCTURE
68 62
@@ -87,10 +81,11 @@ the default method is used.
87 int (*rsa_priv_dec)(int flen, unsigned char *from, 81 int (*rsa_priv_dec)(int flen, unsigned char *from,
88 unsigned char *to, RSA *rsa, int padding); 82 unsigned char *to, RSA *rsa, int padding);
89 83
90 /* compute r0 = r0 ^ I mod rsa->n. May be NULL */ 84 /* compute r0 = r0 ^ I mod rsa->n (May be NULL for some
85 implementations) */
91 int (*rsa_mod_exp)(BIGNUM *r0, BIGNUM *I, RSA *rsa); 86 int (*rsa_mod_exp)(BIGNUM *r0, BIGNUM *I, RSA *rsa);
92 87
93 /* compute r = a ^ p mod m. May be NULL */ 88 /* compute r = a ^ p mod m (May be NULL for some implementations) */
94 int (*bn_mod_exp)(BIGNUM *r, BIGNUM *a, const BIGNUM *p, 89 int (*bn_mod_exp)(BIGNUM *r, BIGNUM *a, const BIGNUM *p,
95 const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx); 90 const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx);
96 91
@@ -126,18 +121,21 @@ the default method is used.
126 121
127=head1 RETURN VALUES 122=head1 RETURN VALUES
128 123
129RSA_PKCS1_SSLeay(), RSA_PKCS1_RSAref(), RSA_PKCS1_null_method(), 124RSA_PKCS1_SSLeay(), RSA_PKCS1_null_method(), RSA_get_default_openssl_method()
130RSA_get_default_method() and RSA_get_method() return pointers to the 125and RSA_get_method() return pointers to the respective RSA_METHODs.
131respective B<RSA_METHOD>s.
132 126
133RSA_set_default_method() returns no value. 127RSA_set_default_openssl_method() returns no value.
134 128
135RSA_set_method() returns a pointer to the B<RSA_METHOD> previously 129RSA_set_method() selects B<engine> as the engine that will be responsible for
136associated with B<rsa>. 130all operations using the structure B<rsa>. If this function completes successfully,
131then the B<rsa> structure will have its own functional reference of B<engine>, so
132the caller should remember to free their own reference to B<engine> when they are
133finished with it. NB: An ENGINE's RSA_METHOD can be retrieved (or set) by
134ENGINE_get_RSA() or ENGINE_set_RSA().
137 135
138RSA_new_method() returns B<NULL> and sets an error code that can be 136RSA_new_method() returns NULL and sets an error code that can be
139obtained by L<ERR_get_error(3)|ERR_get_error(3)> if the allocation fails. Otherwise it 137obtained by L<ERR_get_error(3)|ERR_get_error(3)> if the allocation fails. Otherwise
140returns a pointer to the newly allocated structure. 138it returns a pointer to the newly allocated structure.
141 139
142=head1 SEE ALSO 140=head1 SEE ALSO
143 141
@@ -150,4 +148,9 @@ RSA_get_default_method(), RSA_set_method() and RSA_get_method() as
150well as the rsa_sign and rsa_verify components of RSA_METHOD were 148well as the rsa_sign and rsa_verify components of RSA_METHOD were
151added in OpenSSL 0.9.4. 149added in OpenSSL 0.9.4.
152 150
151RSA_set_default_openssl_method() and RSA_get_default_openssl_method()
152replaced RSA_set_default_method() and RSA_get_default_method() respectively,
153and RSA_set_method() and RSA_new_method() were altered to use B<ENGINE>s
154rather than B<RSA_METHOD>s during development of OpenSSL 0.9.6.
155
153=cut 156=cut