Skip to main content

pdf-security-info


Use the pdf-security-info endpoint to upload a PDF document and return JSON describing the PDF's security and encryption information.

The pdf-security-info endpoint provides information about security and encryption present in an existing PDF. It takes a PDF as input and returns the security information as JSON (encryption details).

The returning JSON returns the values for the following properties. PDFs without a property value returns a null as the property's value. The endpoint returns the following security information as JSON:

  • hasOwnerPassword
  • hasUserPassword
  • allowPrint
  • allowEdit
  • allowCopy
  • allowUpdateAnnotsAndFields.

For RC4 40-bit, RC4 128-bit, AES-128, and AES-256 encryption the following properties are also returned:

  • allowDocumentAssembly
  • allowAccessibility
  • allowFormFilling
  • allowHighResolutionPrinting.

And for AES-128 and AES-256 encryption the following two additional properties are returned:

  • encryptAllExceptMetadata
  • encryptOnlyFileAttachments.

The encryptionType property returns one of the following values.

  • aes-128-cbc
  • aes-256-cbc
  • rc4-40
  • rc4-128
  • none

corresponding to

  • AES-128 encryption
  • AES-256 encryption
  • RC4 40-bit encryption
  • RC4 128-bit encryption, or
  • no security.
info

Refer to pdf-security-info in the Client Libraries Users Guide section for this example using the DynamicPDF API's client libraries.

   Follow us on social media for latest news!

Request/Response

RequestRequest DataResponse
POSTPDF as byte arrayJSON document containing metadata.

The pdf-security-info endpoint takes an HTTP POST form submission, where the PDF is sent as binary in the form's body.

POST https://api.dpdf.io/v1.0/pdf-security-info HTTP/1.1
Authorization: Bearer DP.xxx-your-api-key-xxx

Parameters

ParametersValueDescription
Header
Content-Typeapplication/pdfContent type sent in request.
AuthorizationBearer DP.xxx-your-api-key-xxxThe API key.REQUIRED
Request BodyType
BodybinaryThe PDF document to obtain information about.REQUIRED
important

The PDF is sent to the endpoint as binary data. In this example request, the binary is coming from a file, but it could also come from a URL, a database, or other source.

Run In Postman

Sample cURL Request

curl -X POST "https://api.dpdf.io/v1.0/pdf-security-info" 
-H "accept:application/json"
-H "Authorization: Bearer DP.xxx-your-api-key-xxx"
-H "Content-Type: application/pdf"
--data-binary "@C:/temp/security/aes128-sig-out.pdf"

Sample Response

{
"encryptionType": "aes-128-cbc",
"hasUserPassword": true,
"hasOwnerPassword": true,
"allowPrint": true,
"allowEdit": true,
"allowCopy": false,
"allowUpdateAnnotsAndFields": true,
"allowFormFilling": true,
"allowAccessibility": true,
"allowDocumentAssembly": false,
"allowHighResolutionPrinting": true,
"encryptAllExceptMetadata": false,
"encryptOnlyFileAttachments": false
}

Further Information

You can also use one of DynamicPDF's provided client libraries to integrate the endpoints into your client applications if you prefer. For more information, refer to the relevant Users Guide sections: