Class TimeStampInformation
Specifies the timestamp information from the signature
Inheritance
System.Object
TimeStampInformation
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Syncfusion.Pdf.Security
Assembly: Syncfusion.Pdf.Base.dll
Syntax
public class 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)
Constructors
TimeStampInformation()
Declaration
public TimeStampInformation()
Properties
Certificate
Gets the timestamp certificate.
Declaration
public X509Certificate2 Certificate { get; }
Property Value
Type | Description |
---|---|
System.Security.Cryptography.X509Certificates.X509Certificate2 |
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;
// Checks whether the signature signed with timestamp alone
bool documentTimeStamp = timeStampInformation.IsDocumentTimeStamp;
//Gets the timestamp certificate.
X509Certificate2 certificate2 = result.TimeStampInformation.Certificate;
// 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
' Checks whether the signature signed with timestamp alone
Dim documentTimeStamp As Boolean = timeStampInformation.IsDocumentTimeStamp
'Gets the timestamp certificate.
Dim certificate2 AS X509Certificate2 = result.TimeStampInformation.Certificate
' Close the document
document.Close(true)
IsDocumentTimeStamp
Checks whether the signature signed with timestamp alone
Declaration
public bool IsDocumentTimeStamp { get; }
Property Value
Type | Description |
---|---|
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();
// Gets the timestamp information from the signature
TimeStampInformation timeStampInformation = result.TimeStampInformation;
// Checks whether the signature signed with timestamp alone
bool documentTimeStamp = timeStampInformation.IsDocumentTimeStamp;
// 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
' Checks whether the signature signed with timestamp alone
Dim documentTimeStamp As Boolean = timeStampInformation.IsDocumentTimeStamp
' Close the document
document.Close(true)
IsValid
Checks whether the timestamp is valid or not
Declaration
public bool IsValid { get; }
Property Value
Type | Description |
---|---|
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();
// Gets the timestamp information from the signature
TimeStampInformation timeStampInformation = result.TimeStampInformation;
// Checks whether the timestamp is valid or not
bool isValid = timeStampInformation.IsValid;
// 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
' Checks whether the timestamp is valid or not
Dim isValid As Boolean = timeStampInformation.IsValid
' Close the document
document.Close(true)
Time
Gets the timestamp time
Declaration
public DateTime Time { get; }
Property Value
Type | Description |
---|---|
System.DateTime |
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;
// Gets the timestamp time
DateTime timeStampTime = timeStampInformation.Time;
// 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
' Gets the timestamp time
Dim timeStampTime As DateTime = timeStampInformation.Time
' Close the document
document.Close(true)
TimeStampPolicyId
Gets the timestamp policy ID
Declaration
public string TimeStampPolicyId { get; }
Property Value
Type | Description |
---|---|
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 timestamp information from the signature
TimeStampInformation timeStampInformation = result.TimeStampInformation;
// Gets the timestamp policy ID
string timeStampPolicyId = timeStampInformation.TimeStampPolicyId;
// 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
' Gets the timestamp policy ID
Dim timeStampPolicyId As string = timeStampInformation.TimeStampPolicyId
' Close the document
document.Close(true)