PKCS7

概述

PKCS7 是 Aspose.PDF FOSS 中用于 .NET 的一个类。继承自:Signature。

此类提供 10 个用于在 .NET 程序中处理 PKCS7 对象的方法。可用的方法包括:GetSignatureAlgorithmInfo、PKCS7、Signature、Verify。在安装 Aspose.PDF FOSS for .NET 包后,所有公共成员对任何 .NET 应用程序均可访问。属性:Authority、AvoidEstimatingSignatureLength、ByteRange、ContactInfo、CustomAppearance、CustomSignHash,以及其他 8 项。

属性

名称类型访问描述
Authoritystring读写获取或设置 authority。
ContactInfostring读写获取或设置联系信息。
Locationstring读写获取或设置位置。
Reasonstring读写获取或设置原因。
DateDateTime读写获取或设定日期。
ByteRangeint[]读取签名的 /ByteRange 条目。
TimestampSettingsAspose.Pdf.TimestampSettings读写RFC 3161 TSA 设置;在设置时由签名者遵守。
OcspSettingsAspose.Pdf.OcspSettings读写OCSP / 吊销检查设置;在设置时由签名者遵守。
CustomAppearanceSignatureCustomAppearance?读写可视外观调节项在通过 visible-rect 重载签署时由 SignWithAppearance 遵守。
CustomSignHashSignHash?读写可选的外部签名器回调。
UseLtvbool读写获取或设置 use ltv。
AvoidEstimatingSignatureLengthbool读写当为 true 时,签名器会跳过字节范围估算步骤,并在为 PKCS#7 /Contents 十六进制字符串预留空间时直接使用 DefaultSignatureLength。
DefaultSignatureLengthint读写为 PKCS#7 /Contents 十六进制字符串保留的字节数。
ShowPropertiesbool读写为 true 时,可见的签名外观会将签署人的 Reason/Location/ContactInfo 作为文本包含。

方法

签名描述
PKCS7()在此 PKCS7 实例上调用 PKCS7。
PKCS7(pfx: string, password: string)在此 PKCS7 实例上调用 PKCS7(pfx, password)。
PKCS7(pfx: Stream, password: string)在此 PKCS7 实例上调用 PKCS7(pfx, password)。
Signature()在此 PKCS7 实例上调用 Signature。
Signature(pfx: string, password: string)在此 PKCS7 实例上调用 Signature(pfx, password)。
Signature(pfx: Stream, password: string)在此 PKCS7 实例上调用 Signature(pfx, password)。
Verify()验证已加载签名的 PKCS#7 与原始 PDF 字节 — 当签名解码并验证成功时返回 true。
Verify(options: Security.ValidationOptions, validationResult: Security.ValidationResult)使用显式选项进行验证 + 一个结果 DTO。
Verify(publicKeyCertificate: System.Security.Cryptography.X509Certificates.X509Certificate2, options: Security.ValidationOptions, validationResult: Security.ValidationResult)公钥固定验证。
GetSignatureAlgorithmInfo()解析 PKCS#7 封装(当从已有签名加载时),以报告 signing-algorithm / digest-algorithm / cryptographic-standard 三元组。

另请参阅

 中文