You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xmlgraphics.apache.org by bu...@apache.org on 2013/05/19 01:11:19 UTC

svn commit: r862384 - in /websites/staging/xmlgraphics/trunk/content: ./ fop/trunk/pdfencryption.html

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 () {
       	<div class="section-content"><h1 id="apachewzxhzdk2-fop-pdf-encryption">Apache&trade; FOP: PDF encryption.</h1>
 <p><authors><person email="pietsch@apache.org" name="J.Pietschmann"></person><person email="jeremias@apache.org" name="Jeremias Märki"></person></authors></p>
 <h2 id="Overview">Overview</h2>
-<p>Apache&trade; 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.</p>
+<p>Apache&trade; 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.</p>
 <p>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.</p>
 <h2 id="fopxconf">Usage (fop.xconf)</h2>
 <div class="codehilite"><pre><span class="nt">&lt;renderer</span> <span class="na">mime=</span><span class="s">&quot;application/pdf&quot;</span><span class="nt">&gt;</span>
@@ -365,6 +365,7 @@ $(document).ready(function () {
         <span class="nt">&lt;noedit/&gt;</span>
         <span class="nt">&lt;noannotations/&gt;</span>
         <span class="nt">&lt;encryption-length&gt;</span>128<span class="nt">&lt;/encryption-length&gt;</span>
+        <span class="nt">&lt;encrypt-metadata&gt;</span>false<span class="nt">&lt;/encrypt-metadata&gt;</span>
     <span class="nt">&lt;/encryption-params&gt;</span>
 <span class="nt">&lt;/renderer&gt;</span>
 </pre></div>
@@ -433,8 +434,8 @@ $(document).ready(function () {
 <tr>
 <td>encryption-length</td>
 <td>The encryption length in bit</td>
-<td>Any multiple of 8 between 40 and 128</td>
-<td>40</td>
+<td>Any multiple of 8 between 40 and 128, or 256</td>
+<td>128</td>
 </tr>
 <tr>
 <td>ownerPassword</td>
@@ -496,6 +497,12 @@ $(document).ready(function () {
 <td>"TRUE" or "FALSE"</td>
 <td>"TRUE"</td>
 </tr>
+<tr>
+<td>encrypt-metadata</td>
+<td>Whether to encrypt the Metadata stream</td>
+<td>"TRUE" or "FALSE"</td>
+<td>"TRUE"</td>
+</tr>
 </tbody>
 </table>
 <p><note>Encryption is enabled as soon as one of these options is set.</note></p>
@@ -506,7 +513,7 @@ $(document).ready(function () {
 
 <span class="n">FOUserAgent</span> <span class="n">userAgent</span> <span class="o">=</span> <span class="n">fopFactory</span><span class="o">.</span><span class="na">newFOUserAgent</span><span class="o">();</span>
 <span class="n">useragent</span><span class="o">.</span><span class="na">getRendererOptions</span><span class="o">().</span><span class="na">put</span><span class="o">(</span><span class="s">&quot;encryption-params&quot;</span><span class="o">,</span> <span class="k">new</span> <span class="n">PDFEncryptionParams</span><span class="o">(</span>
-    <span class="kc">null</span><span class="o">,</span> <span class="s">&quot;password&quot;</span><span class="o">,</span> <span class="kc">false</span><span class="o">,</span> <span class="kc">false</span><span class="o">,</span> <span class="kc">true</span><span class="o">,</span> <span class="kc">true</span><span class="o">));</span>
+    <span class="kc">null</span><span class="o">,</span> <span class="s">&quot;password&quot;</span><span class="o">,</span> <span class="kc">false</span><span class="o">,</span> <span class="kc">false</span><span class="o">,</span> <span class="kc">true</span><span class="o">,</span> <span class="kc">true</span><span class="o">,</span> <span class="kc">true</span><span class="o">));</span>
 <span class="n">Fop</span> <span class="n">fop</span> <span class="o">=</span> <span class="n">fopFactory</span><span class="o">.</span><span class="na">newFop</span><span class="o">(</span><span class="n">MimeConstants</span><span class="o">.</span><span class="na">MIME_PDF</span><span class="o">,</span> <span class="n">userAgent</span><span class="o">);</span>
 <span class="o">[..]</span>
 </pre></div>
@@ -544,6 +551,9 @@ $(document).ready(function () {
 <li>
 <p>allowPrintHq: true if printing to high quality is allowed</p>
 </li>
+<li>
+<p>encryptMetadata: true if the Metadata stream should be encrypted</p>
+</li>
 </ol>
 <p>Alternatively, you can set each value separately in the Map provided by FOUserAgent.getRendererOptions() by using the following keys:</p>
 <ol>
@@ -577,29 +587,12 @@ $(document).ready(function () {
 <li>
 <p>noprinthq: Boolean or "true"/"false"</p>
 </li>
-</ol>
-<h2 id="Environment">Environment</h2>
-<p>In order to use PDF encryption, FOP has to be compiled with cryptography support. Currently, only <a href="http://java.sun.com/j2se/1.4/docs/guide/security/jce/JCERefGuide.html">JCE</a> 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.</p>
-<p>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 <strong>not</strong> provide RC4. If you get a message saying
-"Cannot find any provider supporting RC4"
-then you don't have the needed infrastructure.</p>
-<p>There are several commercial and a few Open Source packages which provide RC4. A pure Java implementation is produced by <a href="http://www.bouncycastle.org/">The Legion of the Bouncy Castle</a>. <a href="http://www.mozilla.org/projects/security/pki/jss/">Mozilla JSS</a> is an interface to a native implementation.</p>
-<h2 id="install_crypto">Installing a crypto provider</h2>
-<p>The pure Java implementation from <a href="http://www.bouncycastle.org/">Bouncy Castle</a> is easy to install.</p>
-<ol>
-<li>
-<p>Download the binary distribution for your JDK version.</p>
-</li>
 <li>
-<p>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 <code>fop.sh</code>.</p>
-</li>
-<li>
-<p>Open the <code>java.security</code> file and add</p>
-<p><code>security.provider.6=org.bouncycastle.jce.provider.BouncyCastleProvider</code>,</p>
-<p>preferably at the end of the block defining the other crypto providers. For JDK 1.4 this is detailed on <a href="http://java.sun.com/j2se/1.4/docs/guide/security/jce/JCERefGuide.html#InstallProvider">Sun's web site</a>.</p>
+<p>encrypt-metadata: Boolean or "true"/"false"</p>
 </li>
 </ol>
-<p>If you have any experience with Mozilla JSS or any other cryptography provider, please post it to the fop-user list.</p></div>
+<h2 id="Environment">Environment</h2>
+<p>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.</p></div>
       </div>
       
       <div class="clear"></div>



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