THotPDF.TryLoadedPubSecFilterKey Method
Looks up the recovered envelope key of one named public-key crypt filter in the currently loaded document. Use the result code to learn whether a filter decrypts with its own key or with the document default key
Declaration
function TryLoadedPubSecFilterKey(const FilterName: AnsiString; out Key: THPDFLoadedPubSecFilterKey): Integer;
Unit
HPDFDoc
Parameters
| Name | Purpose |
|---|---|
FilterName | Name of the crypt filter whose recovered key is requested, such as the stream or string crypt filter name of the loaded document |
Key | Receives the matching THPDFLoadedPubSecFilterKey entry when the method returns 1 |
Return value
Returns 1 when the named filter carries its own recovered envelope key, 0 when it carries envelopes whose key was not recovered, and -1 when the filter has no own envelopes and decrypts with the document default key
Usage notes
- Result 1 fills Key with the filter name, key algorithm, and recovered key bytes; result 0 leaves Key zeroed because the caller must fail closed
- An empty FilterName returns -1 without touching the recovered key table