PDF Signature: Hide CN from PFX but Show Timestamp and Date on Signature Appearance

Hi Aspose team,

I’m using the POST /pdf/{name}/sign API to digitally sign a PDF file with a .pfx certificate. Here’s the request I’m sending via curl:

bash

CopyEdit

curl --location 'https://api.aspose.cloud/v3.0/pdf/file333.pdf/sign' \
--header 'authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
  "SignaturePath": "fred.pfx",
  "FormFieldName": "sign1",
  "SignatureType": "PKCS7",
  "ShowDate": true,
  "Password": "apples",
  "Appearance": "rajat_sign.png",
  "Reason": "reason",
  "Visible": true,
  "Rectangle": {
    "LLX": 148,
    "LLY": 456,
    "URX": 29,
    "URY": 541
  },
  "ShowProperties": false
}'

Issue:

  • I want to display the signing date and timestamp.
  • I do not want to show the CN=fred (the name in the .pfx file).
  • When I set "ShowProperties": false, the date/time does not show either.
  • If I set "ShowProperties": true, then the CN=fred appears, which I don’t want to show.

Hi, @sidharth.chauhan
Are the signature fields displayed in the properties window?

Yes, the CN=fred is visibly displayed on the page itself inside the signature appearance box

Screenshot 2025-06-19 at 8.22.47 PM.png (327.5 KB)

@sidharth.chauhan , this is currently not supported. The digital subject name is always displayed, but you can manipulate other fields using the CustomAppearance field Aspose.Pdf Cloud - API References

@sidharth.chauhan
Im report issue and logged the following ticket in our issue tracking system for further investigation and rectification. We will notify you as soon as these issues are resolved.

PDFCLOUD-5030 Add possibility to hide subject field in signature appearance.

thanks for considering this , please let me know after release

Hello ,
Can you please share update on PDFCLOUD-5030

@sidharth.chauhan
the update will be coming soon, i will notify you as soon as the update is released

@sidharth.chauhan
The issues you have found earlier (filed as PDFCLOUD-5030) have been fixed in this version 25.7. Please update your client SDK, you will find new properties for CustomAppearance:

curl --location 'https://api.aspose.cloud/v3.0/pdf/file333.pdf/sign' \
--header 'authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
  "SignaturePath": "fred.pfx",
  "FormFieldName": "sign1",
  "SignatureType": "PKCS7",
  "ShowDate": true,
  "Password": "apples",
  "Appearance": "rajat_sign.png",
  "Reason": "reason",
  "Visible": true,
  "Rectangle": {
    "LLX": 148,
    "LLY": 456,
    "URX": 29,
    "URY": 541
  },
  "ShowProperties": true,
  "CustomAppearance": {
    "DateSignedAtLabel":"date",
    "UseDigitalSubjectFormat":true,
    "DigitalSubjectFormat":[]
  }
}'

Can i pass the custom string like , Digitally signed by “username”?

Can you please share what i can add in DigitalSubjectFormat @kirill.novinskiy

@sidharth.chauhan
Please check api doc aspose-pdf-cloud-dotnet/docs/SignatureCustomAppearance.md at master · aspose-pdf-cloud/aspose-pdf-cloud-dotnet · GitHub and aspose-pdf-cloud-dotnet/docs/SignatureSubjectNameElements.md at master · aspose-pdf-cloud/aspose-pdf-cloud-dotnet · GitHub

Hello @kirill.novinskiy ,
I need one more help making my signature more customized. I want the date format to be DD/MM/YYYY instead of MM/DD/YYYY, and in the timestamp, I only want HH:MM (no seconds).

@sidharth.chauhan
Could you share some sample code to reproduce the issue? What SDK are you using? We’ll be happy to assist you further.

AM using api in nodejs project

const url = ${baseUrl}/${document.documentTitle}/sign?folder=${folderName};
const headers = { ‘Content-Type’: ‘application/json’ };

    const pixelX = (field.xPosition / 100) * document.originalWidthInPx;
    const pixelY = (field.yPosition / 100) * document.originalHeightInPx;
    const pixelWidth = (field.width / 100) * document.originalWidthInPx;
    const pixelHeight = (field.height / 100) * document.originalHeightInPx;
    
    const LLX = pixelX;
    const LLY = document.originalHeightInPx - (pixelY + pixelHeight);
    const URX = pixelX + pixelWidth;
    const URY = document.originalHeightInPx - pixelY;
    
    const body = {
      FormFieldName: field.id,
      SignaturePath: config.getConfig('PFX_FILE_PATH'),
      SignatureType: "PKCS7",
      Password: password,
      Appearance: signaturePathInFileShare,
      Visible: true,
      ShowProperties: true,
      Rectangle: { LLX, LLY, URX, URY },
      ValidationSettings: {
        VerifySignature: true,
        ShowValidationInfo: false,
        ShowCertificateChain: false
      },
       CustomAppearance: {
        DateSignedAtLabel: "Date",
        UseDigitalSubjectFormat: true,
        DigitalSubjectFormat: [] // Empty array as per Aspose PDF Cloud v25.7
      }
    };
    
    const response = await axios({
      method: 'POST',
      url,
      headers,
      data: body,
      timeout: 30000
    });

@sidharth.chauhan
Please write an example of the sign properties output that you want to use so that we can write sample code.

image123.png (30.8 KB)
This is current situation.
I want the date format to be DD/MM/YYYY instead of MM/DD/YYYY , and in the timestamp, I only want HH:MM (no seconds).

@sidharth.chauhan Please try this:

Am using the same properties which you suggest still getting previous signature in DD/MM/YYYY and HH:MM:SS .

    const body = {
      FormFieldName: field.id,
      SignaturePath: config.getConfig('PFX_FILE_PATH'),
      SignatureType: "PKCS7",
      Password: password,
      Appearance: signaturePathInFileShare,
      Visible: true,
      ShowProperties: true,
      Rectangle: { LLX, LLY, URX, URY },
      ValidationSettings: {
        VerifySignature: true,
        ShowValidationInfo: false,
        ShowCertificateChain: false
      },
       CustomAppearance: {
        DateSignedAtLabel: "Date",
        DateTimeFormat: "dd/MM/yyyy HH:MM",
        UseDigitalSubjectFormat: true,
        DigitalSubjectFormat: []
      }
    };
    
    const response = await axios({
      method: 'POST',
      url,
      headers,
      data: body,
      timeout: 30000
    });

@sidharth.chauhan
Sorry, in your case you should use DateTimeLocalFormat field for date format: