THotPDF.RecoverReloadKeysFromStreamRanges

function RecoverReloadKeysFromStreamRanges(Stream: TStream;
  const Password: AnsiString): Boolean; overload;
function RecoverReloadKeysFromStreamRanges(Stream: TStream;
  const Password: AnsiString; out OwnerAuthenticated: Boolean): Boolean; overload;

Recovers the supported Standard security-handler file key through bounded source ranges and restores the caller's stream position

The overload reports whether the supplied password also authenticated as an owner password; when owner and user passwords are equal, owner authentication takes precedence

False means a supported key could not be recovered and OwnerAuthenticated is False; the Boolean does not distinguish a plain source from an unsupported or incorrectly authenticated encrypted source

This is a stateful reload helper that populates the document's temporary decryption-key cache; use it on an independent preparation document and retain normal document ownership and cancellation rules

OwnerAuthenticated identifies the password role and does not independently validate a document signature, authenticate revocation evidence, or enforce a signature policy