Class: CertificateAuthority::Pkcs11KeyMaterial
- Inherits:
-
Object
- Object
- CertificateAuthority::Pkcs11KeyMaterial
- Includes:
- KeyMaterial
- Defined in:
- lib/certificate_authority/pkcs11_key_material.rb
Instance Attribute Summary collapse
-
#engine ⇒ Object
Returns the value of attribute engine.
-
#openssl_pkcs11_engine_lib ⇒ Object
Returns the value of attribute openssl_pkcs11_engine_lib.
-
#pin ⇒ Object
Returns the value of attribute pin.
-
#pkcs11_lib ⇒ Object
Returns the value of attribute pkcs11_lib.
-
#token_id ⇒ Object
Returns the value of attribute token_id.
Instance Method Summary collapse
- #generate_key(modulus_bits = 1024) ⇒ Object
-
#initialize(attributes = {}) ⇒ Pkcs11KeyMaterial
constructor
A new instance of Pkcs11KeyMaterial.
- #is_in_hardware? ⇒ Boolean
- #is_in_memory? ⇒ Boolean
- #private_key ⇒ Object
- #public_key ⇒ Object
Methods included from KeyMaterial
from_x509_key_pair, from_x509_public_key
Constructor Details
#initialize(attributes = {}) ⇒ Pkcs11KeyMaterial
Returns a new instance of Pkcs11KeyMaterial.
11 12 13 14 |
# File 'lib/certificate_authority/pkcs11_key_material.rb', line 11 def initialize(attributes = {}) @attributes = attributes initialize_engine end |
Instance Attribute Details
#engine ⇒ Object
Returns the value of attribute engine.
5 6 7 |
# File 'lib/certificate_authority/pkcs11_key_material.rb', line 5 def engine @engine end |
#openssl_pkcs11_engine_lib ⇒ Object
Returns the value of attribute openssl_pkcs11_engine_lib.
8 9 10 |
# File 'lib/certificate_authority/pkcs11_key_material.rb', line 8 def openssl_pkcs11_engine_lib @openssl_pkcs11_engine_lib end |
#pin ⇒ Object
Returns the value of attribute pin.
9 10 11 |
# File 'lib/certificate_authority/pkcs11_key_material.rb', line 9 def pin @pin end |
#pkcs11_lib ⇒ Object
Returns the value of attribute pkcs11_lib.
7 8 9 |
# File 'lib/certificate_authority/pkcs11_key_material.rb', line 7 def pkcs11_lib @pkcs11_lib end |
#token_id ⇒ Object
Returns the value of attribute token_id.
6 7 8 |
# File 'lib/certificate_authority/pkcs11_key_material.rb', line 6 def token_id @token_id end |
Instance Method Details
#generate_key(modulus_bits = 1024) ⇒ Object
24 25 26 27 |
# File 'lib/certificate_authority/pkcs11_key_material.rb', line 24 def generate_key(modulus_bits=1024) puts "Key generation is not currently supported in hardware" nil end |
#is_in_hardware? ⇒ Boolean
16 17 18 |
# File 'lib/certificate_authority/pkcs11_key_material.rb', line 16 def is_in_hardware? true end |
#is_in_memory? ⇒ Boolean
20 21 22 |
# File 'lib/certificate_authority/pkcs11_key_material.rb', line 20 def is_in_memory? false end |
#private_key ⇒ Object
29 30 31 32 |
# File 'lib/certificate_authority/pkcs11_key_material.rb', line 29 def private_key initialize_engine self.engine.load_private_key(self.token_id) end |
#public_key ⇒ Object
34 35 36 37 |
# File 'lib/certificate_authority/pkcs11_key_material.rb', line 34 def public_key initialize_engine self.engine.load_public_key(self.token_id) end |