PDFSM4EncryptToStream

密碼編譯

描述

加密方式與 PDFSM4EncryptString 完全相同,並把帶 IV 前綴的密文寫入串流

語法

Delphi

Function PDFSM4EncryptToStream(Const Key, Plaintext: AnsiString;
  Target: TStream): Int64;

參數

Key正好 16 位元組
Plaintext任意長度;加密前以 PKCS#7 填補
Target接收帶 IV 前綴密文的已指派串流

傳回值

count寫入的位元組數,等於 PDFSM4EncryptedLength(Length(Plaintext))
-1目標未指派或加密失敗

備註

串流以 WriteBuffer 寫入,會遵循既有位置,串流錯誤會拋出例外

另請參閱

PDFSM4EncryptString, PDFSM4DecryptStringBuffer, PDFSM4EncryptedLength