Ruby
2.0.0p247(2013-06-27revision41674)
|
#include "ossl.h"
Go to the source code of this file.
#define DefRSAConst | ( | x | ) | rb_define_const(cRSA, #x,INT2FIX(RSA_##x)) |
Definition at line 625 of file ossl_pkey_rsa.c.
Referenced by Init_ossl_rsa().
#define GetPKeyRSA | ( | obj, | |
pkey | |||
) |
do { \ GetPKey((obj), (pkey)); \ if (EVP_PKEY_type((pkey)->type) != EVP_PKEY_RSA) { /* PARANOIA? */ \ ossl_raise(rb_eRuntimeError, "THIS IS NOT A RSA!") ; \ } \ } while (0)
Definition at line 15 of file ossl_pkey_rsa.c.
Referenced by ossl_rsa_export(), ossl_rsa_get_params(), ossl_rsa_is_private(), ossl_rsa_is_public(), ossl_rsa_private_decrypt(), ossl_rsa_private_encrypt(), ossl_rsa_public_decrypt(), ossl_rsa_public_encrypt(), ossl_rsa_to_der(), ossl_rsa_to_public_key(), and ossl_rsa_to_text().
#define ossl_rsa_buf_size | ( | pkey | ) | (RSA_size((pkey)->pkey.rsa)+16) |
Definition at line 374 of file ossl_pkey_rsa.c.
Referenced by ossl_rsa_private_decrypt(), ossl_rsa_private_encrypt(), ossl_rsa_public_decrypt(), and ossl_rsa_public_encrypt().
#define RSA_HAS_PRIVATE | ( | rsa | ) | ((rsa)->p && (rsa)->q) |
Definition at line 22 of file ossl_pkey_rsa.c.
Referenced by ossl_rsa_export(), and ossl_rsa_to_der().
#define RSA_PRIVATE | ( | obj, | |
rsa | |||
) | (RSA_HAS_PRIVATE(rsa)||OSSL_PKEY_IS_PRIVATE(obj)) |
Definition at line 23 of file ossl_pkey_rsa.c.
Referenced by ossl_rsa_is_private(), ossl_rsa_private_decrypt(), and ossl_rsa_private_encrypt().
void Init_ossl_rsa | ( | void | ) |
Definition at line 628 of file ossl_pkey_rsa.c.
References cPKey, cRSA, DEF_OSSL_PKEY_BN, DefRSAConst, ePKeyError, eRSAError, mOSSL, mPKey, ossl_rsa_export(), ossl_rsa_get_params(), ossl_rsa_initialize(), ossl_rsa_is_private(), ossl_rsa_is_public(), ossl_rsa_private_decrypt(), ossl_rsa_private_encrypt(), ossl_rsa_public_decrypt(), ossl_rsa_public_encrypt(), ossl_rsa_s_generate(), ossl_rsa_to_der(), ossl_rsa_to_public_key(), ossl_rsa_to_text(), rb_define_alias(), rb_define_class_under(), rb_define_method(), rb_define_module(), rb_define_module_under(), and rb_define_singleton_method().
Referenced by Init_ossl_pkey().
static VALUE ossl_rsa_export | ( | int | argc, |
VALUE * | argv, | ||
VALUE | self | ||
) | [static] |
Definition at line 302 of file ossl_pkey_rsa.c.
References eOSSLError, eRSAError, GetCipherPtr(), GetPKeyRSA, NIL_P, NULL, ossl_membio2str(), OSSL_MIN_PWD_LEN, ossl_pem_passwd_cb(), ossl_raise(), rb_scan_args(), RSA_HAS_PRIVATE, RSTRING_LENINT, RSTRING_PTR, and StringValue.
Referenced by Init_ossl_rsa().
static VALUE ossl_rsa_get_params | ( | VALUE | self | ) | [static] |
Definition at line 510 of file ossl_pkey_rsa.c.
References GetPKeyRSA, hash(), ossl_bn_new(), rb_hash_aset(), rb_hash_new(), and rb_str_new2().
Referenced by Init_ossl_rsa().
static VALUE ossl_rsa_initialize | ( | int | argc, |
VALUE * | argv, | ||
VALUE | self | ||
) | [static] |
Definition at line 203 of file ossl_pkey_rsa.c.
References eRSAError, FIX2INT, FIXNUM_P, GetPKey, NIL_P, NULL, NUM2ULONG, OSSL_BIO_reset, ossl_obj2bio(), ossl_pem_passwd_cb(), ossl_raise(), ossl_to_der_if_possible(), rb_scan_args(), rsa_generate(), and StringValuePtr.
Referenced by Init_ossl_rsa().
static VALUE ossl_rsa_is_private | ( | VALUE | self | ) | [static] |
Definition at line 283 of file ossl_pkey_rsa.c.
References GetPKeyRSA, Qfalse, Qtrue, and RSA_PRIVATE.
Referenced by Init_ossl_rsa().
static VALUE ossl_rsa_is_public | ( | VALUE | self | ) | [static] |
Definition at line 265 of file ossl_pkey_rsa.c.
References GetPKeyRSA, and Qtrue.
Referenced by Init_ossl_rsa().
VALUE ossl_rsa_new | ( | EVP_PKEY * | pkey | ) |
Definition at line 56 of file ossl_pkey_rsa.c.
References cRSA, eRSAError, NULL, ossl_raise(), Qfalse, rb_eTypeError, rsa_instance(), and WrapPKey.
Referenced by ossl_pkey_new().
static VALUE ossl_rsa_private_decrypt | ( | int | argc, |
VALUE * | argv, | ||
VALUE | self | ||
) | [static] |
Definition at line 475 of file ossl_pkey_rsa.c.
References eRSAError, GetPKeyRSA, NULL, NUM2INT, ossl_raise(), ossl_rsa_buf_size, rb_scan_args(), rb_str_new(), rb_str_set_len(), RSA_PRIVATE, RSTRING_LENINT, RSTRING_PTR, and StringValue.
Referenced by Init_ossl_rsa().
static VALUE ossl_rsa_private_encrypt | ( | int | argc, |
VALUE * | argv, | ||
VALUE | self | ||
) | [static] |
Definition at line 443 of file ossl_pkey_rsa.c.
References eRSAError, GetPKeyRSA, NULL, NUM2INT, ossl_raise(), ossl_rsa_buf_size, rb_scan_args(), rb_str_new(), rb_str_set_len(), RSA_PRIVATE, RSTRING_LENINT, RSTRING_PTR, and StringValue.
Referenced by Init_ossl_rsa().
static VALUE ossl_rsa_public_decrypt | ( | int | argc, |
VALUE * | argv, | ||
VALUE | self | ||
) | [static] |
Definition at line 414 of file ossl_pkey_rsa.c.
References eRSAError, GetPKeyRSA, NULL, NUM2INT, ossl_raise(), ossl_rsa_buf_size, rb_scan_args(), rb_str_new(), rb_str_set_len(), RSTRING_LENINT, RSTRING_PTR, and StringValue.
Referenced by Init_ossl_rsa().
static VALUE ossl_rsa_public_encrypt | ( | int | argc, |
VALUE * | argv, | ||
VALUE | self | ||
) | [static] |
Definition at line 385 of file ossl_pkey_rsa.c.
References eRSAError, GetPKeyRSA, NULL, NUM2INT, ossl_raise(), ossl_rsa_buf_size, rb_scan_args(), rb_str_new(), rb_str_set_len(), RSTRING_LENINT, RSTRING_PTR, and StringValue.
Referenced by Init_ossl_rsa().
static VALUE ossl_rsa_s_generate | ( | int | argc, |
VALUE * | argv, | ||
VALUE | klass | ||
) | [static] |
Definition at line 162 of file ossl_pkey_rsa.c.
References eRSAError, NIL_P, NULL, NUM2INT, NUM2ULONG, ossl_raise(), Qfalse, rb_scan_args(), rsa_generate(), rsa_instance(), and size.
Referenced by Init_ossl_rsa().
static VALUE ossl_rsa_to_der | ( | VALUE | self | ) | [static] |
Definition at line 350 of file ossl_pkey_rsa.c.
References _, eRSAError, GetPKeyRSA, NULL, ossl_raise(), ossl_str_adjust, rb_str_new(), RSA_HAS_PRIVATE, and RSTRING_PTR.
Referenced by Init_ossl_rsa().
static VALUE ossl_rsa_to_public_key | ( | VALUE | self | ) | [static] |
Definition at line 568 of file ossl_pkey_rsa.c.
References CLASS_OF, eRSAError, GetPKeyRSA, NULL, ossl_raise(), Qfalse, and rsa_instance().
Referenced by Init_ossl_rsa().
static VALUE ossl_rsa_to_text | ( | VALUE | self | ) | [static] |
Definition at line 542 of file ossl_pkey_rsa.c.
References eRSAError, GetPKeyRSA, NULL, ossl_membio2str(), and ossl_raise().
Referenced by Init_ossl_rsa().
static RSA* rsa_generate | ( | int | size, |
unsigned long | exp | ||
) | [static] |
Definition at line 98 of file ossl_pkey_rsa.c.
References NULL, ossl_generate_cb(), rb_block_given_p(), rb_jump_tag(), rb_thread_call_without_gvl(), and size.
Referenced by ossl_rsa_initialize(), and ossl_rsa_s_generate().
static VALUE rsa_instance | ( | VALUE | klass, |
RSA * | rsa | ||
) | [static] |
Definition at line 35 of file ossl_pkey_rsa.c.
References Qfalse, and WrapPKey.
Referenced by ossl_rsa_new(), ossl_rsa_s_generate(), and ossl_rsa_to_public_key().
Definition at line 28 of file ossl_pkey_rsa.c.
Referenced by Init_ossl_rsa(), and ossl_rsa_new().
Definition at line 29 of file ossl_pkey_rsa.c.
Referenced by Init_ossl_rsa(), ossl_rsa_export(), ossl_rsa_initialize(), ossl_rsa_new(), ossl_rsa_private_decrypt(), ossl_rsa_private_encrypt(), ossl_rsa_public_decrypt(), ossl_rsa_public_encrypt(), ossl_rsa_s_generate(), ossl_rsa_to_der(), ossl_rsa_to_public_key(), and ossl_rsa_to_text().