Class: HexaPDF::Encryption::SecurityHandler::EncryptedStreamData
- Inherits:
-
StreamData
- Object
- StreamData
- HexaPDF::Encryption::SecurityHandler::EncryptedStreamData
- Defined in:
- lib/hexapdf/encryption/security_handler.rb
Overview
Provides additional encryption specific information for HexaPDF::StreamData objects.
Instance Attribute Summary collapse
-
#algorithm ⇒ Object
readonly
The encryption algorithm.
-
#key ⇒ Object
readonly
The encryption key.
Attributes inherited from StreamData
Instance Method Summary collapse
-
#fiber(*args) ⇒ Object
Returns a fiber like HexaPDF::StreamData#fiber, but one wrapped in a decrypting fiber.
-
#initialize(obj, key, algorithm) ⇒ EncryptedStreamData
constructor
Creates a new encrypted stream data object by utilizing the given stream data object
obj
as template. - #undecrypted_fiber ⇒ Object
Methods inherited from StreamData
Constructor Details
#initialize(obj, key, algorithm) ⇒ EncryptedStreamData
Creates a new encrypted stream data object by utilizing the given stream data object obj
as template. The arguments key
and algorithm
are used for decrypting purposes.
156 157 158 159 160 |
# File 'lib/hexapdf/encryption/security_handler.rb', line 156 def initialize(obj, key, algorithm) obj.instance_variables.each {|v| instance_variable_set(v, obj.instance_variable_get(v)) } @key = key @algorithm = algorithm end |
Instance Attribute Details
#algorithm ⇒ Object (readonly)
The encryption algorithm.
152 153 154 |
# File 'lib/hexapdf/encryption/security_handler.rb', line 152 def algorithm @algorithm end |
#key ⇒ Object (readonly)
The encryption key.
149 150 151 |
# File 'lib/hexapdf/encryption/security_handler.rb', line 149 def key @key end |
Instance Method Details
#fiber(*args) ⇒ Object
Returns a fiber like HexaPDF::StreamData#fiber, but one wrapped in a decrypting fiber.
165 166 167 |
# File 'lib/hexapdf/encryption/security_handler.rb', line 165 def fiber(*args) @algorithm.decryption_fiber(@key, super(*args)) end |
#undecrypted_fiber ⇒ Object
162 |
# File 'lib/hexapdf/encryption/security_handler.rb', line 162 alias undecrypted_fiber fiber |