PKCS1
Overview
PKCS1 is a class in Aspose.PDF FOSS for .NET.
Inherits from: Signature.
A PKCS#1 signature configuration.
This class declares 12 methods for PKCS1 objects in .NET programs.
Available methods include: GetSignatureAlgorithmInfo, PKCS1, Signature, TryVerify, Verify.
Public members are accessible to any .NET application after installing the Aspose.PDF FOSS for .NET package.
Properties: Authority, AvoidEstimatingSignatureLength, ByteRange, ContactInfo, CustomAppearance, CustomSignHash, and 8 more.
Properties
| Name | Type | Access | Description |
|---|---|---|---|
Authority | string | Read/Write | Gets or sets the signer name (the /Name entry). |
ContactInfo | string | Read/Write | Gets or sets the signer contact information written to, or read from, the signature dictionary. |
Location | string | Read/Write | Gets or sets the signing location written to, or read from, the signature dictionary. |
Reason | string | Read/Write | Gets or sets the reason for signing written to, or read from, the signature dictionary. |
Date | DateTime | Read/Write | Gets or sets the signing time (the /M entry). |
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 whether signing also embeds the signer certificate in a Document Security Store (/DSS) so the signature stays verifiable later. |
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 |
|---|---|
PKCS1() | Creates a PKCS#1 signature configuration with no signing certificate. |
PKCS1(pfx: string, password: string) | Creates a PKCS#1 signature configuration from a PFX file and its password. |
PKCS1(pfx: Stream, password: string) | Creates a PKCS#1 signature configuration from a PFX stream and its password. |
PKCS1(image: Stream) | Construct a PKCS#1 signature configuration whose visible signature renders image as the appearance graphic. |
Signature() | Creates a signature configuration with no signing certificate. |
Signature(pfx: string, password: string) | Creates a signature configuration that signs with the certificate and private key loaded from a PFX file and its password. |
Signature(pfx: Stream, password: string) | Creates a signature configuration that signs with the certificate and private key read from a PFX stream and its password. |
Verify() | Verify the loaded signature’s PKCS#7 against the original PDF bytes — returns true when the signature decodes and validates. |
TryVerify(verificationResult: Security.VerificationResult) | Non-throwing verification: the verdict - valid, invalid, or undefined when the signature’s structure is a recognised forgery - lands in verificationResult; the return says whether a verdict was reached. |
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. |