diff options
Diffstat (limited to 'src/lib/libcrypto/doc/RSA_set_method.pod')
| -rw-r--r-- | src/lib/libcrypto/doc/RSA_set_method.pod | 83 | 
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 | ||
| 5 | RSA_set_default_method, RSA_get_default_method, RSA_set_method, | 5 | RSA_set_default_method, RSA_get_default_method, RSA_set_method, | 
| 6 | RSA_get_method, RSA_PKCS1_SSLeay, RSA_PKCS1_RSAref, | 6 | RSA_get_method, RSA_PKCS1_SSLeay, | 
| 7 | RSA_PKCS1_null_method, RSA_flags, RSA_new_method - select RSA method | 7 | RSA_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 | |||
| 34 | operations. By modifying the method, alternative implementations | 33 | operations. By modifying the method, alternative implementations | 
| 35 | such as hardware accelerators may be used. | 34 | such as hardware accelerators may be used. | 
| 36 | 35 | ||
| 37 | Initially, the default is to use the OpenSSL internal implementation, | 36 | Initially, the default is to use the OpenSSL internal implementation. | 
| 38 | unless OpenSSL was configured with the C<rsaref> or C<-DRSA_NULL> | 37 | RSA_PKCS1_SSLeay() returns a pointer to that method. | 
| 39 | options. RSA_PKCS1_SSLeay() returns a pointer to that method. | ||
| 40 | |||
| 41 | RSA_PKCS1_RSAref() returns a pointer to a method that uses the RSAref | ||
| 42 | library. This is the default method in the C<rsaref> configuration; | ||
| 43 | the function is not available in other configurations. | ||
| 44 | RSA_null_method() returns a pointer to a method that does not support | ||
| 45 | the RSA transformation. It is the default if OpenSSL is compiled with | ||
| 46 | C<-DRSA_NULL>. These methods may be useful in the USA because of a | ||
| 47 | patent on the RSA cryptosystem. | ||
| 48 | 38 | ||
| 49 | RSA_set_default_method() makes B<meth> the default method for all B<RSA> | 39 | RSA_set_default_openssl_method() makes B<meth> the default method for all B<RSA> | 
| 50 | structures created later. | 40 | structures created later. B<NB:> This is true only whilst the default engine | 
| 41 | for RSA operations remains as "openssl". ENGINEs provide an | ||
| 42 | encapsulation for implementations of one or more algorithms at a time, and all | ||
| 43 | the RSA functions mentioned here operate within the scope of the default | ||
| 44 | "openssl" engine. | ||
| 51 | 45 | ||
| 52 | RSA_get_default_method() returns a pointer to the current default | 46 | RSA_get_default_openssl_method() returns a pointer to the current default | 
| 53 | method. | 47 | method for the "openssl" engine. | 
| 54 | 48 | ||
| 55 | RSA_set_method() selects B<meth> for all operations using the key | 49 | RSA_set_method() selects B<engine> for all operations using the key | 
| 56 | B<rsa>. | 50 | B<rsa>. | 
| 57 | 51 | ||
| 58 | RSA_get_method() returns a pointer to the method currently selected | 52 | RSA_get_method() returns a pointer to the RSA_METHOD from the currently | 
| 59 | for B<rsa>. | 53 | selected ENGINE for B<rsa>. | 
| 60 | 54 | ||
| 61 | RSA_flags() returns the B<flags> that are set for B<rsa>'s current method. | 55 | RSA_flags() returns the B<flags> that are set for B<rsa>'s current method. | 
| 62 | 56 | ||
| 63 | RSA_new_method() allocates and initializes an B<RSA> structure so that | 57 | RSA_new_method() allocates and initializes an RSA structure so that | 
| 64 | B<method> will be used for the RSA operations. If B<method> is B<NULL>, | 58 | B<engine> will be used for the RSA operations. If B<engine> is NULL, | 
| 65 | the default method is used. | 59 | the 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 | ||
| 129 | RSA_PKCS1_SSLeay(), RSA_PKCS1_RSAref(), RSA_PKCS1_null_method(), | 124 | RSA_PKCS1_SSLeay(), RSA_PKCS1_null_method(), RSA_get_default_openssl_method() | 
| 130 | RSA_get_default_method() and RSA_get_method() return pointers to the | 125 | and RSA_get_method() return pointers to the respective RSA_METHODs. | 
| 131 | respective B<RSA_METHOD>s. | ||
| 132 | 126 | ||
| 133 | RSA_set_default_method() returns no value. | 127 | RSA_set_default_openssl_method() returns no value. | 
| 134 | 128 | ||
| 135 | RSA_set_method() returns a pointer to the B<RSA_METHOD> previously | 129 | RSA_set_method() selects B<engine> as the engine that will be responsible for | 
| 136 | associated with B<rsa>. | 130 | all operations using the structure B<rsa>. If this function completes successfully, | 
| 131 | then the B<rsa> structure will have its own functional reference of B<engine>, so | ||
| 132 | the caller should remember to free their own reference to B<engine> when they are | ||
| 133 | finished with it. NB: An ENGINE's RSA_METHOD can be retrieved (or set) by | ||
| 134 | ENGINE_get_RSA() or ENGINE_set_RSA(). | ||
| 137 | 135 | ||
| 138 | RSA_new_method() returns B<NULL> and sets an error code that can be | 136 | RSA_new_method() returns NULL and sets an error code that can be | 
| 139 | obtained by L<ERR_get_error(3)|ERR_get_error(3)> if the allocation fails. Otherwise it | 137 | obtained by L<ERR_get_error(3)|ERR_get_error(3)> if the allocation fails. Otherwise | 
| 140 | returns a pointer to the newly allocated structure. | 138 | it 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 | |||
| 150 | well as the rsa_sign and rsa_verify components of RSA_METHOD were | 148 | well as the rsa_sign and rsa_verify components of RSA_METHOD were | 
| 151 | added in OpenSSL 0.9.4. | 149 | added in OpenSSL 0.9.4. | 
| 152 | 150 | ||
| 151 | RSA_set_default_openssl_method() and RSA_get_default_openssl_method() | ||
| 152 | replaced RSA_set_default_method() and RSA_get_default_method() respectively, | ||
| 153 | and RSA_set_method() and RSA_new_method() were altered to use B<ENGINE>s | ||
| 154 | rather than B<RSA_METHOD>s during development of OpenSSL 0.9.6. | ||
| 155 | |||
| 153 | =cut | 156 | =cut | 
