With Aloaha only one function call is required to look up the recipients certificates from the remote PKI and to encrypt the document.
Please find below the function call in pseudo syntax:
encrypt_pdf_by_LDAP(ByVal LDAP_ConnectionString As String, ByVal PathToFileToBeEncrypted As String, ByVal PathToEncryptedFile As String, ByVal LDAPSearchString As String, ByVal CertIntendedKeyUsage As Long, ByVal CertEnhancedKeyUsage As String, ByVal NoOverwrite As Boolean) As String
This variable contains the connection string to the remote server.
The syntax is: <server>/<container>
PathToFileToBeEncrypted Contains the path to the PDF document to be encrypted.
Contains the path to the destination file.
Contains a comma seperated list of keywords. The * wildcard is allowed as first or last characters of a keyword. A search string to encrypt the document for all johns, smith and firstname.lastname@example.org would look like:
john*, *smith, email@example.com
CertIntendedKeyUsage Technically it is possible to use any certificate to encrypt the document. But the Adobe Reader checks the key usage of the certificate before it starts decrypting. It would not open a PDF document which was encrypted with a signature only certificate. To make sure that Aloaha uses only correct certificates this variable can be set to the required key usage. If the variable is set to 0 Aloaha does not cross check the key usage of the certifiates.
Aloaha can also filter the certicates by EnhancedKeyUsage (EKU) attributes. Like that it is possible to force the API to use only filesystem encryption certificates. If this variable is left as an empty string Aloaha will not check for the EKU attributes.
Defines if a possilbe existing target file can be overwritten or not.
The function returns a string value which either contains success and subject contents of the certifiates used for encryption or in case of an error it contains the error description.
Below you find a code sample. Please make sure that Aloaha is properly licensed. Should you require an evaluation license please do not hesitate to contact firstname.lastname@example.org
VBS Code Sample: