ExternalSignature
Overview
ExternalSignature is a class in Aspose.PDF FOSS for .NET.
Inherits from: Signature.
A detached PKCS#7 signature configuration built around an already-loaded platform certificate — typically from the OS certificate store, a smartcard or an HSM — rather than a PFX file.
This class provides 11 methods for working with ExternalSignature objects in .NET programs.
Available methods include: ExternalSignature, GetSignatureAlgorithmInfo, Signature, Verify.
All public members are accessible to any .NET application after installing the Aspose.PDF FOSS for .NET package.
Properties: Authority, AvoidEstimatingSignatureLength, ByteRange, Certificate, ContactInfo, CustomAppearance, and 9 more.
Properties
| Name | Type | Access | Description |
|---|---|---|---|
Certificate | System.Security.Cryptography.X509Certificates.X509Certificate2 | Read | The certificate this instance was constructed with. |
Authority | string | Read/Write | Gets or sets the authority. |
ContactInfo | string | Read/Write | Gets or sets the contact info. |
Location | string | Read/Write | Gets or sets the location. |
Reason | string | Read/Write | Gets or sets the reason. |
Date | DateTime | Read/Write | Gets or sets the date. |
ByteRange | int[] | Read | The signature’s /ByteRange entry. |
TimestampSettings | Aspose.Pdf.TimestampSettings | Read/Write | RFC 3161 TSA settings; honoured by the signer when set. |
OcspSettings | Aspose.Pdf.OcspSettings | Read/Write | OCSP / revocation-check settings; honoured by the signer when set. |
CustomAppearance | SignatureCustomAppearance? | Read/Write | Visual-appearance knobs honoured by SignWithAppearance when the signature is signed via a visible-rect overload. |
CustomSignHash | SignHash? | Read/Write | Optional external-signer callback. |
UseLtv | bool | Read/Write | Gets or sets the use ltv. |
AvoidEstimatingSignatureLength | bool | Read/Write | When true, the signer skips the byte-range estimation pass and uses DefaultSignatureLength directly when reserving space for the PKCS#7 /Contents hex string. |
DefaultSignatureLength | int | Read/Write | Number of bytes reserved for the PKCS#7 /Contents hex string. |
ShowProperties | bool | Read/Write | When true, the visible signature appearance includes the signer’s Reason/Location/ContactInfo as text. |
Methods
| Signature | Description |
|---|---|
ExternalSignature(certificate: System.Security.Cryptography.X509Certificates.X509Certificate2) | Calls ExternalSignature(certificate) on this ExternalSignature instance. |
ExternalSignature(certificate: System.Security.Cryptography.X509Certificates.X509Certificate2, detached: bool) | detached selects the handler, exactly as the PKCS7 / PKCS7Detached pair does: true emits an adbe.pkcs7.detached envelope over a SHA-256 digest, false the adbe.pkcs7.sha1 handler over a SHA-1 digest. |
ExternalSignature(certificate: System.Security.Cryptography.X509Certificates.X509Certificate2, digestHashAlgorithm: DigestHashAlgorithm) | Calls ExternalSignature(certificate, digestHashAlgorithm) on this ExternalSignature instance. |
ExternalSignature(base64Certificate: string, detached: bool) | Construct from a base64-encoded public certificate (no private key) for deferred/external signing via CustomSignHash. |
Signature() | Calls Signature on this ExternalSignature instance. |
Signature(pfx: string, password: string) | Calls Signature(pfx, password) on this ExternalSignature instance. |
Signature(pfx: Stream, password: string) | Calls Signature(pfx, password) on this ExternalSignature instance. |
Verify() | Verify the loaded signature’s PKCS#7 against the original PDF bytes — returns true when the signature decodes and validates. |
Verify(options: Security.ValidationOptions, validationResult: Security.ValidationResult) | Verify with explicit options + a result DTO. |
Verify(publicKeyCertificate: System.Security.Cryptography.X509Certificates.X509Certificate2, options: Security.ValidationOptions, validationResult: Security.ValidationResult) | Public-key-pinned verify. |
GetSignatureAlgorithmInfo() | Parse the PKCS#7 envelope (when loaded from an existing signature) to report the signing-algorithm / digest-algorithm / cryptographic-standard triple. |