Class: Pubnub::Crypto::EncryptedData
- Defined in:
- lib/pubnub/modules/crypto/cryptor.rb
Overview
Encrypted data representation object.
Objects contain both encrypted data and additional data created by cryptor that will be required to decrypt the data.
Instance Attribute Summary collapse
-
#data ⇒ String
readonly
Encrypted data.
-
#metadata ⇒ String?
readonly
Cryptor may provide here any information which will be useful when data should be decrypted.
Instance Method Summary collapse
-
#initialize(data, metadata = nil) ⇒ EncryptedData
constructor
Create encrypted data object.
Constructor Details
#initialize(data, metadata = nil) ⇒ EncryptedData
Create encrypted data object.
An object used to keep track of the results of data encryption and the additional data the cryptor needs to handle it later.
35 36 37 38 |
# File 'lib/pubnub/modules/crypto/cryptor.rb', line 35 def initialize(data, = nil) @data = data @metadata = end |
Instance Attribute Details
#data ⇒ String (readonly)
Encrypted data.
24 25 26 |
# File 'lib/pubnub/modules/crypto/cryptor.rb', line 24 def data @data end |
#metadata ⇒ String? (readonly)
Cryptor may provide here any information which will be useful when data should be decrypted.
For example metadata may contain:
- initialization vector
- cipher key identifier
- encrypted data length
19 20 21 |
# File 'lib/pubnub/modules/crypto/cryptor.rb', line 19 def @metadata end |