Class: CryptReboot::Luks::Data
- Inherits:
-
Object
- Object
- CryptReboot::Luks::Data
- Defined in:
- lib/crypt_reboot/luks/data.rb
Overview
Value-object with encryption parameters
Instance Attribute Summary collapse
-
#cipher ⇒ Object
readonly
Returns the value of attribute cipher.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#offset ⇒ Object
readonly
Returns the value of attribute offset.
-
#sector_size ⇒ Object
readonly
Returns the value of attribute sector_size.
Instance Method Summary collapse
Instance Attribute Details
#cipher ⇒ Object (readonly)
Returns the value of attribute cipher.
7 8 9 |
# File 'lib/crypt_reboot/luks/data.rb', line 7 def cipher @cipher end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
7 8 9 |
# File 'lib/crypt_reboot/luks/data.rb', line 7 def key @key end |
#offset ⇒ Object (readonly)
Returns the value of attribute offset.
7 8 9 |
# File 'lib/crypt_reboot/luks/data.rb', line 7 def offset @offset end |
#sector_size ⇒ Object (readonly)
Returns the value of attribute sector_size.
7 8 9 |
# File 'lib/crypt_reboot/luks/data.rb', line 7 def sector_size @sector_size end |
Instance Method Details
#==(other) ⇒ Object
9 10 11 12 |
# File 'lib/crypt_reboot/luks/data.rb', line 9 def ==(other) cipher == other.cipher && offset == other.offset && sector_size == other.sector_size && key == other.key end |
#key_bits ⇒ Object
14 15 16 |
# File 'lib/crypt_reboot/luks/data.rb', line 14 def key_bits key.bytesize * 8 end |
#with_key(new_key) ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'lib/crypt_reboot/luks/data.rb', line 18 def with_key(new_key) self.class.new( cipher: cipher, offset: offset, sector_size: sector_size, key: new_key ) end |