Fetch pdf info on digitally signed pdf like signer name , issuer certificate and field name

We produce digitally signed pdf, There is section where end user can verify his signature by provide digital signed document.

We want to fetch digital signature information for this document to display like- Signer certificate details , issuer certificate details . signing reason, name , location , field name of signature and all other to display to user.

Please let me know how I can do this using Aspose.

@cyginfo

You can set these properties while signing PDF documents and extract image and other signature information using the API.

We further need to investigate these requirements of yours. Would you kindly share your sample PDF document with us so that we can test the scenario in our environment and address it accordingly.

Thanks, We used your suggested and able to see properties but I not understand the property name in which signature properties are getting bind.
Please see attached screenshot of attached pdf.
Properties.jpg (74.2 KB)
DSC Signed .Pdf (1.1 MB)

I have highlighted area of properties name, I cannot understand , For example signing date is written against some unreadable property. Do you have any enum list of same with property name and it’s meaning. If you have any then please provide same.

@cyginfo

Would you please share the password of Certificate file that was used to sign the PDF which you have shared.

Please let us know why password is required? As properties will be anyways visible if you open in adobe to see in signature details.

@cyginfo

We wanted to extract the Certificate from your PDF document and use a valid PKCS7 object in order to extract SignatureCustomAppearance. Nevertheless, we noticed that no certificate was found in your PDF using the code snippet.
We were able to extract signature however and its other properties can be seen as well e.g. Location, Date, Reason.

using (Document pdfDocument = new Document(dataDir + "DSC Signed.pdf"))
{
 foreach (Field field in pdfDocument.Form)
 {
  SignatureField sf = field as SignatureField;
  if (sf != null)
  {
    Signature s = sf.Signature;
    var date = s.Date;
    var location = s.Location;
    var reason = s.Reason;
    SignatureCustomAppearance signatureapp = s.CustomAppearance; //  this is null because no customer appearance was used while signing the PDF
    Stream cerStream = sf.ExtractCertificate(); // this is null
    PKCS7 pKCS7 = new PKCS7(cerStream, ""); //  this is null
   }
 }
}

Would you kindly provide details of the certificate using which this PDF was signed. We will further investigate the scenario why API is unable to extract it and share our feedback with you.

Thanks for quick response. With given code we are able to extract date, reason and location. Still Certificate details, issuer details and field name is not extracted.

I will not to be able to share password but Certificate is from Indian certification authority - Safe scrypt CA - They provide hardware token with DSC in it. Link for same : (https://www.safescrypt.com/)

Please let me know in case something more required.

@cyginfo

We have logged an investigation ticket as PDFNET-48511 in our issue tracking system for your remaining requirements. We will further investigate whether your requirements are feasible to achieve with shared document or not and keep you posted with the status of ticket resolution. Please be patient and spare us some time.

We are sorry for the inconvenience.

@cyginfo

We have made some changes in 21.9v of the API, and this code

Stream cerStream = sf.ExtractCertificate(); // this is null
PKCS7 pKCS7 = new PKCS7(cerStream, ""); //  this is null

Does not return null.

Now we can only extract this kind (ETSI.CAdES.detached) of Certificate. Please specify what kind of information cannot be obtained at the moment.