Defines | Functions | Variables

ext/openssl/ossl_pkey_dsa.c File Reference

#include "ossl.h"
Include dependency graph for ossl_pkey_dsa.c:

Go to the source code of this file.

Defines

#define GetPKeyDSA(obj, pkey)
#define DSA_HAS_PRIVATE(dsa)   ((dsa)->priv_key)
#define DSA_PRIVATE(obj, dsa)   (DSA_HAS_PRIVATE(dsa)||OSSL_PKEY_IS_PRIVATE(obj))
#define ossl_dsa_buf_size(pkey)   (DSA_size((pkey)->pkey.dsa)+16)

Functions

static VALUE dsa_instance (VALUE klass, DSA *dsa)
VALUE ossl_dsa_new (EVP_PKEY *pkey)
static DSA * dsa_generate (int size)
static VALUE ossl_dsa_s_generate (VALUE klass, VALUE size)
static VALUE ossl_dsa_initialize (int argc, VALUE *argv, VALUE self)
static VALUE ossl_dsa_is_public (VALUE self)
static VALUE ossl_dsa_is_private (VALUE self)
static VALUE ossl_dsa_export (int argc, VALUE *argv, VALUE self)
static VALUE ossl_dsa_to_der (VALUE self)
static VALUE ossl_dsa_get_params (VALUE self)
static VALUE ossl_dsa_to_text (VALUE self)
static VALUE ossl_dsa_to_public_key (VALUE self)
static VALUE ossl_dsa_sign (VALUE self, VALUE data)
static VALUE ossl_dsa_verify (VALUE self, VALUE digest, VALUE sig)
void Init_ossl_dsa ()

Variables

VALUE cDSA
VALUE eDSAError

Define Documentation

#define DSA_HAS_PRIVATE (   dsa  )     ((dsa)->priv_key)

Definition at line 22 of file ossl_pkey_dsa.c.

Referenced by ossl_dsa_export(), and ossl_dsa_to_der().

#define DSA_PRIVATE (   obj,
  dsa 
)    (DSA_HAS_PRIVATE(dsa)||OSSL_PKEY_IS_PRIVATE(obj))

Definition at line 23 of file ossl_pkey_dsa.c.

Referenced by ossl_dsa_is_private(), and ossl_dsa_sign().

#define GetPKeyDSA (   obj,
  pkey 
)
Value:
do { \
    GetPKey(obj, pkey); \
    if (EVP_PKEY_type(pkey->type) != EVP_PKEY_DSA) { /* PARANOIA? */ \
        ossl_raise(rb_eRuntimeError, "THIS IS NOT A DSA!"); \
    } \
} while (0)

Definition at line 15 of file ossl_pkey_dsa.c.

Referenced by ossl_dsa_export(), ossl_dsa_get_params(), ossl_dsa_is_private(), ossl_dsa_is_public(), ossl_dsa_sign(), ossl_dsa_to_der(), ossl_dsa_to_public_key(), ossl_dsa_to_text(), and ossl_dsa_verify().

#define ossl_dsa_buf_size (   pkey  )     (DSA_size((pkey)->pkey.dsa)+16)

Definition at line 386 of file ossl_pkey_dsa.c.

Referenced by ossl_dsa_sign().


Function Documentation

static DSA* dsa_generate ( int  size  )  [static]

Definition at line 79 of file ossl_pkey_dsa.c.

References NULL, ossl_generate_cb(), and rb_block_given_p().

Referenced by ossl_dsa_initialize(), and ossl_dsa_s_generate().

static VALUE dsa_instance ( VALUE  klass,
DSA *  dsa 
) [static]

Definition at line 35 of file ossl_pkey_dsa.c.

References WrapPKey.

Referenced by ossl_dsa_new(), ossl_dsa_s_generate(), and ossl_dsa_to_public_key().

void Init_ossl_dsa ( void   ) 
static VALUE ossl_dsa_export ( int  argc,
VALUE argv,
VALUE  self 
) [static]
static VALUE ossl_dsa_get_params ( VALUE  self  )  [static]

Definition at line 316 of file ossl_pkey_dsa.c.

References GetPKeyDSA, ossl_bn_new(), rb_hash_aset(), rb_hash_new(), and rb_str_new2().

Referenced by Init_ossl_dsa().

static VALUE ossl_dsa_initialize ( int  argc,
VALUE argv,
VALUE  self 
) [static]
static VALUE ossl_dsa_is_private ( VALUE  self  )  [static]

Definition at line 218 of file ossl_pkey_dsa.c.

References DSA_PRIVATE, GetPKeyDSA, and Qtrue.

Referenced by Init_ossl_dsa().

static VALUE ossl_dsa_is_public ( VALUE  self  )  [static]

Definition at line 203 of file ossl_pkey_dsa.c.

References GetPKeyDSA, and Qtrue.

Referenced by Init_ossl_dsa().

VALUE ossl_dsa_new ( EVP_PKEY *  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().

static VALUE ossl_dsa_s_generate ( VALUE  klass,
VALUE  size 
) [static]

Definition at line 111 of file ossl_pkey_dsa.c.

References dsa_generate(), dsa_instance(), eDSAError, NULL, NUM2INT, ossl_raise(), and Qfalse.

Referenced by Init_ossl_dsa().

static VALUE ossl_dsa_sign ( VALUE  self,
VALUE  data 
) [static]
static VALUE ossl_dsa_to_der ( VALUE  self  )  [static]
static VALUE ossl_dsa_to_public_key ( VALUE  self  )  [static]

Definition at line 369 of file ossl_pkey_dsa.c.

References CLASS_OF, dsa_instance(), DSAPublicKey_dup, eDSAError, GetPKeyDSA, NULL, ossl_raise(), and Qfalse.

Referenced by Init_ossl_dsa().

static VALUE ossl_dsa_to_text ( VALUE  self  )  [static]

Definition at line 343 of file ossl_pkey_dsa.c.

References eDSAError, GetPKeyDSA, NULL, ossl_membio2str(), and ossl_raise().

Referenced by Init_ossl_dsa().

static VALUE ossl_dsa_verify ( VALUE  self,
VALUE  digest,
VALUE  sig 
) [static]

Definition at line 422 of file ossl_pkey_dsa.c.

References eDSAError, GetPKeyDSA, NULL, ossl_raise(), RSTRING_LEN, RSTRING_PTR, and StringValue.

Referenced by Init_ossl_dsa().


Variable Documentation

Definition at line 28 of file ossl_pkey_dsa.c.

Referenced by Init_ossl_dsa(), and ossl_dsa_new().