Class: NimbusSecure::StoredKey
- Defined in:
- lib/nimbussecure/stored_key.rb
Overview
Stored Key
Instance Method Summary collapse
- #apply_crypt_key(ck) ⇒ Object
-
#initialize(nss, skparams) ⇒ StoredKey
constructor
A new instance of StoredKey.
- #value ⇒ Object
Methods included from NimbusSecureAttrAccessor
Constructor Details
#initialize(nss, skparams) ⇒ StoredKey
Returns a new instance of StoredKey.
11 12 13 14 15 16 17 18 |
# File 'lib/nimbussecure/stored_key.rb', line 11 def initialize nss,skparams @id=skparams["id"] @ident=skparams["ident"] @encrypted_value=skparams["encrypted_value"] @decrypted_value=nil @crypt_key=NimbusSecure::CryptKey.new(nss,skparams["crypt_key"]) @key_type=skparams["key_type"] end |
Instance Method Details
#apply_crypt_key(ck) ⇒ Object
19 20 21 |
# File 'lib/nimbussecure/stored_key.rb', line 19 def apply_crypt_key ck self.decrypted_value=ck.decrypt self.encrypted_value end |
#value ⇒ Object
22 23 24 25 |
# File 'lib/nimbussecure/stored_key.rb', line 22 def value apply_crypt_key self.crypt_key unless decrypted_value decrypted_value end |