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


Please ask...

Although we really tried hard, there are always questions left open. But perhaps somebody else had already put the same question?
Please check!
  • Why your sample code keeps to use 100% CPU time for over 11 hours at crypter.encrypt_pdf_string function call? (I am using the aloaha.cer as public key with suite_sdk),
    That is definetly not a normal behavior. I suggest you either try a different machine or send us the code you are using so we check it for errors.
    Answered 23.04.2010
  • is it possible to use key published in Active directory? All users normaly have their public keys published in AD.
If not, please do not hesitate to send us your question.
We would be glad to answer it.
PDF SDKPDF Signature APICertificate PropertiesSample CodeText StampsPDF AttachmentsImage 2 PDFPDF to Multipage TIFFAppend PDFInsert Blank PageRender ImageStamp PDF with PDFDraw PDF as LetterheadApply LetterheadPDF BackgroundsAdd NotesURL HotspotSecure PDF ViewerPDF OptimizerPDF Encryption APIc# crypto sample40/128 Bit encryptionLDAP/Active Directory EncryptionLDAP encryption SamplePDF Printing APIPDF BookmarksPDF BarcodingMerge PDF DocumentsSample APIsResize PDFCrop PDF PagePDF InformationPDF2TXTNormalize PagesDirect PDF ConversionPDF Form Saver SDKSmart Card APIAloaha Web ServicesAloaha Print MonitorAloaha Remote ConfigurationWebDAVLDAP ClientProgramming Office MacrosIIS Event Sinks