Yes, but not natively. There are many command line PDF tools out there. I use PDF Tool Kit (PDFTK). So you would EXPORT your document to a file then use EXECUTE_PROGRAM to run the command line action. You will have to audition various PDF tools for the features you need. Here is a sample command for PDFTK:
/* Encrypt a PDF using 128-bit strength (the default), withhold all permissions (the default)
EXECUTE_PROGRAM C:\ProgramFiles (x86) pdftk MyFile.pdf output Myfile_EnCrypt.pdf owner_pw MyPassword
You may have to also declare a user-specific directory for files depending on your config.