THotPDF.SignPDFWithSystemCertificate Method
Сводка метода: THotPDF.SignPDFWithSystemCertificate Method
Объявление
class function SignPDFWithSystemCertificate(const InputPDFPath, OutputPDFPath: string; const Selector: THPDFCertificateStoreSelector; const Options: THPDFCMSSignOptions): boolean; overload; static;
class function SignPDFWithSystemCertificate(InputStream, OutputStream: TStream; const Selector: THPDFCertificateStoreSelector; const Options: THPDFCMSSignOptions): boolean; overload; static;
Модуль
HPDFDoc
Параметры
| Имя | Назначение |
|---|---|
InputPDFPath | Source PDF file path |
OutputPDFPath | Destination path for the signed PDF |
Selector | Certificate-store selector used to choose the signing certificate |
Options | CMS signing options controlling the digest, signature metadata, timestamp, and related policy |
InputStream | Source stream positioned at the beginning of the PDF |
OutputStream | Destination stream that receives the signed PDF |
Возвращаемое значение
Returns True when the certificate is found and the signed PDF is written successfully
Примечания по использованию
- Входные и выходные пути к файлам или stream обязаны различаться
- Приватный ключ сертификата Windows должен быть доступен текущему процессу
- Ключи на базе CNG поддерживают RSA PKCS#1 v1.5, RSA-PSS и ECDSA с дайджестом SHA-2 или SHA-3, выбранным в
Options.DigestAlgorithm - Подписи ECDSA от CNG конвертируются из формата сырых координат Windows в форму DER, которую требует CMS
- Версия Windows и провайдер хранения ключей должны реализовывать выбранный алгоритм SHA-3
- Устаревшие ключи CryptoAPI поддерживают RSA PKCS#1 v1.5 с SHA-256, SHA-384 или SHA-512 и явно отклоняют SHA-3, RSA-PSS и ECDSA
- Этот вспомогательный метод требует Delphi 2009 или новее
Связанные API
- THotPDF
- THPDFPage
- Содержание