PDF signature with PDF gives wrong format error

I am experiencing an error when trying to sign a PDF document using a .pfx certificate through your API tester:

https://reference.groupdocs.cloud/signature/#/Sign/CreateSignatures

The signing operation fails with the following response:

“error”: {
“code”: “internalError”,
“message”: “Sign document error: Digital certificate for ExternalSignature has wrong format. Description: Object reference not set to an instance of an object.”,
“description”: “Operation Failed. Internal error.”,
“dateTime”: “2025-06-02T14:54:03.9285029Z”
}

I have tried this using both a test certificate and an official digital identification certificate, but the same error occurs in both cases.

The .pfx file is successfully uploaded to cloud storage and referenced correctly in the certificateFilePath field of the request. Could you please clarify what certificate format or requirements are expected by your system to perform a digital signature?

Thank you in advance for your help.

@ale.S

Could you please clarify what specific certificate format or requirements are expected by your system to perform a digital signature?

My goal is to digitally sign PDFs with digital certificates (.pfx or .p12) as I would do manually with Adobe PDF Reader, but through API.

Hi, I have found your request in logs, and I see that you have not specified pfx file path in request options. Here is your request settings:

{
  "signSettings": {
    "Options": [
      {
        "Reason": null,
        "Contact": null,
        "Location": null,
        "Visible": false,
        "Password": null,
        "CertificateFilePath": null,
        "XAdESType": "None",
        "DigitalVBA": null,
        "SignTime": null,
        "Comments": null,
        "ImageFilePath": null,
        "Left": 100,
        "Top": 100,
        "Width": 200,
        "Height": 50,
        "LocationMeasureType": "Pixels",
        "SizeMeasureType": "Pixels",
        "RotationAngle": 0,
        "HorizontalAlignment": "None",
        "VerticalAlignment": "None",
        "Margin": {
          "All": 0,
          "Left": 0,
          "Top": 0,
          "Right": 0,
          "Bottom": 0
        },
        "MarginMeasureType": "Pixels",
        "Transparency": 0,
        "Border": {
          "Style": "Solid",
          "Transparency": 0,
          "Weight": 0,
          "Color": null,
          "Visible": false
        },
        "Appearance": null,
        "SignatureType": "Digital",
        "Page": 1,
        "AllPages": false,
        "PagesSetup": null
      }
    ],
    "SaveOptions": {
      "OverwriteExisting": false,
      "OutputFilePath": "pruebaAPI_firmado.pdf",
      "SaveFormat": null
    },
    "FileInfo": {
      "FilePath": "pruebaAPI.pdf",
      "StorageName": null,
      "VersionId": null,
      "Password": null
    }
  }
}

Here is right settings example (please adjust it with correct input file path, certificate path, and cert password):

{
  "FileInfo": {
    "FilePath": "BENJAMIN_signed.pdf"
  },
  "Options": [
    {
      "SignatureType": "Digital",
      "CertificateFilePath": "Additional/SherlockHolmes.pfx",
      "Password": "1234567890"
    }
  ],
  "SaveOptions": {
    "OutputFilePath": "BENJAMIN_signed1.pdf"
  }
}