Certificate based PDF Encryption API
The Aloaha PDF Crypter API can be used for certificate based encryption. The PDF is encrypted with the public key of the user(s) certificate(s). Only the holder of the right private key/certificate will be able to open/view the PDF document in his free Adobe Reader. This is the ideal solution for confidential documents or ebook stores. It is also frequently used for SOX compliance!
To enable the Aloaha PDF Crypter API the Aloaha PDF Suite Enterprise Professional License is required!
Please make sure to copy the license or evaluation license into the key and crypterkey directory!
Please find below a sample VBS code to demonstrate how easy the API is to use.
Dim crypter
Dim pdfstring
'create crypter object
Set crypter=CreateObject("aloahapdf.edit")
'add public keys of recipients. More than one public key is allowed!
Call crypter.add_recipient("c:\enc\public.cer")
Call crypter.add_recipient("c:\enc\ceo.cer")
'read PDF document to be encrypted from File
pdfstring=crypter.ReadStringFromFile("c:\enc\original.pdf")
'call certificate based PDF encryption
pdfstring=crypter.encrypt_pdf_string(CStr(pdfstring))
If pdfstring<>"" Then
'write encrypted PDF to disk
pdfstring=crypter.WriteStringToFile("c:\enc\ebook.pdf",CStr(pdfstring),false)
End If
Set crypter=nothing
Aloaha Software / Knowledge Base / PDF SDK / PDF Encryption API