Ruby  1.9.3p429(2013-05-15revision40747)
Macros | Functions | Variables
ossl_pkey.h File Reference

Go to the source code of this file.

Macros

#define OSSL_PKEY_SET_PRIVATE(obj)   rb_iv_set((obj), "private", Qtrue)
 
#define OSSL_PKEY_SET_PUBLIC(obj)   rb_iv_set((obj), "private", Qfalse)
 
#define OSSL_PKEY_IS_PRIVATE(obj)   (rb_iv_get((obj), "private") == Qtrue)
 
#define WrapPKey(klass, obj, pkey)
 
#define GetPKey(obj, pkey)
 
#define SafeGetPKey(obj, pkey)
 
#define OSSL_PKEY_BN(keytype, name)
 
#define DEF_OSSL_PKEY_BN(class, keytype, name)
 

Functions

void ossl_generate_cb (int, int, void *)
 
VALUE ossl_pkey_new (EVP_PKEY *)
 
VALUE ossl_pkey_new_from_file (VALUE)
 
EVP_PKEY * GetPKeyPtr (VALUE)
 
EVP_PKEY * DupPKeyPtr (VALUE)
 
EVP_PKEY * GetPrivPKeyPtr (VALUE)
 
EVP_PKEY * DupPrivPKeyPtr (VALUE)
 
void Init_ossl_pkey (void)
 
VALUE ossl_rsa_new (EVP_PKEY *)
 
void Init_ossl_rsa (void)
 
VALUE ossl_dsa_new (EVP_PKEY *)
 
void Init_ossl_dsa (void)
 
VALUE ossl_dh_new (EVP_PKEY *)
 
void Init_ossl_dh (void)
 
VALUE ossl_ec_new (EVP_PKEY *)
 
void Init_ossl_ec (void)
 

Variables

VALUE mPKey
 
VALUE cPKey
 
VALUE ePKeyError
 
ID id_private_q
 
VALUE cRSA
 
VALUE eRSAError
 
VALUE cDSA
 
VALUE eDSAError
 
VALUE cDH
 
VALUE eDHError
 
DH * OSSL_DEFAULT_DH_512
 
DH * OSSL_DEFAULT_DH_1024
 
VALUE cEC
 
VALUE eECError
 
VALUE cEC_GROUP
 
VALUE eEC_GROUP
 
VALUE cEC_POINT
 
VALUE eEC_POINT
 

Macro Definition Documentation

#define DEF_OSSL_PKEY_BN (   class,
  keytype,
  name 
)
Value:
do { \
rb_define_method((class), #name, ossl_##keytype##_get_##name, 0); \
rb_define_method((class), #name "=", ossl_##keytype##_set_##name, 1);\
} while (0)

Definition at line 135 of file ossl_pkey.h.

Referenced by Init_ossl_dh(), Init_ossl_dsa(), and Init_ossl_rsa().

#define GetPKey (   obj,
  pkey 
)
Value:
do {\
Data_Get_Struct((obj), EVP_PKEY, (pkey));\
if (!(pkey)) { \
rb_raise(rb_eRuntimeError, "PKEY wasn't initialized!");\
} \
} while (0)

Definition at line 30 of file ossl_pkey.h.

Referenced by ossl_dh_initialize(), ossl_dsa_initialize(), ossl_pkey_sign(), ossl_pkey_verify(), and ossl_rsa_initialize().

#define OSSL_PKEY_BN (   keytype,
  name 
)

Definition at line 93 of file ossl_pkey.h.

#define OSSL_PKEY_IS_PRIVATE (   obj)    (rb_iv_get((obj), "private") == Qtrue)

Definition at line 21 of file ossl_pkey.h.

#define OSSL_PKEY_SET_PRIVATE (   obj)    rb_iv_set((obj), "private", Qtrue)

Definition at line 19 of file ossl_pkey.h.

#define OSSL_PKEY_SET_PUBLIC (   obj)    rb_iv_set((obj), "private", Qfalse)

Definition at line 20 of file ossl_pkey.h.

#define SafeGetPKey (   obj,
  pkey 
)
Value:
do { \
OSSL_Check_Kind((obj), cPKey); \
GetPKey((obj), (pkey)); \
} while (0)

Definition at line 36 of file ossl_pkey.h.

Referenced by DupPKeyPtr(), DupPrivPKeyPtr(), GetPKeyPtr(), and GetPrivPKeyPtr().

#define WrapPKey (   klass,
  obj,
  pkey 
)
Value:
do { \
if (!(pkey)) { \
rb_raise(rb_eRuntimeError, "PKEY wasn't initialized!"); \
} \
(obj) = Data_Wrap_Struct((klass), 0, EVP_PKEY_free, (pkey)); \
OSSL_PKEY_SET_PUBLIC(obj); \
} while (0)

Definition at line 23 of file ossl_pkey.h.

Referenced by dh_instance(), dsa_instance(), ossl_dh_new(), ossl_dsa_new(), ossl_pkey_alloc(), ossl_rsa_new(), and rsa_instance().

Function Documentation

EVP_PKEY* DupPKeyPtr ( VALUE  )

Definition at line 159 of file ossl_pkey.c.

References SafeGetPKey.

Referenced by ossl_client_cert_cb().

EVP_PKEY* DupPrivPKeyPtr ( VALUE  )

Definition at line 170 of file ossl_pkey.c.

References id_private_q, NULL, ossl_raise(), Qtrue, rb_eArgError, rb_funcall(), and SafeGetPKey.

EVP_PKEY* GetPKeyPtr ( VALUE  )
EVP_PKEY* GetPrivPKeyPtr ( VALUE  )
void Init_ossl_dh ( void  )
void Init_ossl_dsa ( void  )
void Init_ossl_ec ( void  )

Definition at line 1591 of file ossl_pkey_ec.c.

Referenced by Init_ossl_pkey().

void Init_ossl_pkey ( void  )
void Init_ossl_rsa ( void  )
VALUE ossl_dh_new ( EVP_PKEY *  )

Definition at line 62 of file ossl_pkey_dh.c.

References cDH, dh_instance(), eDHError, NULL, ossl_raise(), Qfalse, rb_eTypeError, and WrapPKey.

Referenced by ossl_pkey_new().

VALUE ossl_dsa_new ( EVP_PKEY *  )

Definition at line 56 of file ossl_pkey_dsa.c.

References cDSA, dsa_instance(), eDSAError, NULL, ossl_raise(), Qfalse, rb_eTypeError, and WrapPKey.

Referenced by ossl_pkey_new().

VALUE ossl_ec_new ( EVP_PKEY *  )

Referenced by ossl_pkey_new().

void ossl_generate_cb ( int  ,
int  ,
void *   
)

Definition at line 25 of file ossl_pkey.c.

References INT2NUM(), rb_ary_new2(), rb_ary_store(), and rb_yield().

Referenced by dh_generate(), dsa_generate(), and rsa_generate().

VALUE ossl_pkey_new ( EVP_PKEY *  )
VALUE ossl_pkey_new_from_file ( VALUE  )
VALUE ossl_rsa_new ( EVP_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().

Variable Documentation

VALUE cDH

Definition at line 34 of file ossl_pkey_dh.c.

Referenced by Init_ossl_dh(), and ossl_dh_new().

VALUE cDSA

Definition at line 28 of file ossl_pkey_dsa.c.

Referenced by Init_ossl_dsa(), and ossl_dsa_new().

VALUE cEC
VALUE cEC_GROUP
VALUE cEC_POINT
VALUE cPKey
VALUE cRSA

Definition at line 28 of file ossl_pkey_rsa.c.

Referenced by Init_ossl_rsa(), and ossl_rsa_new().

VALUE eDHError
VALUE eDSAError
VALUE eEC_GROUP
VALUE eEC_POINT
VALUE eECError
VALUE ePKeyError
VALUE eRSAError
ID id_private_q

Definition at line 19 of file ossl_pkey.c.

Referenced by DupPrivPKeyPtr(), GetPrivPKeyPtr(), Init_ossl_pkey(), and ossl_pkey_sign().

VALUE mPKey

Definition at line 16 of file ossl_pkey.c.

Referenced by Init_ossl_dh(), Init_ossl_dsa(), Init_ossl_pkey(), and Init_ossl_rsa().

DH* OSSL_DEFAULT_DH_1024

Definition at line 520 of file ossl_pkey_dh.c.

Referenced by Init_ossl_dh(), and ossl_default_tmp_dh_callback().

DH* OSSL_DEFAULT_DH_512

Definition at line 492 of file ossl_pkey_dh.c.

Referenced by Init_ossl_dh(), and ossl_default_tmp_dh_callback().