Class: Ronin::Support::Crypto::Key::DSA
- Inherits:
-
OpenSSL::PKey::DSA
- Object
- OpenSSL::PKey::DSA
- Ronin::Support::Crypto::Key::DSA
- Includes:
- Methods
- Defined in:
- lib/ronin/support/crypto/key/dsa.rb
Overview
Represents an DSA key.
Class Method Summary collapse
-
.generate(key_size = 1024) ⇒ DSA
Generates a new random DSA key.
Instance Method Summary collapse
-
#g ⇒ OpenSSL::BN
The
g
variable for the DSA key. -
#p ⇒ OpenSSL::BN
The
p
variable for the DSA key. -
#q ⇒ OpenSSL::BN
The
q
variable for the DSA key. -
#size ⇒ Integer
The size of the DSA key in bits.
Methods included from Methods
Class Method Details
.generate(key_size = 1024) ⇒ DSA
Generates a new random DSA key.
48 49 50 51 52 53 54 |
# File 'lib/ronin/support/crypto/key/dsa.rb', line 48 def self.generate(key_size=1024) # HACK: openssl-3.0.0 will return an OpenSSL::PKey::SAA instance, # even though we subclassed OpenSSL::PKey::SAA. new_key = allocate new_key.send(:initialize_copy,super(key_size)) new_key end |
Instance Method Details
#g ⇒ OpenSSL::BN
The g
variable for the DSA key.
85 86 87 |
# File 'lib/ronin/support/crypto/key/dsa.rb', line 85 def g super() end |
#p ⇒ OpenSSL::BN
The p
variable for the DSA key.
63 64 65 |
# File 'lib/ronin/support/crypto/key/dsa.rb', line 63 def p super() end |
#q ⇒ OpenSSL::BN
The q
variable for the DSA key.
74 75 76 |
# File 'lib/ronin/support/crypto/key/dsa.rb', line 74 def q super() end |
#size ⇒ Integer
The size of the DSA key in bits.
95 96 97 |
# File 'lib/ronin/support/crypto/key/dsa.rb', line 95 def size p.num_bits end |