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 as template.
- #undecrypted_fiber ⇒ Object
Constructor Details
#initialize(obj, key, algorithm) ⇒ EncryptedStreamData
Creates a new encrypted stream data object by utilizing the given stream data object as template. The arguments key
and algorithm
are used for decrypting purposes.
146 147 148 149 150 |
# File 'lib/hexapdf/encryption/security_handler.rb', line 146 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.
142 143 144 |
# File 'lib/hexapdf/encryption/security_handler.rb', line 142 def algorithm @algorithm end |
#key ⇒ Object (readonly)
The encryption key.
139 140 141 |
# File 'lib/hexapdf/encryption/security_handler.rb', line 139 def key @key end |
Instance Method Details
#fiber(*args) ⇒ Object
Returns a fiber like HexaPDF::StreamData#fiber, but one wrapped in a decrypting fiber.
155 156 157 |
# File 'lib/hexapdf/encryption/security_handler.rb', line 155 def fiber(*args) @algorithm.decryption_fiber(@key, super(*args)) end |
#undecrypted_fiber ⇒ Object
152 |
# File 'lib/hexapdf/encryption/security_handler.rb', line 152 alias undecrypted_fiber fiber |