PDF Signature Verification API
API Action: Get List of Signatures and Signature Status form PDF.
Url: https//<baseurl>/api/SignPdfV1/SignatureDetails
HTTP Method: POST
Request Model:
class SignatureDetailsReq
{
//Base64 encoded Pdf file to be signed
public byte[] PdfData;
public string PasswordIfProtectDocument;
public bool ValidateSignatures;
public bool GetCertificatesInSignature; //If ValidateSignatures is True
public bool VerifyCertificate; //If ValidateSignatures is True
public bool GetVerifyCertChain; //If VerifyCertificate is True
}
Response Model:
//Signature Details of Signature in PDF File
class SignatureDetails
{
//Signature Field Name
public string SignatureFieldName { get; set; }
//Signed on Page No.
public int PageNo { get; set; }
//Contact Info
public string ContactInfo { get; set; }
//Location Info
public string LocationInfo { get; set; }
//Reason
public string Reason { get; set; }
//Signed By as per Subject Name (names based on their distinguished name)
public string SignedBy { get; set; }
//Signature/Signed Date
public DateTime SignedDate { get; set; }
//Certificate Subject Country
public string SubjectCountry { get; set; }
//Certificate Subject Organization
public string SubjectOrganization { get; set; }
//Certificate Issuer Name
public string IssuerName { get; set; }
//Certificate Issuer Organization
public string IssuerOrganization { get; set; }
//Certificate Issuer Country
public string IssuerCountry { get; set; }
//Certificate Valid From
public DateTime ValidFrom { get; set; }
//Certificate Valid To
public DateTime ValidTo { get; set; }
//Signature Validation Detail Info
public SignatureValidationResult SignatureValidationInfo { get; set; }
}
class SignatureValidationResult
{
//List of certificates in the signature
public string Certificates { get; set; }
//CMS, CADES
public string CryptographicStandard { get; set; }
//Value to check whether the signature is certificated or not
public bool IsCertificated { get; set; }
//Value to check whether the document is modified or not
public bool IsDocumentModified { get; set; }
//Value to check whether the signature is valid or not
public bool IsSignatureValid { get; set; }
//Gets the signature algorithm used
public string SignatureAlgorithm { get; set; }
//Gets the name of the signature field.
public string SignatureFieldName { get; set; }
public List<string> SignatureValidationErrors { get; set; }
public TimeStampInfo TimeStampInformation { get; set; }
//Gets the resultant data of certificate revocation validation.
public VerifyCertResult CertVerificationResult { get; set; }
public class TimeStampInfo
{
//Checks if the timestamp is valid or not
public bool IsValid { get; set; }
//Gets the timestamp time
public DateTime Time { get; set; }
//Gets the timestamp policy ID
public string TimeStampPolicyId { get; set; }
}
public class VerifyCertResult
{
public bool CertValid { get; set; }
public List<X509CertChainStatus> ChainStatus { get; set; }
public List<string> B64CertChain { get; set; }
}
public class X509CertChainStatus
{
public string Status { get; set; }
public string StatusInformation { get; set; }
}
}
Sample Response Json for Valid Signature:
[
{
"SignatureFieldName": "SDSignature1",
"PageNo": 1,
"ContactInfo": "",
"LocationInfo": "Nagpur",
"Reason": "signer.digital.demo",
"SignedBy": "Class 3 individual test",
"SignedDate": "2021-07-02T12:16:45",
"SubjectCountry": null,
"SubjectOrganization": null,
"IssuerName": "e-Mudhra Sub CA for Class 3 Individual 2014",
"IssuerOrganization": null,
"IssuerCountry": null,
"ValidFrom": "2019-01-31T15:10:08+05:30",
"ValidTo": "2022-01-30T15:10:08+05:30",
"SignatureValidationInfo": {
"Certificates": null, // //or [<list of certificates if called with request parm IncludeCertificates = true>]
"CryptographicStandard": "CMS",
"IsCertificated": false,
"IsDocumentModified": false,
"IsSignatureValid": true,
"SignatureAlgorithm": "RSA",
"SignatureFieldName": "SDSignature1",
"SignatureValidationErrors": null,
"TimeStampInformation": null,
"CertVerificationResult": {
"CertValid": true,
"ChainStatus": [],
"B64CertChain": null
}
}
}
]
Sample Response Json for Signature using Revoked Certificate:
[
{
"SignatureFieldName": "Signature2",
"PageNo": 1,
"ContactInfo": "",
"LocationInfo": "",
"Reason": "",
"SignedBy": "BHARAT KISHOR VASANT",
"SignedDate": "2021-08-18T18:16:54",
"SubjectCountry": null,
"SubjectOrganization": null,
"IssuerName": "PantaSign CA 2014",
"IssuerOrganization": null,
"IssuerCountry": null,
"ValidFrom": "2021-07-20T12:37:34+05:30",
"ValidTo": "2023-07-20T12:37:34+05:30",
"SignatureValidationInfo": {
"Certificates": null, //or [<list of certificates if called with request parm IncludeCertificates = true>]
"CryptographicStandard": "CMS",
"IsCertificated": false,
"IsDocumentModified": false,
"IsSignatureValid": false,
"SignatureAlgorithm": "RSA",
"SignatureFieldName": "Signature2",
"SignatureValidationErrors": [ "The certificate is considered invalid because it has been revoked as verified using CRL that was embedded in the document " ],
"TimeStampInformation": null,
"CertVerificationResult": {
"CertValid": false,
"ChainStatus": [
{
"Status": "Revoked",
"StatusInformation": "The certificate is revoked."
}
],
"B64CertChain": null
}
}
}
]
---------------