Class: Pubnub::Crypto::CryptorHeader::Versions::CryptorHeaderV1Data
- Inherits:
-
CryptorHeaderData
- Object
- CryptorHeaderData
- Pubnub::Crypto::CryptorHeader::Versions::CryptorHeaderV1Data
- Defined in:
- lib/pubnub/modules/crypto/cryptor_header.rb
Overview
v1 cryptor header schema.
This header consists of:
- sentinel (4 bytes)
- version (1 byte)
- cryptor identifier (4 bytes)
- cryptor data size (1 byte if less than 255 and 3 bytes in other cases)
- cryptor-defined data
Instance Attribute Summary collapse
-
#data_size ⇒ Integer
readonly
Cryptor-defined data size.
-
#identifier ⇒ String
readonly
Identifier of the cryptor which has been used to encrypt data.
Instance Method Summary collapse
-
#initialize(identifier, data_size) ⇒ CryptorHeaderV1Data
constructor
Create cryptor header data.
- #version ⇒ Object
Constructor Details
#initialize(identifier, data_size) ⇒ CryptorHeaderV1Data
Create cryptor header data.
62 63 64 65 |
# File 'lib/pubnub/modules/crypto/cryptor_header.rb', line 62 def initialize(identifier, data_size) @identifier = identifier @data_size = data_size end |
Instance Attribute Details
#data_size ⇒ Integer (readonly)
Cryptor-defined data size.
55 56 57 |
# File 'lib/pubnub/modules/crypto/cryptor_header.rb', line 55 def data_size @data_size end |
#identifier ⇒ String (readonly)
Identifier of the cryptor which has been used to encrypt data.
50 51 52 |
# File 'lib/pubnub/modules/crypto/cryptor_header.rb', line 50 def identifier @identifier end |
Instance Method Details
#version ⇒ Object
67 68 69 |
# File 'lib/pubnub/modules/crypto/cryptor_header.rb', line 67 def version 1 end |