Class: Pubnub::Crypto::Cryptor
- Defined in:
- lib/pubnub/modules/crypto/cryptor.rb
Overview
Base class which is used to implement cryptor that should be used with CryptorProvider implementation for data encryption and decryption.
Direct Known Subclasses
Instance Method Summary collapse
-
#decrypt(data) ⇒ String?
Decrypt provided data.
-
#encrypt(data) ⇒ EncryptedData?
Encrypt provided data.
-
#identifier ⇒ String
Identifier will be encoded into cryptor data header and passed along with encrypted data and metadata.
Instance Method Details
#decrypt(data) ⇒ String?
Decrypt provided data.
68 69 70 |
# File 'lib/pubnub/modules/crypto/cryptor.rb', line 68 def decrypt(data) raise NotImplementedError, 'Subclass should provide "decrypt" method implementation.' end |
#encrypt(data) ⇒ EncryptedData?
Encrypt provided data.
59 60 61 |
# File 'lib/pubnub/modules/crypto/cryptor.rb', line 59 def encrypt(data) raise NotImplementedError, 'Subclass should provide "encrypt" method implementation.' end |
#identifier ⇒ String
Identifier will be encoded into cryptor data header and passed along with encrypted data and metadata.
The identifier must be 4 bytes long.
50 51 52 |
# File 'lib/pubnub/modules/crypto/cryptor.rb', line 50 def identifier raise NotImplementedError, 'Subclass should provide "identifier" method implementation.' end |