Class: OpenSSL::PKey::RSA
- Inherits:
-
Object
- Object
- OpenSSL::PKey::RSA
- Defined in:
- lib/postdb/helpers/openssl/pkey/rsa.rb
Class Method Summary collapse
-
.dump(object) ⇒ Object
Dump the object.
-
.load(object) ⇒ Object
Load the object.
Instance Method Summary collapse
-
#valid? ⇒ Boolean
Check if the RSA key is valid.
Class Method Details
.dump(object) ⇒ Object
Dump the object
Arguments:
object: (OpenSSL::PKey::RSA)
Example:
>> OpenSSL::PKey::RSA.dump(rsa)
=> "..."
14 15 16 17 18 19 20 |
# File 'lib/postdb/helpers/openssl/pkey/rsa.rb', line 14 def dump(object) unless object.is_a?(self) raise ActiveRecord::SerializationTypeMismatch, "Expected '#{self}' got '#{object.class}'." end object.to_der end |
.load(object) ⇒ Object
Load the object
Arguments:
object: (String)
Example:
>> OpenSSL::PKey::RSA.load(object)
=> #<OpenSSL::PKey::RSA:0x00000000000000>
31 32 33 34 35 |
# File 'lib/postdb/helpers/openssl/pkey/rsa.rb', line 31 def load(object) return nil unless object new(object) end |