SetSignProcessCNGKeyFromFile

ความปลอดภัยและลายเซ็น

คำอธิบาย

โหลดใบรับรอง X.509 เข้ารหัส DER จากไฟล์ แล้วผูก private key NCrypt ที่มีชื่อเข้ากับกระบวนการลงลายเซ็น PDF

ไวยากรณ์

Delphi

Function TPDFlib.SetSignProcessCNGKeyFromFile(SignProcessID: Integer; Const CertificateFile, ProviderName, KeyName: WideString; UseMachineKey, AllowUI: Boolean): Integer;

ActiveX

Function PDFlib::SetSignProcessCNGKeyFromFile(SignProcessID As Long, CertificateFile As String, ProviderName As String, KeyName As String, UseMachineKey As Long, AllowUI As Long) As Long

DLL

int DLSetSignProcessCNGKeyFromFile(int InstanceID, int SignProcessID, const wchar_t* CertificateFile, const wchar_t* ProviderName, const wchar_t* KeyName, int UseMachineKey, int AllowUI);

พารามิเตอร์

CertificateFileพาธไปยังใบรับรอง X.509 แบบ RSA หรือ ECDSA เข้ารหัส DER หรือ PEM
ProviderNameชื่อ key storage provider ของ Windows หรือสตริงว่างสำหรับ provider ซอฟต์แวร์ของ Microsoft
KeyNameชื่อคีย์ถาวรที่ provider เข้าใจ
UseMachineKeyTrue หรือไม่เท่าศูนย์ เพื่อใช้ขอบเขตคีย์ระดับเครื่อง
AllowUITrue หรือไม่เท่าศูนย์ เพื่ออนุญาตให้ provider โต้ตอบได้

ค่าที่ส่งคืน

1อ่านใบรับรองแล้วผูกการตั้งค่าเข้าไปเรียบร้อย
0ไฟล์ process id หรือชื่อคีย์ไม่ถูกต้อง

หมายเหตุ

DLL ยังส่งออก DLSetSignProcessCNGKeyFromFileA สำหรับพาธและชื่อแบบ ANSI กระบวนการลงลายเซ็นเก็บไบต์ใบรับรองไว้ ส่วน private key ยังอยู่ใน provider ของมัน

ดูเพิ่มเติม

SetSignProcessCNGKey, SetSignProcessPFXFromFile