Our customer Matthew Ciantar supplied us with an excellent C# sample package. This sample demonstrates how to use our Aloaha APIs in C#. Please see the source code below. At the bottom of this page you can also download the files.
This sample will work only with a valid evaluation key. Please contact aloaha@wrocklage.de for such a key!
/*
* This command line applications uses Aloaha PDF Crypter
* to encrypt a PDF File with a given Public Key (Cer File).
*
* Author: Matthew Ciantar
* Date: 2006/01/20
*
* License for the Aloaha PDF Crypter is required
* Evaluation of API works without valid License
*
**/
using System;
using System.IO;
using System.Reflection;
namespace PDFCrypterTool
{
class Crypter
{
static void Main(string[] args)
{
if (args.Length == 3)
{
// Store Arguments in Local Variables
string CertificateFilePath = args[0];
string PDFSourceFilePath = args[1];
string PDFDestinationFilePath = args[2];
// Check existance of Certificate and Source File
if (File.Exists(CertificateFilePath) && File.Exists(PDFSourceFilePath))
{
Type aloahapdf = Type.GetTypeFromProgID("aloahapdf.edit");
object aloahapdfLateBound = Activator.CreateInstance(aloahapdf);
Although we really tried hard, there are always questions left open. But perhaps somebody else had already put the same question? Please check!
Is it possible to encrypt with certificate using the AES algorithm? Could you provide a sample?
Currently that is not possible. But in case you really need it you can send a feature request to info@aloaha.com
Answered 23.04.2010
Is it possible to encrypt with certificate using the AES algorithm? Could you provide a sample?
Currently that is not possible. But in case you really need it you can send a feature request to info@aloaha.com
Answered 23.04.2010
Is it possible to restrict all permissions (including content copying and page extraction) on a pdf that has been encrypted using a certificate? Could you provide sample code?
No, that is currently not possible. Certificate encryption does not protect the content itself. In fact it is pretty useless. Content protection is just a flag in the PDF. So who has the right private key can always change that flag. On the other hand who does NOT has the private key does not need content protection since that user would not even able to decrypt the PDF itself.
Answered 23.04.2010
Hi,
It is possible to use the api to decrypt pdf files? Or the api is only for encrypt?
This API is only to encrypt PDF documents. In case there is a business case we can always create you an API to decrypt PDF files.
Answered 23.02.2009
If not, please do not hesitate to send us your question. We would be glad to answer it.