Class: EncryptedKeystore
- Inherits:
-
Object
- Object
- EncryptedKeystore
- Defined in:
- lib/encrypted_keystore.rb
Instance Attribute Summary collapse
-
#file ⇒ Object
Returns the value of attribute file.
-
#iv ⇒ Object
Returns the value of attribute iv.
-
#key ⇒ Object
Returns the value of attribute key.
-
#out ⇒ Object
Returns the value of attribute out.
Instance Method Summary collapse
- #decrypt ⇒ Object
- #encrypt ⇒ Object
-
#initialize(file: nil, out: nil, key: nil, iv: nil) ⇒ EncryptedKeystore
constructor
A new instance of EncryptedKeystore.
Constructor Details
#initialize(file: nil, out: nil, key: nil, iv: nil) ⇒ EncryptedKeystore
Returns a new instance of EncryptedKeystore.
9 10 11 12 13 14 |
# File 'lib/encrypted_keystore.rb', line 9 def initialize(file: nil, out: nil, key: nil, iv: nil) @file = file @out = out @key = key @iv = iv end |
Instance Attribute Details
#file ⇒ Object
Returns the value of attribute file.
7 8 9 |
# File 'lib/encrypted_keystore.rb', line 7 def file @file end |
#iv ⇒ Object
Returns the value of attribute iv.
7 8 9 |
# File 'lib/encrypted_keystore.rb', line 7 def iv @iv end |
#key ⇒ Object
Returns the value of attribute key.
7 8 9 |
# File 'lib/encrypted_keystore.rb', line 7 def key @key end |
#out ⇒ Object
Returns the value of attribute out.
7 8 9 |
# File 'lib/encrypted_keystore.rb', line 7 def out @out end |
Instance Method Details
#decrypt ⇒ Object
16 17 18 19 20 |
# File 'lib/encrypted_keystore.rb', line 16 def decrypt validate write(dec_cipher) end |
#encrypt ⇒ Object
22 23 24 25 26 |
# File 'lib/encrypted_keystore.rb', line 22 def encrypt validate(enc: true) write(enc_cipher) end |