Module: OpenSSLExtensions::PKey::PKey
- Defined in:
- lib/openssl-extensions/pkey/pkey.rb
Overview
Extends OpenSSL::PKey::PKey and its submodules with helper methods.
Constant Summary collapse
- UnknownAlgorithmError =
Class.new(RuntimeError)
Instance Method Summary collapse
-
#==(other) ⇒ Object
(also: #eql?)
Equality is tested by comparing the instances’
hash
. -
#hash ⇒ Object
Override the default Object#hash to identify uniqueness of the key.
-
#strength ⇒ Object
Returns the strength of the public key in number of bits.
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
Equality is tested by comparing the instances’ hash
.
13 14 15 16 |
# File 'lib/openssl-extensions/pkey/pkey.rb', line 13 def ==(other) other.kind_of?(OpenSSL::PKey::PKey) && self.hash == other.hash end |
#hash ⇒ Object
Override the default Object#hash to identify uniqueness of the key. This uses a hash of the PEM.
23 24 25 |
# File 'lib/openssl-extensions/pkey/pkey.rb', line 23 def hash to_pem.hash end |
#strength ⇒ Object
Returns the strength of the public key in number of bits.
30 31 32 |
# File 'lib/openssl-extensions/pkey/pkey.rb', line 30 def strength raise UnknownAlgorithmError end |