Return-Path: X-Original-To: apmail-pdfbox-users-archive@www.apache.org Delivered-To: apmail-pdfbox-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 73EB2CE4D for ; Sun, 7 Jul 2013 02:14:09 +0000 (UTC) Received: (qmail 68446 invoked by uid 500); 7 Jul 2013 02:14:08 -0000 Delivered-To: apmail-pdfbox-users-archive@pdfbox.apache.org Received: (qmail 68410 invoked by uid 500); 7 Jul 2013 02:14:08 -0000 Mailing-List: contact users-help@pdfbox.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@pdfbox.apache.org Delivered-To: mailing list users@pdfbox.apache.org Received: (qmail 68402 invoked by uid 99); 7 Jul 2013 02:14:07 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 07 Jul 2013 02:14:07 +0000 X-ASF-Spam-Status: No, hits=2.8 required=5.0 tests=HTML_IMAGE_ONLY_24,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,T_REMOTE_IMAGE X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of jeremyvillalobos@gmail.com designates 209.85.212.42 as permitted sender) Received: from [209.85.212.42] (HELO mail-vb0-f42.google.com) (209.85.212.42) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 07 Jul 2013 02:14:03 +0000 Received: by mail-vb0-f42.google.com with SMTP id i3so2587410vbh.29 for ; Sat, 06 Jul 2013 19:13:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=pdBbJwRB5rUdCPF5H3rSiin8qc3r8segIrLkPe2HuJo=; b=Otj/7/2FYUXLN60koyrOXAhmWnI7hu07OOHYSpx9TOB5mscnnkGutiJsK6WDHM08NO QPwzLwnzjS3Jz+yt1kU/8U+zaFx0T6jHMrQ/qakfY/e4QjBsxCbxxBz2BnpB25tqY4A5 srri9B1QbVngYpz0h+GvjOuu1ARx3a9Ku5/0AK7KiKGzHLDw26aBNwvoYYpLNBpsXw6F W+W+xSzy3bJpoUJpQtV2wCdIOgGQvGWfNUvFUcq7WoSNs8j+oSSyCv2kNX6J3/FHyBpm eT3bUJfJIQhkCfdCVBX85msGt4/WUKOrWKLQB9mph8FS8EidC7Z5+GBP54u4y7rew5V/ 4eCw== MIME-Version: 1.0 X-Received: by 10.52.92.16 with SMTP id ci16mr8875283vdb.88.1373163222482; Sat, 06 Jul 2013 19:13:42 -0700 (PDT) Received: by 10.52.178.66 with HTTP; Sat, 6 Jul 2013 19:13:42 -0700 (PDT) Date: Sat, 6 Jul 2013 22:13:42 -0400 Message-ID: Subject: Encrypt Pdf using a X.509 certificate From: Jeremy Villalobos To: users@pdfbox.apache.org Content-Type: multipart/alternative; boundary=20cf307d064818488304e0e27a79 X-Virus-Checked: Checked by ClamAV on apache.org --20cf307d064818488304e0e27a79 Content-Type: text/plain; charset=ISO-8859-1 I googled for a tutorial on using a x.509 certificate to encrypt a pdf. But I did not find any good source. What is the benefit of using an X.509 certificate version using owner/user passwords ? I used a self-signed certificate created with openssl. I got this error: Encrypt failed with the following exception: org.apache.pdfbox.exceptions.COSVisitorException: 1.2.840.113549.3.2 KeyGenerator not available at org.apache.pdfbox.pdfwriter.COSWriter.write(COSWriter.java:1347) at org.apache.pdfbox.pdmodel.PDDocument.save(PDDocument.java:1157) at org.apache.pdfbox.pdmodel.PDDocument.save(PDDocument.java:1138) at org.apache.pdfbox.Encrypt.encrypt(Encrypt.java:189) at org.apache.pdfbox.Encrypt.main(Encrypt.java:53) at org.apache.pdfbox.PDFBox.main(PDFBox.java:40) org.apache.pdfbox.exceptions.CryptographyException: 1.2.840.113549.3.2 KeyGenerator not available at org.apache.pdfbox.pdmodel.encryption.PublicKeySecurityHandler.prepareDocumentForEncryption(PublicKeySecurityHandler.java:364) at org.apache.pdfbox.pdfwriter.COSWriter.write(COSWriter.java:1338) at org.apache.pdfbox.pdmodel.PDDocument.save(PDDocument.java:1157) at org.apache.pdfbox.pdmodel.PDDocument.save(PDDocument.java:1138) at org.apache.pdfbox.Encrypt.encrypt(Encrypt.java:189) at org.apache.pdfbox.Encrypt.main(Encrypt.java:53) at org.apache.pdfbox.PDFBox.main(PDFBox.java:40) Am I missing a dependency (bouncy castle perhaps ) or am I using the wrong certificate ? Thanks -- Jeremy Villalobos Practical Android Apps http://www.practicalandroidapps.com/ --20cf307d064818488304e0e27a79--