IsPDFFileEncrypted Deprecated

Checks whether the PDF file is encrypted.

python · Common Scripts

Details

IDIsPDFFileEncrypted
Languagepython
From Version6.5.0
Docker Imagedemisto/readpdf:1.0.0.2034953
TagsUtility Condition

README

Checks whether the PDF file is encrypted.

Script Data


Name Description
Script Type python3
Tags Utility, Condition
Cortex XSOAR Version 6.5.0

Inputs


Argument Name Description
EntryID The entry ID of the PDF file.

Outputs


There are no outputs for this script.

from IsPDFFileEncrypted import is_pdf_encrypted


def test_is_pdf_encrypted():
    encrypted_path = "./test_data/encrypted.pdf"
    unencrypted_path = "./test_data/text-only.pdf"
    assert is_pdf_encrypted(encrypted_path)
    assert not is_pdf_encrypted(unencrypted_path)