Class: Secrets::Data::WrapperStruct
- Inherits:
-
Struct
- Object
- Struct
- Secrets::Data::WrapperStruct
- Defined in:
- lib/secrets/data/wrapper_struct.rb
Constant Summary collapse
- VERSION =
1
Instance Attribute Summary collapse
-
#cipher_name ⇒ Object
Returns the value of attribute cipher_name.
-
#compress ⇒ Object
Returns the value of attribute compress.
-
#compressed ⇒ Object
Returns the value of attribute compressed.
-
#encrypted_data ⇒ Object
Returns the value of attribute encrypted_data.
-
#iv ⇒ Object
Returns the value of attribute iv.
-
#salt ⇒ Object
Returns the value of attribute salt.
-
#version ⇒ Object
Returns the value of attribute version.
Class Method Summary collapse
Instance Method Summary collapse
- #config ⇒ Object
-
#initialize(encrypted_data:, iv:, cipher_name:, salt: nil, version: VERSION, compress: Secrets::Configuration.config.compression_enabled) ⇒ WrapperStruct
constructor
A new instance of WrapperStruct.
- #serialize ⇒ Object
Constructor Details
#initialize(encrypted_data:, iv:, cipher_name:, salt: nil, version: VERSION, compress: Secrets::Configuration.config.compression_enabled) ⇒ WrapperStruct
Returns a new instance of WrapperStruct.
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/secrets/data/wrapper_struct.rb', line 17 def initialize( encrypted_data:, # [Blob] Binary encrypted data (possibly compressed) iv:, # [String] IV used to encrypt the data cipher_name:, # [String] Name of the cipher used salt: nil, # [Integer] For password-encrypted data this is the salt version: VERSION, # [Integer] Version of the cipher used compress: Secrets::Configuration.config.compression_enabled ) super(encrypted_data, iv, cipher_name, salt, version, compress) end |
Instance Attribute Details
#cipher_name ⇒ Object
Returns the value of attribute cipher_name
4 5 6 |
# File 'lib/secrets/data/wrapper_struct.rb', line 4 def cipher_name @cipher_name end |
#compress ⇒ Object
Returns the value of attribute compress
4 5 6 |
# File 'lib/secrets/data/wrapper_struct.rb', line 4 def compress @compress end |
#compressed ⇒ Object
Returns the value of attribute compressed.
15 16 17 |
# File 'lib/secrets/data/wrapper_struct.rb', line 15 def compressed @compressed end |
#encrypted_data ⇒ Object
Returns the value of attribute encrypted_data
4 5 6 |
# File 'lib/secrets/data/wrapper_struct.rb', line 4 def encrypted_data @encrypted_data end |
#iv ⇒ Object
Returns the value of attribute iv
4 5 6 |
# File 'lib/secrets/data/wrapper_struct.rb', line 4 def iv @iv end |
#salt ⇒ Object
Returns the value of attribute salt
4 5 6 |
# File 'lib/secrets/data/wrapper_struct.rb', line 4 def salt @salt end |
#version ⇒ Object
Returns the value of attribute version
4 5 6 |
# File 'lib/secrets/data/wrapper_struct.rb', line 4 def version @version end |
Class Method Details
.deserialize(data) ⇒ Object
36 37 38 |
# File 'lib/secrets/data/wrapper_struct.rb', line 36 def self.deserialize(data) Marshal.load(data) end |
Instance Method Details
#config ⇒ Object
28 29 30 |
# File 'lib/secrets/data/wrapper_struct.rb', line 28 def config Secrets::Configuration.config end |
#serialize ⇒ Object
32 33 34 |
# File 'lib/secrets/data/wrapper_struct.rb', line 32 def serialize Marshal.dump(self) end |