Class: OpenSSL::PKey::DSA
- Inherits:
-
PKey
- Object
- PKey
- OpenSSL::PKey::DSA
- Defined in:
- ossl_pkey_dsa.c
Class Method Summary collapse
Instance Method Summary collapse
- #export ⇒ Object (also: #to_pem, #to_s)
- #initialize ⇒ Object constructor
-
#params ⇒ Object
Stores all parameters of key to the hash INSECURE: PRIVATE INFORMATIONS CAN LEAK OUT!!! Don't use :-)) (I's up to you).
- #private? ⇒ Boolean
- #public? ⇒ Boolean
-
#public_key ⇒ Object
Makes new instance DSA PUBLIC_KEY from PRIVATE_KEY.
- #syssign ⇒ Object
- #sysverify ⇒ Object
- #to_der ⇒ Object
-
#to_text ⇒ Object
Prints all parameters of key to buffer INSECURE: PRIVATE INFORMATIONS CAN LEAK OUT!!! Don't use :-)) (I's up to you).
Constructor Details
#initialize ⇒ Object
Class Method Details
.generate ⇒ Object
Instance Method Details
#export ⇒ Object Also known as: to_pem, to_s
#params ⇒ Object
Stores all parameters of key to the hash INSECURE: PRIVATE INFORMATIONS CAN LEAK OUT!!! Don't use :-)) (I's up to you)
|
# File 'ossl_pkey_dsa.c' static VALUE ossl_dsa_get_params(VALUE self) { EVP_PKEY *pkey; VALUE hash; GetPKeyDSA(self, pkey); hash = rb_hash_new(); rb_hash_aset(hash, rb_str_new2("p"), ossl_bn_new(pkey->pkey.dsa->p)); rb_hash_aset(hash, rb_str_new2("q"), ossl_bn_new(pkey->pkey.dsa->q)); rb_hash_aset(hash, rb_str_new2("g"), ossl_bn_new(pkey->pkey.dsa->g)); rb_hash_aset(hash, rb_str_new2("pub_key"), ossl_bn_new(pkey->pkey.dsa->pub_key)); rb_hash_aset(hash, rb_str_new2("priv_key"), ossl_bn_new(pkey->pkey.dsa->priv_key)); return hash; } |
#private? ⇒ Boolean
#public? ⇒ Boolean
#public_key ⇒ Object
Makes new instance DSA PUBLIC_KEY from PRIVATE_KEY
|
# File 'ossl_pkey_dsa.c' static VALUE ossl_dsa_to_public_key(VALUE self) { EVP_PKEY *pkey; DSA *dsa; VALUE obj; GetPKeyDSA(self, pkey); /* err check performed by dsa_instance */ dsa = DSAPublicKey_dup(pkey->pkey.dsa); obj = dsa_instance(CLASS_OF(self), dsa); if (obj == Qfalse) { DSA_free(dsa); ossl_raise(eDSAError, NULL); } |
#syssign ⇒ Object
#sysverify ⇒ Object
#to_der ⇒ Object
#to_text ⇒ Object
Prints all parameters of key to buffer INSECURE: PRIVATE INFORMATIONS CAN LEAK OUT!!! Don't use :-)) (I's up to you)
|
# File 'ossl_pkey_dsa.c' static VALUE ossl_dsa_to_text(VALUE self) { EVP_PKEY *pkey; BIO *out; VALUE str; GetPKeyDSA(self, pkey); if (!(out = BIO_new(BIO_s_mem()))) { ossl_raise(eDSAError, NULL); } |