PKCS7Detached

PKCS7Detached

Overview

PKCS7Detached is a class in Aspose.PDF FOSS for .NET. Inherits from: Signature.

A detached PKCS#7 (CMS) signature configuration.

This class declares 14 methods for PKCS7Detached objects in .NET programs. Available methods include: GetSignatureAlgorithmInfo, PKCS7Detached, 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

NameTypeAccessDescription
AuthoritystringRead/WriteGets or sets the signer name (the /Name entry).
ContactInfostringRead/WriteGets or sets the signer contact information written to, or read from, the signature dictionary.
LocationstringRead/WriteGets or sets the signing location written to, or read from, the signature dictionary.
ReasonstringRead/WriteGets or sets the reason for signing written to, or read from, the signature dictionary.
DateDateTimeRead/WriteGets or sets the signing time (the /M entry).
ByteRangeint[]ReadThe signature’s /ByteRange entry.
TimestampSettingsAspose.Pdf.TimestampSettingsRead/WriteRFC 3161 TSA settings; honoured by the signer when set.
OcspSettingsAspose.Pdf.OcspSettingsRead/WriteOCSP / revocation-check settings; honoured by the signer when set.
CustomAppearanceSignatureCustomAppearance?Read/WriteVisual-appearance knobs honoured by SignWithAppearance when the signature is signed via a visible-rect overload.
CustomSignHashSignHash?Read/WriteOptional external-signer callback.
UseLtvboolRead/WriteGets or sets whether signing also embeds the signer certificate in a Document Security Store (/DSS) so the signature stays verifiable later.
AvoidEstimatingSignatureLengthboolRead/WriteWhen true, the signer skips the byte-range estimation pass and uses DefaultSignatureLength directly when reserving space for the PKCS#7 /Contents hex string.
DefaultSignatureLengthintRead/WriteNumber of bytes reserved for the PKCS#7 /Contents hex string.
ShowPropertiesboolRead/WriteWhen true, the visible signature appearance includes the signer’s Reason/Location/ContactInfo as text.

Methods

SignatureDescription
PKCS7Detached()Creates a detached PKCS#7 signature configuration with no signing certificate.
PKCS7Detached(pfx: string, password: string)Creates a detached PKCS#7 signature configuration from a PFX file and its password.
PKCS7Detached(pfx: Stream, password: string)Creates a detached PKCS#7 signature configuration from a PFX stream and its password.
PKCS7Detached(pfx: string, password: string, digestHashAlgorithm: DigestHashAlgorithm)Sign with an explicitly chosen message digest rather than the SubFilter default.
PKCS7Detached(pfx: Stream, password: string, digestHashAlgorithm: DigestHashAlgorithm)Creates a detached PKCS#7 signature configuration from a PFX stream and its password, signing with the given message digest.
PKCS7Detached(timestampSettings: Aspose.Pdf.TimestampSettings)Construct a standalone RFC 3161 document-timestamp configuration.
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.

See Also

 English