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
#decode_parms, #filter, #source
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, &error_block) ⇒ 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
permalink #initialize(obj, key, algorithm, &error_block) ⇒ 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 161 |
# File 'lib/hexapdf/encryption/security_handler.rb', line 156 def initialize(obj, key, algorithm, &error_block) obj.instance_variables.each {|v| instance_variable_set(v, obj.instance_variable_get(v)) } @key = key @algorithm = algorithm @error_block = error_block end |
Instance Attribute Details
Instance Method Details
permalink #fiber(*args) ⇒ Object
Returns a fiber like HexaPDF::StreamData#fiber, but one wrapped in a decrypting fiber.
166 167 168 |
# File 'lib/hexapdf/encryption/security_handler.rb', line 166 def fiber(*args) @algorithm.decryption_fiber(@key, super(*args), &@error_block) end |
permalink #undecrypted_fiber ⇒ Object
[View source]
163 |
# File 'lib/hexapdf/encryption/security_handler.rb', line 163 alias undecrypted_fiber fiber |