EncryptPublicKey
安全和签名
需要 Enterprise 版。在 Delphi、C++Builder 和 Lazarus 代码中,请将库创建为 TPDFlibEnterprise(单元 PDFlibEnterprise);Enterprise 版的 DLL 和 ActiveX 构建原样提供该类。其他版本保留此方法,它返回 0、空字符串或 False,并将 LastErrorCode 设置为 900 (PDFLIB_ERROR_ENTERPRISE_REQUIRED)
描述
使用待处理收件人证书和权限组为所选文档配置 Adobe.PubSec 公钥加密
语法
Delphi
Function TPDFlib.EncryptPublicKey(Strength: Integer): Integer; Virtual;
ActiveX
Function PDFlib::EncryptPublicKey(Strength As Long) As Long
DLL
int DLEncryptPublicKey(int InstanceID, int Strength);
参数
| Strength | 将 2 用于采用 AESV2 的 AES-128,或将 3 用于采用 AESV3 的 AES-256 |
|---|
返回值
| 1 | 已配置公钥加密 |
|---|---|
| 0 | 未配置收件人、强度不受支持,或文档状态不兼容 |
备注
输出使用 /Filter /Adobe.PubSec、/SubFilter /adbe.pkcs7.s5、CMS EnvelopedData 和每组权限载荷
PDF MAC 和仅嵌入文件的加密不能与此操作组合使用
另请参阅
AddPublicKeyRecipientFromFile, SetPublicKeyDecryptionPFX, GetPubSecStatus