PKCS7Detached
概述
PKCS7Detached 是 Aspose.PDF FOSS 中用于 .NET 的一个类。继承自:Signature。
一个分离的 PKCS#7(CMS)签名配置。
此类提供 6 个方法,用于在 .NET 程序中处理 PKCS7Detached 对象。可用的方法包括:GetSignatureAlgorithmInfo、PKCS7Detached、Signature、Verify。在安装了 Aspose.PDF FOSS for .NET 包后,所有公共成员对任何 .NET 应用程序均可访问。属性:Authority、AvoidEstimatingSignatureLength、ByteRange、ContactInfo、CustomAppearance、CustomSignHash,以及另外 8 项。
属性
| 名称 | 类型 | 访问 | 描述 |
|---|---|---|---|
Authority | string | 读写 | 获取或设置 authority。 |
ContactInfo | string | 读写 | 获取或设置联系信息。 |
Location | string | 读写 | 获取或设置位置。 |
Reason | string | 读写 | 获取或设置原因。 |
Date | DateTime | 读写 | 获取或设置日期。 |
ByteRange | int[] | 读取 | 签名的 /ByteRange 条目。 |
TimestampSettings | Aspose.Pdf.TimestampSettings | 读写 | RFC 3161 TSA 设置;在设置时由签名者遵守。 |
OcspSettings | Aspose.Pdf.OcspSettings | 读写 | OCSP / 吊销检查设置;在设置时由签名者遵守。 |
CustomAppearance | SignatureCustomAppearance? | 读写 | 视觉外观调节在通过 visible-rect 重载进行签名时,由 SignWithAppearance 遵守。 |
CustomSignHash | SignHash? | 读写 | 可选的外部签名器回调。 |
UseLtv | bool | 读写 | 获取或设置使用 ltv。 |
AvoidEstimatingSignatureLength | bool | 读写 | 当为 true 时,签名器会跳过字节范围估算阶段,并在为 PKCS#7 /Contents 十六进制字符串预留空间时直接使用 DefaultSignatureLength。 |
DefaultSignatureLength | int | 读写 | 为 PKCS#7 /Contents 十六进制字符串预留的字节数。 |
ShowProperties | bool | 读写 | 当为 true 时,可见签名外观会将签署人的 Reason/Location/ContactInfo 作为文本显示。 |
方法
| 签名 | 描述 |
|---|---|
PKCS7Detached() | 在此 PKCS7Detached 实例上调用 PKCS7Detached。 |
PKCS7Detached(pfx: string, password: string) | 在此 PKCS7Detached 实例上调用 PKCS7Detached(pfx, password)。 |
PKCS7Detached(pfx: Stream, password: string) | 在此 PKCS7Detached 实例上调用 PKCS7Detached(pfx, password)。 |
Signature() | 在此 PKCS7Detached 实例上调用 Signature。 |
Verify() | 验证已加载签名的 PKCS#7 与原始 PDF 字节是否匹配 — 当签名解码并验证成功时返回 true。 |
GetSignatureAlgorithmInfo() | 解析 PKCS#7 信封(从已有签名加载时),以报告签名算法 / 摘要算法 / 加密标准 三元组。 |