Class: CertificateAuthority::MemoryKeyMaterial
- Inherits:
-
Object
- Object
- CertificateAuthority::MemoryKeyMaterial
- Includes:
- ActiveModel::Validations, KeyMaterial
- Defined in:
- lib/certificate_authority/key_material.rb
Instance Attribute Summary collapse
-
#keypair ⇒ Object
Returns the value of attribute keypair.
- #private_key ⇒ OpenSSL::Pkey::RSA
- #public_key ⇒ OpenSSL::Pkey::RSA
Instance Method Summary collapse
- #generate_key(modulus_bits = 2048) ⇒ OpenSSL::Pkey::RSA
-
#initialize ⇒ MemoryKeyMaterial
constructor
A new instance of MemoryKeyMaterial.
- #is_in_hardware? ⇒ Boolean
- #is_in_memory? ⇒ Boolean
Constructor Details
#initialize ⇒ MemoryKeyMaterial
Returns a new instance of MemoryKeyMaterial.
28 29 |
# File 'lib/certificate_authority/key_material.rb', line 28 def initialize end |
Instance Attribute Details
#keypair ⇒ Object
Returns the value of attribute keypair.
24 25 26 |
# File 'lib/certificate_authority/key_material.rb', line 24 def keypair @keypair end |
#private_key ⇒ OpenSSL::Pkey::RSA
58 59 60 |
# File 'lib/certificate_authority/key_material.rb', line 58 def private_key @private_key end |
#public_key ⇒ OpenSSL::Pkey::RSA
63 64 65 |
# File 'lib/certificate_authority/key_material.rb', line 63 def public_key @public_key end |
Instance Method Details
#generate_key(modulus_bits = 2048) ⇒ OpenSSL::Pkey::RSA
50 51 52 53 54 55 |
# File 'lib/certificate_authority/key_material.rb', line 50 def generate_key(modulus_bits=2048) self.keypair = OpenSSL::PKey::RSA.new(modulus_bits) self.private_key = keypair self.public_key = keypair.public_key self.keypair end |
#is_in_hardware? ⇒ Boolean
39 40 41 |
# File 'lib/certificate_authority/key_material.rb', line 39 def is_in_hardware? false end |
#is_in_memory? ⇒ Boolean
44 45 46 |
# File 'lib/certificate_authority/key_material.rb', line 44 def is_in_memory? true end |