PDFium Delphi Component 文件

FPdfHmac 單元

單元: FPdfHmac
PDF MAC 金鑰衍生與認證使用的無相依 HMAC-SHA256 與 HKDF-SHA256 基本操作

Syntax

function HmacSha256(const Key, Data: TBytes): TSHA256Digest;
function HkdfSha256(const InputKeyMaterial, Salt, Info: TBytes;
  OutputLength: Integer): TBytes;
function ConstantTimeBytesEqual(const Left, Right: TBytes): Boolean;
procedure SecureClearBytes(var Data: TBytes);

Description

HmacSha256 對任意位元組陣列實作 RFC 2104 認證,並在建構內外層填充前,先對超過 SHA-256 區塊大小的金鑰做雜湊

HkdfSha256 實作 RFC 5869 的 extract-and-expand 衍生,輸出長度可從零到 8160 位元組

ConstantTimeBytesEqual 同時比較內容與長度,不在第一個不符處提前返回;SecureClearBytes 則在釋放受控位元組儲存前先將其清除

See Also

FPdfSha256, FPdfMac, FPdfEncrypt