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 | AES-128 搭配 AESV2 用 2;AES-256 搭配 AESV3 用 3 |
|---|
傳回值
| 1 | 已設定公開金鑰加密 |
|---|---|
| 0 | 未設定收件者、強度不受支援,或文件狀態不相容 |
備註
輸出使用 /Filter /Adobe.PubSec、/SubFilter /adbe.pkcs7.s5、CMS EnvelopedData,以及每個群組各自的權限承載
PDF MAC 與僅內嵌檔案加密無法與此操作併用
另請參閱
AddPublicKeyRecipientFromFile, SetPublicKeyDecryptionPFX, GetPubSecStatus