Return-Path: X-Original-To: apmail-xmlgraphics-commits-archive@www.apache.org Delivered-To: apmail-xmlgraphics-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8D83EDD7F for ; Sat, 18 May 2013 23:11:41 +0000 (UTC) Received: (qmail 32305 invoked by uid 500); 18 May 2013 23:11:41 -0000 Mailing-List: contact commits-help@xmlgraphics.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: general@xmlgraphics.apache.org Delivered-To: mailing list commits@xmlgraphics.apache.org Received: (qmail 32297 invoked by uid 99); 18 May 2013 23:11:41 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 18 May 2013 23:11:41 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 18 May 2013 23:11:39 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id F07B123889DA for ; Sat, 18 May 2013 23:11:19 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: svn commit: r862384 - in /websites/staging/xmlgraphics/trunk/content: ./ fop/trunk/pdfencryption.html Date: Sat, 18 May 2013 23:11:19 -0000 To: commits@xmlgraphics.apache.org From: buildbot@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130518231119.F07B123889DA@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: buildbot Date: Sat May 18 23:11:19 2013 New Revision: 862384 Log: Staging update by buildbot for xmlgraphics Modified: websites/staging/xmlgraphics/trunk/content/ (props changed) websites/staging/xmlgraphics/trunk/content/fop/trunk/pdfencryption.html Propchange: websites/staging/xmlgraphics/trunk/content/ ------------------------------------------------------------------------------ --- cms:source-revision (original) +++ cms:source-revision Sat May 18 23:11:19 2013 @@ -1 +1 @@ -1470514 +1484198 Modified: websites/staging/xmlgraphics/trunk/content/fop/trunk/pdfencryption.html ============================================================================== --- websites/staging/xmlgraphics/trunk/content/fop/trunk/pdfencryption.html (original) +++ websites/staging/xmlgraphics/trunk/content/fop/trunk/pdfencryption.html Sat May 18 23:11:19 2013 @@ -353,7 +353,7 @@ $(document).ready(function () {

Apache™ FOP: PDF encryption.

Overview

-

Apache™ FOP supports encryption of PDF output, thanks to Patrick C. Lankswert. This feature is commonly used to prevent unauthorized viewing, printing, editing, copying text from the document and doing annotations. It is also possible to ask the user for a password in order to view the contents. Note that there already exist third party applications which can decrypt an encrypted PDF without effort and allow the aforementioned operations, therefore the degree of protection is limited.

+

Apache™ FOP supports encryption of PDF output, thanks to Patrick C. Lankswert and others. This feature is commonly used to prevent unauthorized viewing, printing, editing, copying text from the document and doing annotations. It is also possible to ask the user for a password in order to view the contents. Note that there already exist third party applications which can decrypt an encrypted PDF without effort and allow the aforementioned operations, therefore the degree of protection is limited.

For further information about features and restrictions regarding PDF encryption, look at the documentation coming with Adobe Acrobat or the technical documentation on the Adobe web site.

Usage (fop.xconf)

<renderer mime="application/pdf">
@@ -365,6 +365,7 @@ $(document).ready(function () {
         <noedit/>
         <noannotations/>
         <encryption-length>128</encryption-length>
+        <encrypt-metadata>false</encrypt-metadata>
     </encryption-params>
 </renderer>
 
@@ -433,8 +434,8 @@ $(document).ready(function () { encryption-length The encryption length in bit -Any multiple of 8 between 40 and 128 -40 +Any multiple of 8 between 40 and 128, or 256 +128 ownerPassword @@ -496,6 +497,12 @@ $(document).ready(function () { "TRUE" or "FALSE" "TRUE" + +encrypt-metadata +Whether to encrypt the Metadata stream +"TRUE" or "FALSE" +"TRUE" +

Encryption is enabled as soon as one of these options is set.

@@ -506,7 +513,7 @@ $(document).ready(function () { FOUserAgent userAgent = fopFactory.newFOUserAgent(); useragent.getRendererOptions().put("encryption-params", new PDFEncryptionParams( - null, "password", false, false, true, true)); + null, "password", false, false, true, true, true)); Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, userAgent); [..]
@@ -544,6 +551,9 @@ $(document).ready(function () {
  • allowPrintHq: true if printing to high quality is allowed

  • +
  • +

    encryptMetadata: true if the Metadata stream should be encrypted

    +
  • Alternatively, you can set each value separately in the Map provided by FOUserAgent.getRendererOptions() by using the following keys:

      @@ -577,29 +587,12 @@ $(document).ready(function () {
    1. noprinthq: Boolean or "true"/"false"

    2. -
    -

    Environment

    -

    In order to use PDF encryption, FOP has to be compiled with cryptography support. Currently, only JCE is supported. JCE is part of JDK 1.4. For earlier JDKs, it can be installed separately. The build process automatically detects JCE presence and installs PDF encryption support if possible, otherwise a stub is compiled in.

    -

    Cryptography support must also be present at run time. In particular, a provider for the RC4 cipher is needed. Unfortunately, the sample JCE provider in Sun's JDK 1.4 does not provide RC4. If you get a message saying -"Cannot find any provider supporting RC4" -then you don't have the needed infrastructure.

    -

    There are several commercial and a few Open Source packages which provide RC4. A pure Java implementation is produced by The Legion of the Bouncy Castle. Mozilla JSS is an interface to a native implementation.

    -

    Installing a crypto provider

    -

    The pure Java implementation from Bouncy Castle is easy to install.

    -
      -
    1. -

      Download the binary distribution for your JDK version.

      -
    2. -

      Unpack the distribution. Add the jar file to your classpath. A convenient way to use the jar on Linux is to simply drop it into the FOP lib directory, it will be automatically picked up by fop.sh.

      -
    3. -
    4. -

      Open the java.security file and add

      -

      security.provider.6=org.bouncycastle.jce.provider.BouncyCastleProvider,

      -

      preferably at the end of the block defining the other crypto providers. For JDK 1.4 this is detailed on Sun's web site.

      +

      encrypt-metadata: Boolean or "true"/"false"

    -

    If you have any experience with Mozilla JSS or any other cryptography provider, please post it to the fop-user list.

    +

    Environment

    +

    The PDF encryption implemented in FOP does not need external libraries to perform encryption. A recent JDK (1.5+) is sufficient. However, encryption using keys with 256 bits requires the installation of the JCE Unlimited Strength Jurisdiction Policy files from Oracle.

    --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscribe@xmlgraphics.apache.org For additional commands, e-mail: commits-help@xmlgraphics.apache.org