DAOpenFromStreamWithEncryptionKey
Document management, Direct access functionality, Security, Stream input
Description
Opens an encrypted seekable stream for authorised recovery or investigation by accepting the hexadecimal file-encryption key directly instead of deriving it from a password
Syntax
Delphi
Function TPDFlib.DAOpenFromStreamWithEncryptionKey(InStream: TStream; Const EncryptionKeyHex: WideString; Options: Integer = 0): Integer;Parameters
| InStream | A non-nil seekable PDF stream that remains owned by the caller |
|---|---|
| EncryptionKeyHex | An even-length ASCII hexadecimal key with no prefix or whitespace and the exact length required by the encryption revision |
| Options | Zero requires an available verifier; PDF_RAW_KEY_ALLOW_UNVERIFIED permits an otherwise valid key only when the document has no usable verifier |
Return values
| Non-zero | A Direct Access file handle |
|---|---|
| 0 | The input could not be opened; inspect LastErrorCode |
Remarks
The library never takes ownership of InStream and closing the Direct Access handle leaves it usable by the caller
Available verifiers are always checked and a mismatch is never accepted
Call DAGetEncryptionKeyValidation after opening to inspect the validation result