| ||||||||||||||||||

## RSA_set_method(3)
## NAMERSA_set_default_method, RSA_get_default_method, RSA_set_method, RSA_get_method, RSA_PKCS1_SSLeay, RSA_null_method, RSA_flags, RSA_new_method - select RSA method
## SYNOPSIS#include <openssl/rsa.h> void RSA_set_default_method(const RSA_METHOD *meth); RSA_METHOD *RSA_get_default_method(void); int RSA_set_method(RSA *rsa, const RSA_METHOD *meth); RSA_METHOD *RSA_get_method(const RSA *rsa); RSA_METHOD *RSA_PKCS1_SSLeay(void); RSA_METHOD *RSA_null_method(void); int RSA_flags(const RSA *rsa); RSA *RSA_new_method(RSA_METHOD *method);
## DESCRIPTION
An
Initially, the default RSA_METHOD is the OpenSSL internal implementation,
as returned by
## THE RSA_METHOD STRUCTUREtypedef struct rsa_meth_st { /* name of the implementation */ const char *name; /* encrypt */ int (*rsa_pub_enc)(int flen, unsigned char *from, unsigned char *to, RSA *rsa, int padding); /* verify arbitrary data */ int (*rsa_pub_dec)(int flen, unsigned char *from, unsigned char *to, RSA *rsa, int padding); /* sign arbitrary data */ int (*rsa_priv_enc)(int flen, unsigned char *from, unsigned char *to, RSA *rsa, int padding); /* decrypt */ int (*rsa_priv_dec)(int flen, unsigned char *from, unsigned char *to, RSA *rsa, int padding); /* compute r0 = r0 ^ I mod rsa->n (May be NULL for some implementations) */ int (*rsa_mod_exp)(BIGNUM *r0, BIGNUM *I, RSA *rsa); /* compute r = a ^ p mod m (May be NULL for some implementations) */ int (*bn_mod_exp)(BIGNUM *r, BIGNUM *a, const BIGNUM *p, const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx); /* called at RSA_new */ int (*init)(RSA *rsa); /* called at RSA_free */ int (*finish)(RSA *rsa); /* RSA_FLAG_EXT_PKEY - rsa_mod_exp is called for private key * operations, even if p,q,dmp1,dmq1,iqmp * are NULL * RSA_FLAG_SIGN_VER - enable rsa_sign and rsa_verify * RSA_METHOD_FLAG_NO_CHECK - don't check pub/private match */ int flags; char *app_data; /* ?? */ /* sign. For backward compatibility, this is used only * if (flags & RSA_FLAG_SIGN_VER) */ int (*rsa_sign)(int type, unsigned char *m, unsigned int m_len, unsigned char *sigret, unsigned int *siglen, RSA *rsa); /* verify. For backward compatibility, this is used only * if (flags & RSA_FLAG_SIGN_VER) */ int (*rsa_verify)(int type, unsigned char *m, unsigned int m_len, unsigned char *sigbuf, unsigned int siglen, RSA *rsa); } RSA_METHOD;
## RETURN VALUES
## NOTES
As of version 0.9.7, RSA_METHOD implementations are grouped together with
other algorithmic APIs (eg. DSA_METHOD, EVP_CIPHER, etc) into
## BUGS
The behaviour of
## SEE ALSO
## HISTORY
| ||||||||||||||||||