SetSignProcessCNGKey
ความปลอดภัยและลายเซ็น
คำอธิบาย
ผูก private key NCrypt ที่มีชื่อ พร้อมใบรับรอง X.509 เข้ารหัส DER ของมัน เข้ากับกระบวนการลงลายเซ็น PDF
คีย์ถูกเปิดตรงจาก key storage provider ที่ขอ การลงลายเซ็นที่อาศัย TPM, hardware token, cloud KSP และตัวตนแบบ CNG เท่านั้นจึงใช้ได้ โดยไม่ต้องส่งออก private key
ไวยากรณ์
Delphi
Function TPDFlib.SetSignProcessCNGKey(SignProcessID: Integer; Const CertificateDER: AnsiString; Const ProviderName, KeyName: WideString; UseMachineKey, AllowUI: Boolean): Integer;
ActiveX
Function PDFlib::SetSignProcessCNGKey(SignProcessID As Long, CertificateDER As Variant, ProviderName As String, KeyName As String, UseMachineKey As Long, AllowUI As Long) As Long
DLL
int DLSetSignProcessCNGKey(int InstanceID, int SignProcessID, const char* CertificateDER, int CertificateLength, const wchar_t* ProviderName, const wchar_t* KeyName, int UseMachineKey, int AllowUI);
พารามิเตอร์
| SignProcessID | Value returned by a NewSignProcessFrom* function |
|---|---|
| CertificateDER | ใบรับรอง X.509 เข้ารหัส DER แบบ RSA หรือ ECDSA ทั้งชุดที่คู่กับ private key |
| ProviderName | Windows key storage provider name, or an empty string for Microsoft Software Key Storage Provider |
| KeyName | ชื่อคีย์ถาวรที่ provider เข้าใจ |
| UseMachineKey | True หรือไม่เท่าศูนย์ เพื่อเปิดคีย์จากขอบเขตเครื่อง |
| AllowUI | True หรือไม่เท่าศูนย์ เพื่ออนุญาต UI แบบ PIN, คำขอยินยอม หรือการอนุมัติผ่าน cloud จาก provider |
ค่าที่ส่งกลับ
| 1 | ผูกการตั้งค่าตัวตนเข้ากับกระบวนการแล้ว |
|---|---|
| 0 | process id, ใบรับรอง หรือชื่อคีย์ไม่ถูกต้อง |
หมายเหตุ
คีย์ถูกเปิดเมื่อกระบวนการ sign ทำงาน ไม่มีไบต์ private key เข้าหน่วยความจำของไลบรารีเลย
When AllowUI is false, NCRYPT_SILENT_FLAG is applied to key opening and signingThe generated CMS signature is verified against
CertificateDER ก่อนถูกยอมรับ, คีย์ที่อัลกอริทึมเดียวกันแต่ไม่ตรงกันจะถูกปฏิเสธ ActiveX รับ variant byte array และ DLL ใช้ความยาวใบรับรองแบบชัดเจน ไบต์ศูนย์ฝังตัวจึงถูกคงไว้
ดูเพิ่มเติม
SetSignProcessCNGKeyFromFile, SetSignProcessCNGKeyByHandle, SetSignProcessPrivateKeyUI