Class RevokedCertificate
The RevokedCertificate class represents the revoked certificates used in PDF signing operations.
Inheritance
System.Object
RevokedCertificate
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Syncfusion.Pdf.Security
Assembly: Syncfusion.Pdf.Base.dll
Syntax
public class RevokedCertificate
Constructors
RevokedCertificate()
Declaration
public RevokedCertificate()
Properties
SerialNumber
Gets a serial number of the revoked certificate.
Declaration
public string SerialNumber { get; }
Property Value
Type |
---|
System.String |
Examples
//Loads an existing signed PDF document.
PdfLoadedDocument loadedDocument = new PdfLoadedDocument("Input.pdf");
//Gets the signature field.
PdfLoadedSignatureField signatureField = loadedDocument.Form.Fields[0] as PdfLoadedSignatureField;
Validate signature and gets the validation result.
PdfSignatureValidationResult result = signatureField.ValidateSignature();
//Gets signer certificates.
PdfSignerCertificate[] signerCertificates = result.SignerCertificates;
foreach (PdfSignerCertificate signerCertificate in signerCertificates)
{
if (signerCertificate.CrlCertificate != null)
{
//Gets the list of revoked certficates.
RevokedCertificates[] revokedCertificates = signerCertificate.CrlCertificate.RevokedCertificates;
if (revokedCertificates != null)
{
//Gets a serial number of the revoked certificate.
string serialNumber = revokedCertificates[0].SerialNumber;
//Gets a revoked date of the specific revoked certificate.
DateTime revokedDate = revokedCertificates[0].ValidTo;
}
}
}
//Close the document.
loadedDocument.Close(true);
'Loads an existing signed PDF document.
Dim loadedDocument As PdfLoadedDocument = New PdfLoadedDocument("Input.pdf")
'Gets the signature field.
Dim signatureField As PdfLoadedSignatureField = TryCast(loadedDocument.Form.Fields(0), PdfLoadedSignatureField)
'Validate signature and gets the validation result.
Dim result As PdfSignatureValidationResult = signatureField.ValidateSignature()
'Gets signer certificates.
Dim signerCertificates As PdfSignerCertificate() = result.SignerCertificates
For Each signerCertificate As PdfSignerCertificate In signerCertificates
If signerCertificate.CrlCertificate IsNot Nothing Then
'Gets the list of revoked certficates.
Dim revokedCertificates As RevokedCertificates() = signerCertificate.CrlCertificate.RevokedCertificates
If revokedCertificates IsNot Nothing Then
'Gets a serial number of the revoked certificate.
Dim serialNumber As String = revokedCertificates(0).SerialNumber
'Gets a revoked date of the specific revoked certificate.
Dim revokedDate As DateTime = revokedCertificates(0).ValidTo
End If
End If
Next
'Close the document.
loadedDocument.Close(True)
ValidTo
Retrieves the validity of the revoked CRL.
Declaration
public DateTime ValidTo { get; }
Property Value
Type |
---|
System.DateTime |
Examples
//Loads an existing signed PDF document.
PdfLoadedDocument loadedDocument = new PdfLoadedDocument("Input.pdf");
//Gets the signature field.
PdfLoadedSignatureField signatureField = loadedDocument.Form.Fields[0] as PdfLoadedSignatureField;
Validate signature and gets the validation result.
PdfSignatureValidationResult result = signatureField.ValidateSignature();
//Gets signer certificates.
PdfSignerCertificate[] signerCertificates = result.SignerCertificates;
foreach (PdfSignerCertificate signerCertificate in signerCertificates)
{
if (signerCertificate.CrlCertificate != null)
{
//Gets the list of revoked certficates.
RevokedCertificates[] revokedCertificates = signerCertificate.CrlCertificate.RevokedCertificates;
if (revokedCertificates != null)
{
//Gets a serial number of the revoked certificate.
string serialNumber = revokedCertificates[0].SerialNumber;
//Gets a revoked date of the specific revoked certificate.
DateTime revokedDate = revokedCertificates[0].ValidTo;
}
}
}
//Close the document.
loadedDocument.Close(true);
'Loads an existing signed PDF document.
Dim loadedDocument As PdfLoadedDocument = New PdfLoadedDocument("Input.pdf")
'Gets the signature field.
Dim signatureField As PdfLoadedSignatureField = TryCast(loadedDocument.Form.Fields(0), PdfLoadedSignatureField)
'Validate signature and gets the validation result.
Dim result As PdfSignatureValidationResult = signatureField.ValidateSignature()
'Gets signer certificates.
Dim signerCertificates As PdfSignerCertificate() = result.SignerCertificates
For Each signerCertificate As PdfSignerCertificate In signerCertificates
If signerCertificate.CrlCertificate IsNot Nothing Then
'Gets the list of revoked certficates.
Dim revokedCertificates As RevokedCertificates() = signerCertificate.CrlCertificate.RevokedCertificates
If revokedCertificates IsNot Nothing Then
'Gets a serial number of the revoked certificate.
Dim serialNumber As String = revokedCertificates(0).SerialNumber
'Gets a revoked date of the specific revoked certificate.
Dim revokedDate As DateTime = revokedCertificates(0).ValidTo
End If
End If
Next
'Close the document.
loadedDocument.Close(True)