Class PdfSignatureValidationResult
Specifies the signatures's validation result.
Inheritance
Namespace: Syncfusion.Pdf.Security
Assembly: Syncfusion.Pdf.NET.dll
Syntax
public class PdfSignatureValidationResult : Object
Examples
// Loads an existing document
PdfLoadedDocument document = new PdfLoadedDocument(fileName);
// Gets the signature field
PdfLoadedSignatureField signatureField = document.Form.Fields[0] as PdfLoadedSignatureField;
// Validate signature and get validation result
PdfSignatureValidationResult result = signatureField.ValidateSignature();
// Close the document
document.Close(true);
' Loads an existing document
Dim document As PdfLoadedDocument = New PdfLoadedDocument(fileName)
' Gets the signature field
Dim signatureField As PdfLoadedSignatureField = document.Form.Fields[0] As PdfLoadedSignatureField
' Validate signature and get validation result
Dim result As PdfSignatureValidationResult = signatureField.ValidateSignature()
' Close the document
document.Close(true)
Constructors
PdfSignatureValidationResult()
Declaration
public PdfSignatureValidationResult()
Properties
Certificates
Gets the list of certificates in the signature
Declaration
public X509Certificate2Collection Certificates { get; }
Property Value
Type |
---|
System.Security.Cryptography.X509Certificates.X509Certificate2Collection |
Examples
// Loads an existing document
PdfLoadedDocument document = new PdfLoadedDocument(fileName);
// Gets the signature field
PdfLoadedSignatureField signatureField = document.Form.Fields[0] as PdfLoadedSignatureField;
// Validate signature and get validation result
PdfSignatureValidationResult result = signatureField.ValidateSignature();
// Gets the list of certificates in the signature
X509Certificate2Collection certificates = result.Certificates;
// Close the document
document.Close(true);
' Loads an existing document
Dim document As PdfLoadedDocument = New PdfLoadedDocument(fileName)
' Gets the signature field
Dim signatureField As PdfLoadedSignatureField = document.Form.Fields[0] As PdfLoadedSignatureField
' Validate signature and get validation result
Dim result As PdfSignatureValidationResult = signatureField.ValidateSignature()
' Gets the list of certificates in the signature
Dim certificates As X509Certificate2Collection = result.Certificates
' Close the document
document.Close(true)
CryptographicStandard
Gets the cryptographic standard used in the signature
Declaration
public CryptographicStandard CryptographicStandard { get; }
Property Value
Type |
---|
CryptographicStandard |
Examples
// Loads an existing document
PdfLoadedDocument document = new PdfLoadedDocument(fileName);
// Gets the signature field
PdfLoadedSignatureField signatureField = document.Form.Fields[0] as PdfLoadedSignatureField;
// Validate signature and get validation result
PdfSignatureValidationResult result = signatureField.ValidateSignature();
// Gets the cryptographic standard used in the signature
CryptographicStandard cryptographicStandard = result.CryptographicStandard;
// Close the document
document.Close(true);
' Loads an existing document
Dim document As PdfLoadedDocument = New PdfLoadedDocument(fileName)
' Gets the signature field
Dim signatureField As PdfLoadedSignatureField = document.Form.Fields[0] As PdfLoadedSignatureField
' Validate signature and get validation result
Dim result As PdfSignatureValidationResult = signatureField.ValidateSignature()
' Gets the cryptographic standard used in the signature
Dim cryptographicStandard As CryptographicStandard = result.CryptographicStandard
' Close the document
document.Close(true)
DigestAlgorithm
Gets the digestion algorithm used in the signature
Declaration
public DigestAlgorithm DigestAlgorithm { get; }
Property Value
Type |
---|
DigestAlgorithm |
Examples
// Loads an existing document
PdfLoadedDocument document = new PdfLoadedDocument(fileName);
// Gets the signature field
PdfLoadedSignatureField signatureField = document.Form.Fields[0] as PdfLoadedSignatureField;
// Validate signature and get validation result
PdfSignatureValidationResult result = signatureField.ValidateSignature();
// Gets the digestion algorithm used in the signature
DigestAlgorithm digestAlgorithm = result.DigestAlgorithm;
// Close the document
document.Close(true);
' Loads an existing document
Dim document As PdfLoadedDocument = New PdfLoadedDocument(fileName)
' Gets the signature field
Dim signatureField As PdfLoadedSignatureField = document.Form.Fields[0] As PdfLoadedSignatureField
' Validate signature and get validation result
Dim result As PdfSignatureValidationResult = signatureField.ValidateSignature()
' Gets the digestion algorithm used in the signature
Dim digestAlgorithm As DigestAlgorithm = result.DigestAlgorithm
' Close the document
document.Close(true)
IsCertificated
Gets a value to check whether the signature is certificated or not
Declaration
public bool IsCertificated { get; }
Property Value
Type |
---|
System.Boolean |
Examples
// Loads an existing document
PdfLoadedDocument document = new PdfLoadedDocument(fileName);
// Gets the signature field
PdfLoadedSignatureField signatureField = document.Form.Fields[0] as PdfLoadedSignatureField;
// Validate signature and get validation result
PdfSignatureValidationResult result = signatureField.ValidateSignature();
// Checks whether the signature is certificated or not
bool isCertificated = result.IsCertificated;
// Close the document
document.Close(true);
' Loads an existing document
Dim document As PdfLoadedDocument = New PdfLoadedDocument(fileName)
' Gets the signature field
Dim signatureField As PdfLoadedSignatureField = document.Form.Fields[0] As PdfLoadedSignatureField
' Validate signature and get validation result
Dim result As PdfSignatureValidationResult = signatureField.ValidateSignature()
' Checks whether the signature is certificated or not
Dim isCertificated As Boolean = result.IsCertificated
' Close the document
document.Close(true)
IsDocumentModified
Gets a value to check whether the document is modified or not
Declaration
public bool IsDocumentModified { get; }
Property Value
Type |
---|
System.Boolean |
Examples
// Loads an existing document
PdfLoadedDocument document = new PdfLoadedDocument(fileName);
// Gets the signature field
PdfLoadedSignatureField signatureField = document.Form.Fields[0] as PdfLoadedSignatureField;
// Validate signature and get validation result
PdfSignatureValidationResult result = signatureField.ValidateSignature();
// Checks whether the document is modified or not
bool isDocumentModified = result.IsDocumentModified;
// Close the document
document.Close(true);
' Loads an existing document
Dim document As PdfLoadedDocument = New PdfLoadedDocument(fileName)
' Gets the signature field
Dim signatureField As PdfLoadedSignatureField = document.Form.Fields[0] As PdfLoadedSignatureField
' Validate signature and get validation result
Dim result As PdfSignatureValidationResult = signatureField.ValidateSignature()
' Checks whether the document is modified or not
Dim isDocumentModified As Boolean = result.IsDocumentModified
' Close the document
document.Close(true)
IsSignatureValid
Gets a value to check whether the signature is valid or not
Declaration
public bool IsSignatureValid { get; }
Property Value
Type |
---|
System.Boolean |
Examples
// Loads an existing document
PdfLoadedDocument document = new PdfLoadedDocument(fileName);
// Gets the signature field
PdfLoadedSignatureField signatureField = document.Form.Fields[0] as PdfLoadedSignatureField;
// Validate signature and get validation result
PdfSignatureValidationResult result = signatureField.ValidateSignature();
// Checks whether the signature is valid or not
bool isSignatureValid = result.IsSignatureValid;
// Close the document
document.Close(true);
' Loads an existing document
Dim document As PdfLoadedDocument = New PdfLoadedDocument(fileName)
' Gets the signature field
Dim signatureField As PdfLoadedSignatureField = document.Form.Fields[0] As PdfLoadedSignatureField
' Validate signature and get validation result
Dim result As PdfSignatureValidationResult = signatureField.ValidateSignature()
' Checks whether the signature is valid or not
Dim isSignatureValid As Boolean = result.IsSignatureValid
' Close the document
document.Close(true)
IsValidAtCurrentTime
Gets a value to check whether the signature valid at current time
Declaration
public bool IsValidAtCurrentTime { get; }
Property Value
Type |
---|
System.Boolean |
Examples
// Loads an existing document
PdfLoadedDocument document = new PdfLoadedDocument(fileName);
// Gets the signature field
PdfLoadedSignatureField signatureField = document.Form.Fields[0] as PdfLoadedSignatureField;
// Validate signature and get validation result
PdfSignatureValidationResult result = signatureField.ValidateSignature();
// Checks whether the signature is valid at current time
bool isValidAtCurrentTime = result.IsValidAtCurrentTime;
// Close the document
document.Close(true);
' Loads an existing document
Dim document As PdfLoadedDocument = New PdfLoadedDocument(fileName)
' Gets the signature field
Dim signatureField As PdfLoadedSignatureField = document.Form.Fields[0] As PdfLoadedSignatureField
' Validate signature and get validation result
Dim result As PdfSignatureValidationResult = signatureField.ValidateSignature()
' Checks whether the signature is valid at current time
Dim isValidAtCurrentTime As Boolean = result.IsValidAtCurrentTime
' Close the document
document.Close(true)
IsValidAtSignedTime
Gets a value to check whether the signature valid at signed time
Declaration
public bool IsValidAtSignedTime { get; }
Property Value
Type |
---|
System.Boolean |
Examples
// Loads an existing document
PdfLoadedDocument document = new PdfLoadedDocument(fileName);
// Gets the signature field
PdfLoadedSignatureField signatureField = document.Form.Fields[0] as PdfLoadedSignatureField;
// Validate signature and get validation result
PdfSignatureValidationResult result = signatureField.ValidateSignature();
// Checks whether the signature is valid at the time of signing
bool isValidAtSignedTime = result.IsValidAtSignedTime;
// Close the document
document.Close(true);
' Loads an existing document
Dim document As PdfLoadedDocument = New PdfLoadedDocument(fileName)
' Gets the signature field
Dim signatureField As PdfLoadedSignatureField = document.Form.Fields[0] As PdfLoadedSignatureField
' Validate signature and get validation result
Dim result As PdfSignatureValidationResult = signatureField.ValidateSignature()
' Checks whether the signature is valid at the time of signing
Dim isValidAtSignedTime As Boolean = result.IsValidAtSignedTime
' Close the document
document.Close(true)
IsValidAtTimeStampTime
Gets a value to check whether the signature valid at timestamp time
Declaration
public bool IsValidAtTimeStampTime { get; }
Property Value
Type |
---|
System.Boolean |
Examples
// Loads an existing document
PdfLoadedDocument document = new PdfLoadedDocument(fileName);
// Gets the signature field
PdfLoadedSignatureField signatureField = document.Form.Fields[0] as PdfLoadedSignatureField;
// Validate signature and get validation result
PdfSignatureValidationResult result = signatureField.ValidateSignature();
// Checks whether the signature is valid at timestamp time
bool isValidAtTimeStampTime = result.IsValidAtTimeStampTime;
// Close the document
document.Close(true);
' Loads an existing document
Dim document As PdfLoadedDocument = New PdfLoadedDocument(fileName)
' Gets the signature field
Dim signatureField As PdfLoadedSignatureField = document.Form.Fields[0] As PdfLoadedSignatureField
' Validate signature and get validation result
Dim result As PdfSignatureValidationResult = signatureField.ValidateSignature()
' Checks whether the signature is valid at timestamp time
Dim isValidAtTimeStampTime As Boolean = result.IsValidAtTimeStampTime
' Close the document
document.Close(true)
LtvVerificationInfo
Gets the signature LTV verification details.
Declaration
public LtvVerificationInfo LtvVerificationInfo { get; }
Property Value
Type |
---|
LtvVerificationInfo |
Examples
// Loads an existing document
PdfLoadedDocument document = new PdfLoadedDocument(fileName);
// Gets the signature field
PdfLoadedSignatureField signatureField = document.Form.Fields[0] as PdfLoadedSignatureField;
// Validate signature and get validation result
PdfSignatureValidationResult result = signatureField.ValidateSignature();
// Gets the LTV verification details
LtvVerificationInfo ltvVerificationInfo = result.LtvVerificationInfo;
// Close the document
document.Close(true);
' Loads an existing document
Dim document As PdfLoadedDocument = New PdfLoadedDocument(fileName)
' Gets the signature field
Dim signatureField As PdfLoadedSignatureField = document.Form.Fields[0] As PdfLoadedSignatureField
' Validate signature and get validation result
Dim result As PdfSignatureValidationResult = signatureField.ValidateSignature()
' Gets the LTV verification details
Dim ltvVerificationInfo As LtvVerificationInfo = result.LtvVerificationInfo
' Close the document
document.Close(true)
RevocationResult
Gets the resultant data of certificate revocation validation.
Declaration
public RevocationResult RevocationResult { get; }
Property Value
Type |
---|
RevocationResult |
Examples
// Loads an existing document
PdfLoadedDocument document = new PdfLoadedDocument(fileName);
// Gets the signature field
PdfLoadedSignatureField signatureField = document.Form.Fields[0] as PdfLoadedSignatureField;
// Validate signature and get validation result
PdfSignatureValidationResult result = signatureField.ValidateSignature();
// Gets the revocation result
RevocationResult revocationResult = result.RevocationResult;
// Gets the value indicating whether the CRL is revoked or not
bool hasRevokedCrl = revocationResult.IsRevokedCRL;
// Gets the OCSP revocation status
RevocationStatus revocationStatus = revocationResult.OcspRevocationStatus;
// Close the document
document.Close(true);
' Loads an existing document
Dim document As PdfLoadedDocument = New PdfLoadedDocument(fileName)
' Gets the signature field
Dim signatureField As PdfLoadedSignatureField = document.Form.Fields[0] As PdfLoadedSignatureField
' Validate signature and get validation result
Dim result As PdfSignatureValidationResult = signatureField.ValidateSignature()
' Gets the revocation result
Dim revocationResult As RevocationResult = result.RevocationResult
' Gets the value indicating whether the CRL is revoked or not
Dim hasRevokedCrl As Boolean = revocationResult.IsRevokedCRL
' Gets the OCSP revocation status
Dim revocationStatus As RevocationStatus = revocationResult.OcspRevocationStatus
' Close the document
document.Close(true)
SignatureAlgorithm
Gets the signature algorithm used
Declaration
public string SignatureAlgorithm { get; }
Property Value
Type |
---|
System.String |
Examples
// Loads an existing document
PdfLoadedDocument document = new PdfLoadedDocument(fileName);
// Gets the signature field
PdfLoadedSignatureField signatureField = document.Form.Fields[0] as PdfLoadedSignatureField;
// Validate signature and get validation result
PdfSignatureValidationResult result = signatureField.ValidateSignature();
// Gets the signature algorithm used
string signatureAlgorithm = result.SignatureAlgorithm;
// Close the document
document.Close(true);
' Loads an existing document
Dim document As PdfLoadedDocument = New PdfLoadedDocument(fileName)
' Gets the signature field
Dim signatureField As PdfLoadedSignatureField = document.Form.Fields[0] As PdfLoadedSignatureField
' Validate signature and get validation result
Dim result As PdfSignatureValidationResult = signatureField.ValidateSignature()
' Gets the signature algorithm used
Dim signatureAlgorithm As string = result.SignatureAlgorithm
' Close the document
document.Close(true)
SignatureName
Gets the name of the signature field.
Declaration
public string SignatureName { get; }
Property Value
Type |
---|
System.String |
Examples
// Loads an existing document
PdfLoadedDocument document = new PdfLoadedDocument(fileName);
// Gets the signature field
PdfLoadedSignatureField signatureField = document.Form.Fields[0] as PdfLoadedSignatureField;
// Validate signature and get validation result
PdfSignatureValidationResult result = signatureField.ValidateSignature();
// Gets the name of the signature field
string name = result.SignatureName;
// Close the document
document.Close(true);
' Loads an existing document
Dim document As PdfLoadedDocument = New PdfLoadedDocument(fileName)
' Gets the signature field
Dim signatureField As PdfLoadedSignatureField = document.Form.Fields[0] As PdfLoadedSignatureField
' Validate signature and get validation result
Dim result As PdfSignatureValidationResult = signatureField.ValidateSignature()
' Gets the name of the signature field
Dim name As string = result.SignatureName
' Close the document
document.Close(true)
SignatureStatus
Gets the certificate's verification status.
Declaration
public SignatureStatus SignatureStatus { get; }
Property Value
Type |
---|
SignatureStatus |
Examples
// Loads an existing document
PdfLoadedDocument document = new PdfLoadedDocument(fileName);
// Gets the signature field
PdfLoadedSignatureField signatureField = document.Form.Fields[0] as PdfLoadedSignatureField;
// Validate signature and get validation result
PdfSignatureValidationResult result = signatureField.ValidateSignature();
// Gets the signature validation status
SignatureStatus status = result.SignatureStatus;
// Close the document
document.Close(true);
' Loads an existing document
Dim document As PdfLoadedDocument = New PdfLoadedDocument(fileName)
' Gets the signature field
Dim signatureField As PdfLoadedSignatureField = document.Form.Fields[0] As PdfLoadedSignatureField
' Validate signature and get validation result
Dim result As PdfSignatureValidationResult = signatureField.ValidateSignature()
' Gets the signature validation status
Dim status As SignatureStatus = result.SignatureStatus
' Close the document
document.Close(true)
SignatureValidationErrors
Gets the list of signature validation exception
Declaration
public List<PdfSignatureValidationException> SignatureValidationErrors { get; }
Property Value
Type |
---|
System.Collections.Generic.List<PdfSignatureValidationException> |
Examples
// Loads an existing document
PdfLoadedDocument document = new PdfLoadedDocument(fileName);
// Gets the signature field
PdfLoadedSignatureField signatureField = document.Form.Fields[0] as PdfLoadedSignatureField;
// Validate signature and get validation result
PdfSignatureValidationResult result = signatureField.ValidateSignature();
// Gets the list of signature validation exception
List<PdfSignatureValidationException> signatureValidationErrors = result.SignatureValidationErrors;
// Close the document
document.Close(true);
' Loads an existing document
Dim document As PdfLoadedDocument = New PdfLoadedDocument(fileName)
' Gets the signature field
Dim signatureField As PdfLoadedSignatureField = document.Form.Fields[0] As PdfLoadedSignatureField
' Validate signature and get validation result
Dim result As PdfSignatureValidationResult = signatureField.ValidateSignature()
' Gets the list of signature validation exception
Dim signatureValidationErrors As List(Of PdfSignatureValidationException) = result.SignatureValidationErrors
' Close the document
document.Close(true)
SignerCertificates
Gets an array of PdfSignerCertificate objects that represent the certificates belonging to the signers associated with the PDF signature.
Declaration
public PdfSignerCertificate[] SignerCertificates { get; }
Property Value
Type |
---|
PdfSignerCertificate[] |
Examples
//Loads an existing document.
PdfLoadedDocument document = new PdfLoadedDocument("Input.pdf");
//Gets the signature field.
PdfLoadedSignatureField signatureField = document.Form.Fields[0] as PdfLoadedSignatureField;
//Validates signature and gets the validation result.
PdfSignatureValidationResult result = signatureField.ValidateSignature();
//Gets signer certificates
PdfSignerCertificate[] certifcate = result.SignerCertificates;
foreach (PdfSignerCertificate cert in certifcate)
{
//Get the actual signer certificate.
X509Certificate2 actualCertificate = cert.Certificate;
//Get the OCSP certificate.
PdfRevocationCertificate ocspCertificate = cert.OcspCertificate;
if (ocspCertificate != null)
{
//Gets a value indicating whether the revocation certificate is embedded within the PDF document
bool isOcspEmbedded = ocspCertificate.IsEmbedded;
//Gets the certificate associated with the revocation certificate
X509Certificate2 ocsPCert = ocspCertificate.Certificates[0];
//Gets the date and time when the revocation certificate becomes valid
DateTime currentUpdate = ocspCertificate.ValidFrom;
//Gets the date and time when the revocation certificate expires
DateTime nextUpdate = ocspCertificate.ValidTo;
}
//Get the CRL certificate.
PdfRevocationCertificate crlCertificate = cert.CrlCertificate;
if (crlCertificate != null)
{
//Gets a value indicating whether the revocation certificate is embedded within the PDF document
bool isCrlEmbedded = crlCertificate.IsEmbedded;
//Gets the certificate associated with the revocation certificate
X509Certificate2 crlCert = crlCertificate.Certificates[0];
//Gets the date and time when the revocation certificate becomes valid
DateTime currentUpdate = crlCertificate.ValidFrom;
//Gets the date and time when the revocation certificate expires
DateTime nextUpdate = crlCertificate.ValidTo;
}
}
//Close the document.
document.Close(true);
Dim document As PdfLoadedDocument = New PdfLoadedDocument("Input.pdf")
Dim signatureField As PdfLoadedSignatureField = CType(document.Form.Fields(0),PdfLoadedSignatureField)
Dim result As PdfSignatureValidationResult = signatureField.ValidateSignature
Dim certifcate() As PdfSignerCertificate = result.SignerCertificates
For Each cert As PdfSignerCertificate In certifcate
'Get the actual signer certificate.
Dim actualCertificate As X509Certificate2 = cert.Certificate
'Get the OCSP certificate.
Dim ocspCertificate As PdfRevocationCertificate = cert.OcspCertificate
If (Not (ocspCertificate) Is Nothing) Then
'Gets a value indicating whether the revocation certificate is embedded within the PDF document
Dim isOcspEmbedded As Boolean = ocspCertificate.IsEmbedded
'Gets the certificate associated with the revocation certificate
Dim ocsPCert As X509Certificate2 = ocspCertificate.Certificates(0)
'Gets the date and time when the revocation certificate becomes valid
Dim currentUpdate As DateTime = ocspCertificate.ValidFrom
'Gets the date and time when the revocation certificate expires
Dim nextUpdate As DateTime = ocspCertificate.ValidTo
End If
'Get the CRL certificate.
Dim crlCertificate As PdfRevocationCertificate = cert.CrlCertificate
If (Not (crlCertificate) Is Nothing) Then
'Gets a value indicating whether the revocation certificate is embedded within the PDF document
Dim isCrlEmbedded As Boolean = crlCertificate.IsEmbedded
'Gets the certificate associated with the revocation certificate
Dim crlCert As X509Certificate2 = crlCertificate.Certificates(0)
'Gets the date and time when the revocation certificate becomes valid
Dim currentUpdate As DateTime = crlCertificate.ValidFrom
'Gets the date and time when the revocation certificate expires
Dim nextUpdate As DateTime = crlCertificate.ValidTo
End If
Next
'Close the document.
document.Close(true)
TimeStampInformation
Gets the timestamp information from the signature
Declaration
public TimeStampInformation TimeStampInformation { get; }
Property Value
Type |
---|
TimeStampInformation |
Examples
// Loads an existing document
PdfLoadedDocument document = new PdfLoadedDocument(fileName);
// Gets the signature field
PdfLoadedSignatureField signatureField = document.Form.Fields[0] as PdfLoadedSignatureField;
// Validate signature and get validation result
PdfSignatureValidationResult result = signatureField.ValidateSignature();
// Gets the timestamp information from the signature
TimeStampInformation timeStampInformation = result.TimeStampInformation;
// Close the document
document.Close(true);
' Loads an existing document
Dim document As PdfLoadedDocument = New PdfLoadedDocument(fileName)
' Gets the signature field
Dim signatureField As PdfLoadedSignatureField = document.Form.Fields[0] As PdfLoadedSignatureField
' Validate signature and get validation result
Dim result As PdfSignatureValidationResult = signatureField.ValidateSignature()
' Gets the timestamp information from the signature
Dim timeStampInformation As TimeStampInformation = result.TimeStampInformation
' Close the document
document.Close(true)