ExternalSignature

ExternalSignature

概述

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

基于已加载平台证书的分离式 PKCS#7 签名配置——通常来自操作系统证书存储、智能卡或 HSM——而非 PFX 文件。

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

属性

名称类型访问描述
CertificateSystem.Security.Cryptography.X509Certificates.X509Certificate2读取此实例构建时使用的证书。
Authoritystring读写获取或设置权限。
ContactInfostring读写获取或设置联系信息。
Locationstring读写获取或设置位置。
Reasonstring读写获取或设置原因。
DateDateTime读写获取或设置日期。
ByteRangeint[]读取签名的 /ByteRange 条目.
TimestampSettingsAspose.Pdf.TimestampSettings读写RFC 3161 TSA 设置;在设置后由签名者遵循。
OcspSettingsAspose.Pdf.OcspSettings读写OCSP / 吊销检查 设置;在设置后由签名者遵循。
CustomAppearanceSignatureCustomAppearance?读写当签名通过 visible-rect overload 进行签署时,SignWithAppearance 会遵守 Visual-appearance knobs。
CustomSignHashSignHash?读写可选的 external-signer 回调。
UseLtvbool读写获取或设置使用 ltv。
AvoidEstimatingSignatureLengthbool读写当为 true 时,签署者跳过字节范围估算过程,并在为 PKCS#7 /Contents 十六进制字符串预留空间时直接使用 DefaultSignatureLength。
DefaultSignatureLengthint读写为 PKCS#7 /Contents 十六进制字符串预留的字节数。
ShowPropertiesbool读写当为 true 时,可见签名外观会将签署者的 Reason/Location/ContactInfo 作为文本显示。

方法

签名描述
ExternalSignature(certificate: System.Security.Cryptography.X509Certificates.X509Certificate2)在此 ExternalSignature 实例上调用 ExternalSignature(certificate)。
ExternalSignature(certificate: System.Security.Cryptography.X509Certificates.X509Certificate2, detached: bool)detached 选择处理器,完全与 PKCS7 / PKCS7Detached 配对的行为相同:true 在 SHA-256 摘要上生成 adbe.pkcs7.detached 包,false 在 SHA-1 摘要上使用 adbe.pkcs7.sha1 处理器。
ExternalSignature(certificate: System.Security.Cryptography.X509Certificates.X509Certificate2, digestHashAlgorithm: DigestHashAlgorithm)在此 ExternalSignature 实例上调用 ExternalSignature(certificate, digestHashAlgorithm)。
ExternalSignature(base64Certificate: string, detached: bool)通过 CustomSignHash 使用 base64 编码的公钥证书(无私钥)构造,以实现延迟/外部签名。
Signature()在此 ExternalSignature 实例上调用 Signature。
Signature(pfx: string, password: string)在此 ExternalSignature 实例上调用 Signature(pfx, password)。
Signature(pfx: Stream, password: string)在此 ExternalSignature 实例上调用 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 信封(当从现有签名加载时),以报告签名算法 / 摘要算法 / 加密标准 三元组。
 中文