PDFSM4EncryptToStream

密码学

描述

加密行为与 PDFSM4EncryptString 完全一致,并把带 IV 前缀的密文写入流

语法

Delphi

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

参数

Key恰好 16 字节
Plaintext任意长度;加密前按 PKCS#7 填充
Target接收带 IV 前缀密文的已赋值流

返回值

count写入的字节数,与 PDFSM4EncryptedLength(Length(Plaintext)) 一致
-1Target 未赋值或加密失败

备注

流经 WriteBuffer 写入,既有位置会被遵守,流错误会抛异常

另请参阅

PDFSM4EncryptString, PDFSM4DecryptStringBuffer, PDFSM4EncryptedLength