source: trunk/Distribution/SW/FOP/build/site/pdfencryption.html

Last change on this file was 2, checked in by jkacer, 18 years ago

Added all DocBook Framework stuff:

  • DocBook DTD
  • Transformation software FOP 0.20.5 and Saxon 6
  • XSL styles
  • Rexx scripts

Also added some WarpIN-related stuff for creation of WarpIN installation packages.
This state corresponds to version 1.0.0 from November 2005, just slightly modified to carry versioning information (Rexx scripts).

File size: 20.2 KB
Line 
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2<html>
3<head>
4<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
5<title>PDF encryption.</title>
6<link type="text/css" href="skin/page.css" rel="stylesheet">
7</head>
8<body text="#000000" bgcolor="#FFFFFF">
9<!--================= start Navigation Path ==================-->
10<table summary="navigation path" width="100%" border="0" cellpadding="0" cellspacing="0">
11<tr>
12<td nowrap="nowrap" valign="middle" bgcolor="#CFDCED" height="20"><img height="1" width="5" alt="" border="0" src="skin/images/spacer.gif"><!--===== breadcrumb trail (javascript-generated) ====--><font size="2" face="Arial, Helvetica, Sans-serif"><script src="skin/breadcrumbs.js" language="JavaScript" type="text/javascript"></script></font></td>
13</tr>
14<tr>
15<td bgcolor="#4C6C8F" height="2"><img height="2" width="2" alt="" border="0" src="skin/images/spacer.gif"></td>
16</tr>
17</table>
18<!--================= end Navigation Path ==================-->
19<!--================= start Banner ==================-->
20<table summary="header with logos" width="100%" border="0" cellpadding="0" cellspacing="0">
21<tr>
22<!--================= start Group Logo ==================-->
23<td bgcolor="#294563"><a href="http://xml.apache.org/"><img border="0" class="logoImage" alt="Apache XML" src="images/group-logo.gif"></a></td>
24<!--================= end Group Logo ==================-->
25<!--================= start Project Logo ==================--><td width="100%" align="center" bgcolor="#294563"><a href="http://xml.apache.org/fop/"><img border="0" class="logoImage" alt="FOP" src="images/logo.jpg"></a></td>
26<!--================= end Project Logo ==================-->
27<!--================= start Search ==================--><td valign="top" rowspan="2" bgcolor="#294563">
28<form target="_blank" action="http://www.google.com/search" method="get">
29<table summary="search" border="0" cellspacing="0" cellpadding="0" bgcolor="#4C6C8F">
30<tr>
31<td colspan="3"><img height="10" width="1" alt="" src="skin/images/spacer.gif"></td>
32</tr>
33<tr>
34<td><img height="1" width="1" alt="" src="skin/images/spacer.gif"></td><td nowrap="nowrap"><input value="xml.apache.org" name="sitesearch" type="hidden"><input size="15" name="q" id="query" type="text"><img height="1" width="5" alt="" src="skin/images/spacer.gif"><input name="Search" value="Search" type="submit">
35<br>
36<font face="Arial, Helvetica, Sans-serif" size="2" color="white">
37 the Apache XML site
38
39
40 </font></td><td><img height="1" width="1" alt="" src="skin/images/spacer.gif"></td>
41</tr>
42<tr>
43<td><img alt="" border="0" height="10" width="9" src="skin/images/search-left.gif"></td><td><img height="1" width="1" alt="" src="skin/images/spacer.gif"></td><td><img alt="" border="0" height="10" width="9" src="skin/images/search-right.gif"></td>
44</tr>
45</table>
46</form>
47</td>
48<!--================= start Search ==================--><td bgcolor="#294563"><img height="10" width="10" alt="" src="skin/images/spacer.gif"></td>
49</tr>
50<tr>
51<td valign="bottom" bgcolor="#294563" colspan="2">
52<!--================= start Tabs ==================-->
53<div class="tab">
54<table summary="tab bar" border="0" cellpadding="0" cellspacing="0">
55<tr>
56<td width="8"><img alt="" height="8" width="8" src="skin/images/spacer.gif"></td><td valign="bottom">
57<table summary="selected tab" style="height: 1.7em" border="0" cellpadding="0" cellspacing="0">
58<tr>
59<td valign="top" width="5" bgcolor="#4C6C8F"><img height="5" width="5" alt="" src="skin/images/tabSel-left.gif"></td><td valign="middle" bgcolor="#4C6C8F"><font color="#ffffff" size="2" face="Arial, Helvetica, Sans-serif"><b><a href="index.html"><font color="#000000">Home</font></a></b></font></td><td valign="top" width="5" bgcolor="#4C6C8F"><img height="5" width="5" alt="" src="skin/images/tabSel-right.gif"></td>
60</tr>
61</table>
62</td><td width="8"><img alt="" height="8" width="8" src="skin/images/spacer.gif"></td><td valign="bottom">
63<table summary="non selected tab" style="height: 1.6em" border="0" cellpadding="0" cellspacing="0">
64<tr>
65<td valign="top" width="5" bgcolor="#B2C4E0"><img height="5" width="5" alt="" src="skin/images/tab-left.gif"></td><td valign="middle" bgcolor="#B2C4E0"><a href="dev/index.html"><font face="Arial, Helvetica, Sans-serif">Development</font></a></td><td valign="top" width="5" bgcolor="#B2C4E0"><img height="5" width="5" alt="" src="skin/images/tab-right.gif"></td>
66</tr>
67</table>
68</td>
69</tr>
70</table>
71</div>
72<!--================= end Tabs ==================-->
73</td><td bgcolor="#294563"><img alt="" width="1" height="1" src="skin/images/spacer.gif"></td>
74</tr>
75<tr>
76<td bgcolor="#4C6C8F" colspan="4"><img width="1" height="10" alt="" src="skin/images/spacer.gif"></td>
77</tr>
78</table>
79<!--================= end Banner ==================-->
80<!--================= start Menu, NavBar, Content ==================-->
81<table summary="page content" bgcolor="#ffffff" width="100%" border="0" cellpadding="0" cellspacing="0">
82<tr>
83<td valign="top">
84<table summary="menu" border="0" cellspacing="0" cellpadding="0">
85<tr>
86<!--================= start left top NavBar ==================-->
87<td rowspan="3" valign="top">
88<table summary="blue line" border="0" cellpadding="0" cellspacing="0">
89<tr>
90<td bgcolor="#294563"><img width="10" height="1" alt="" src="skin/images/spacer.gif"></td>
91</tr>
92<tr>
93<td bgcolor="#CFDCED"><font color="#4C6C8F" size="4" face="Arial, Helvetica, Sans-serif">&nbsp;</font></td>
94</tr>
95<tr>
96<td bgcolor="#294563"><img width="10" height="1" alt="" src="skin/images/spacer.gif"></td>
97</tr>
98</table>
99</td>
100<!--================= end left top NavBar ==================--><td bgcolor="#294563"><img width="1" height="1" alt="" src="skin/images/spacer.gif"></td><td valign="bottom" bgcolor="#4C6C8F"><img width="10" height="10" alt="" src="skin/images/spacer.gif"></td><td nowrap="nowrap" valign="top" bgcolor="#4C6C8F">
101<!--================= start Menu items ==================-->
102<div class="menu">
103<ul>
104<li>
105<font color="#CFDCED">Home</font>
106<ul>
107
108<li>
109<a href="index.html">Introduction</a>
110</li>
111
112</ul>
113</li>
114<li>
115<font color="#CFDCED">Using FOP</font>
116<ul>
117
118<li>
119<a href="relnotes.html">Release Notes</a>
120</li>
121
122<li>
123<a href="download.html">Download</a>
124</li>
125
126<li>
127<a href="compiling.html">Build</a>
128</li>
129
130<li>
131<a href="configuration.html">Configure</a>
132</li>
133
134<li>
135<a href="running.html">Run</a>
136</li>
137
138<li>
139<a href="embedding.html">Embed</a>
140</li>
141
142<li>
143<a href="servlets.html">Servlets</a>
144</li>
145
146<li>
147<a href="anttask.html">Ant task</a>
148</li>
149
150</ul>
151</li>
152<li>
153<font color="#CFDCED">Features</font>
154<ul>
155
156<li>
157<a href="compliance.html">Compliance</a>
158</li>
159
160<li>
161<a href="output.html">Output Targets</a>
162</li>
163
164<li>
165<span class="sel"><font color="#ffcc00">PDF encryption</font></span>
166</li>
167
168<li>
169<a href="graphics.html">Graphics</a>
170</li>
171
172<li>
173<a href="fonts.html">Fonts</a>
174</li>
175
176<li>
177<a href="hyphenation.html">Hyphenation</a>
178</li>
179
180<li>
181<a href="extensions.html">Extensions</a>
182</li>
183
184</ul>
185</li>
186<li>
187<font color="#CFDCED">Resources</font>
188<ul>
189
190<li>
191<a href="gethelp.html">Getting Help</a>
192</li>
193
194<li>
195<a href="faq.html">FAQs</a>
196</li>
197
198<li>
199<a href="fo.html">XSL-FO</a>
200</li>
201
202<li>
203<a href="examples.html">Examples</a>
204</li>
205
206<li>
207<a href="maillist.html">Mailing Lists</a>
208</li>
209
210<li>
211<a href="bugs.html">Bugs</a>
212</li>
213
214<li>
215<a href="license.html">License</a>
216</li>
217
218<li>
219<a href="resources.html">Other</a>
220</li>
221
222</ul>
223</li>
224<li>
225<font color="#CFDCED">Project</font>
226<ul>
227
228<li>
229<a href="news.html">News</a>
230</li>
231
232<li>
233<a href="logocontest.html">Logo contest</a>
234</li>
235
236<li>
237<a href="status.html">Status</a>
238</li>
239
240
241<li>
242<a href="team.html">Team</a>
243</li>
244
245</ul>
246</li>
247</ul>
248</div>
249<!--================= end Menu items ==================-->
250</td><td valign="bottom" bgcolor="#4C6C8F"><img width="10" height="10" alt="" src="skin/images/spacer.gif"></td><td bgcolor="#294563"><img width="1" height="1" alt="" src="skin/images/spacer.gif"></td>
251</tr>
252<tr>
253<td valign="bottom" align="left" colspan="2" rowspan="2" bgcolor="#4C6C8F"><img height="10" width="10" border="0" alt="" src="skin/images/menu-left.gif"></td><td bgcolor="#4C6C8F"><img height="10" width="10" border="0" alt="" src="skin/images/spacer.gif"></td><td valign="bottom" align="right" colspan="2" rowspan="2" bgcolor="#4C6C8F"><img height="10" width="10" border="0" alt="" src="skin/images/menu-right.gif"></td>
254</tr>
255<tr>
256<td height="1" bgcolor="#294563"><img width="1" height="1" alt="" src="skin/images/spacer.gif"></td>
257</tr>
258</table>
259</td><td valign="top" width="100%">
260<table summary="content" width="100%" border="0" cellpadding="0" cellspacing="0">
261<!--================= start middle NavBar ==================-->
262<tr>
263<td colspan="4" bgcolor="#294563"><img width="10" height="1" alt="" src="skin/images/spacer.gif"></td>
264</tr>
265<tr>
266<td align="left" width="10" bgcolor="#CFDCED"><img width="10" height="1" alt="" src="skin/images/spacer.gif"></td><td align="left" width="50%" bgcolor="#CFDCED"><font color="#4C6C8F" size="3" face="Arial, Helvetica, Sans-serif">
267 &nbsp;
268
269 </font><img width="10" height="8" alt="" src="skin/images/spacer.gif"></td><td align="right" width="50%" bgcolor="#CFDCED"><font color="#4C6C8F" size="3" face="Arial, Helvetica, Sans-serif">
270 &nbsp;
271
272 </font><img width="10" height="8" alt="" src="skin/images/spacer.gif"></td><td width="10" bgcolor="#CFDCED"><img width="10" height="1" alt="" src="skin/images/spacer.gif"></td>
273</tr>
274<tr>
275<td colspan="4" bgcolor="#294563"><img width="10" height="1" alt="" src="skin/images/spacer.gif"></td>
276</tr>
277<!--================= end middle NavBar ==================-->
278<!--================= start Content==================-->
279<tr>
280<td align="left" width="10"><img width="10" height="1" alt="" src="skin/images/spacer.gif"></td><td align="left" width="100%">
281<div class="content">
282<table class="title" summary="">
283<tr>
284<td valign="middle">
285<h1>PDF encryption.</h1>
286</td><td nowrap="nowrap" width="80" align="center"><a class="dida" href="pdfencryption.pdf"><img alt="printer" src="skin/images/printer.gif" border="0"><br>
287 print-friendly<br>
288 PDF</a></td>
289</tr>
290</table>
291<p>
292<font size="-2">by&nbsp;J.Pietschmann,&nbsp;Jeremias M&auml;rki</font>
293</p>
294<ul class="minitoc">
295<li>
296<a href="#Overview">Overview</a>
297</li>
298<li>
299<a href="#Usage+%28command+line%29">Usage (command line)</a>
300</li>
301<li>
302<a href="#Usage+%28embedded%29">Usage (embedded)</a>
303</li>
304<li>
305<a href="#Environment">Environment</a>
306</li>
307<li>
308<a href="#install_crypto">Installing a crypto provider</a>
309</li>
310</ul>
311
312<a name="N101C9"></a><a name="Overview"></a>
313<h3>Overview</h3>
314<div style="margin-left: 0 ; border: 2px">
315<div class="frame warning">
316<div class="label">Warning</div>
317<div class="content">PDF Encryption is available in Release 0.20.5 and later. The comments on this page do not apply to releases earlier than 0.20.5.</div>
318</div>
319<p>
320 FOP supports encryption of PDF output, thanks to Patrick
321 C. Lankswert. This feature is commonly used to prevent
322 unauthorized viewing, printing, editing, copying text from the
323 document and doing annotations. It is also possible to ask the
324 user for a password in order to view the contents. Note that
325 there already exist third party applications which can decrypt
326 an encrypted PDF without effort and allow the aforementioned
327 operations, therefore the degree of protection is limited.
328 </p>
329<p>
330 For further information about features and restrictions regarding PDF
331 encryption, look at the documentation coming with Adobe Acrobat or the
332 technical documentation on the Adobe web site.
333 </p>
334</div>
335
336<a name="N101D9"></a><a name="Usage+%28command+line%29"></a>
337<h3>Usage (command line)</h3>
338<div style="margin-left: 0 ; border: 2px">
339<p>
340 Encryption is enabled by supplying any of the encryption related
341 options.
342 </p>
343<p>
344 An owner password is set with the <span class="codefrag">-o</span> option. This
345 password is actually used as encryption key. Many tools for
346 PDF processing ask for this password to disregard any
347 restriction imposed on the PDF document.
348 </p>
349<p>
350 If no owner password has been supplied but FOP was asked to apply some
351 restrictions, a random password is used. In this case it is obviously
352 impossiible to disregard restrictions in PDF processing tools.
353 </p>
354<p>
355 A user password, supplied with the <span class="codefrag">-u</span> option, will
356 cause the PDF display software to ask the reader for this password in
357 order to view the contents of the document. If no user password was
358 supplied, viewing the content is not restricted.
359 </p>
360<p>
361 Further restrictions can be imposed by using the <span class="codefrag">-noprint</span>,
362 <span class="codefrag">-nocopy</span>, <span class="codefrag">-noedit</span> and
363 <span class="codefrag">-noannotations</span> options, which disable printing, copying
364 text, editing in Adobe Acrobat and making annotations, respectively.
365 </p>
366</div>
367
368<a name="N10201"></a><a name="Usage+%28embedded%29"></a>
369<h3>Usage (embedded)</h3>
370<div style="margin-left: 0 ; border: 2px">
371<p>
372 When FOP is embedded in another Java application you need to set an
373 options map on the renderer. These are the supported options:
374 </p>
375<table class="ForrestTable" cellspacing="1" cellpadding="4">
376
377<tr>
378
379<th colspan="1" rowspan="1">Option</th>
380 <th colspan="1" rowspan="1">Description</th>
381 <th colspan="1" rowspan="1">Values</th>
382 <th colspan="1" rowspan="1">Default</th>
383
384</tr>
385
386<tr>
387
388<td colspan="1" rowspan="1">ownerPassword</td>
389 <td colspan="1" rowspan="1">The owner password</td>
390 <td colspan="1" rowspan="1">String</td>
391 <td colspan="1" rowspan="1"></td>
392
393</tr>
394
395<tr>
396
397<td colspan="1" rowspan="1">userPassword</td>
398 <td colspan="1" rowspan="1">The user password</td>
399 <td colspan="1" rowspan="1">String</td>
400 <td colspan="1" rowspan="1"></td>
401
402</tr>
403
404<tr>
405
406<td colspan="1" rowspan="1">allowPrint</td>
407 <td colspan="1" rowspan="1">Allows/disallows printing of the PDF</td>
408 <td colspan="1" rowspan="1">"TRUE" or "FALSE"</td>
409 <td colspan="1" rowspan="1">"TRUE"</td>
410
411</tr>
412
413<tr>
414
415<td colspan="1" rowspan="1">allowCopyContent</td>
416 <td colspan="1" rowspan="1">Allows/disallows copy/paste of content</td>
417 <td colspan="1" rowspan="1">"TRUE" or "FALSE"</td>
418 <td colspan="1" rowspan="1">"TRUE"</td>
419
420</tr>
421
422<tr>
423
424<td colspan="1" rowspan="1">allowEditContent</td>
425 <td colspan="1" rowspan="1">Allows/disallows editing of content</td>
426 <td colspan="1" rowspan="1">"TRUE" or "FALSE"</td>
427 <td colspan="1" rowspan="1">"TRUE"</td>
428
429</tr>
430
431<tr>
432
433<td colspan="1" rowspan="1">allowEditAnnotations</td>
434 <td colspan="1" rowspan="1">Allows/disallows editing of annotations</td>
435 <td colspan="1" rowspan="1">"TRUE" or "FALSE"</td>
436 <td colspan="1" rowspan="1">"TRUE"</td>
437
438</tr>
439
440</table>
441<div class="frame note">
442<div class="label">Note</div>
443<div class="content">
444 Encryption is enabled as soon as one of these options is set.
445 </div>
446</div>
447<p>
448 An example to enable PDF encryption in Java code:
449 </p>
450<pre class="code">
451Driver driver = new Driver();
452driver.setRenderer(Driver.RENDER_PDF);
453Map rendererOptions = new java.util.HashMap();
454rendererOptions.put("ownerPassword", "mypassword");
455rendererOptions.put("allowCopyContent", "FALSE");
456rendererOptions.put("allowEditContent", "FALSE");
457rendererOptions.put("allowPrint", "FALSE");
458driver.getRenderer().setOptions(rendererOptions);
459driver.setOutputStream(...</pre>
460</div>
461
462<a name="N102B7"></a><a name="Environment"></a>
463<h3>Environment</h3>
464<div style="margin-left: 0 ; border: 2px">
465<p>
466 In order to use PDF encryption, FOP has to be compiled with
467 cryptography support. Currently, only <a href="http://java.sun.com/j2se/1.4/docs/guide/security/jce/JCERefGuide.html">JCE</a>
468 is supported. JCE is part of JDK 1.4. For earlier JDKs, it can
469 be installed separately. The build process automatically
470 detects JCE presence and installs PDF encryption support if
471 possible, otherwise a stub is compiled in.
472 </p>
473<p>
474 Cryptography support must also be present at run time. In particular, a
475 provider for the RC4 cipher is needed. Unfortunately, the sample JCE
476 provider in Sun's JDK 1.4 does <strong>not</strong> provide RC4. If you
477 get a message saying
478 </p>
479<pre class="code">"Cannot find any provider supporting RC4"</pre>
480<p>
481 then you don't have the needed infrastructure.
482 </p>
483<p>
484 There are several commercial and a few Open Source packages which
485 provide RC4. A pure Java implementation is produced by <a href="http://www.bouncycastle.org/">The Legion of the Bouncy
486 Castle</a>. <a href="http://www.mozilla.org/projects/security/pki/jss/">Mozilla
487 JSS</a> is an interface to a native implementation.
488 </p>
489</div>
490
491<a name="N102DD"></a><a name="install_crypto"></a>
492<h3>Installing a crypto provider</h3>
493<div style="margin-left: 0 ; border: 2px">
494<p>
495 The pure Java implementation from <a href="http://www.bouncycastle.org/">Bouncy Castle</a> is easy to
496 install.
497 </p>
498<ol>
499
500<li>
501 Download the binary distribution for your JDK version. If you have JDK
502 1.3 or earlier you must also download a JCE from the same page.
503 </li>
504
505<li>
506 Unpack the distribution. Add the jar file to your classpath. A
507 convenient way to use the jar on Linux is to simply drop it into the
508 FOP lib directory, it will be automatically picked up by
509 <span class="codefrag">fop.sh</span>. If you have JDK 1.3 or earlier don't forget to
510 install the JCE as well.
511 </li>
512
513<li>
514 Open the <span class="codefrag">java.security</span> file and add<br>
515
516<span class="codefrag">security.provider.6=org.bouncycastle.jce.provider.BouncyCastleProvider</span>,<br>
517 preferably at the end of the block defining the other crypto
518 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>.
519 </li>
520
521</ol>
522<p>
523 If you have any experience with Mozilla JSS or any other
524 cryptography provider, please post it to the fop-user list.
525 </p>
526</div>
527
528</div>
529</td><td width="10"><img width="10" height="1" alt="" src="skin/images/spacer.gif"></td>
530</tr>
531<!--================= end Content==================-->
532</table>
533</td>
534</tr>
535</table>
536<!--================= end Menu, NavBar, Content ==================-->
537<!--================= start Footer ==================-->
538<table summary="footer" cellspacing="0" cellpadding="0" width="100%" border="0">
539<tr>
540<td colspan="2" height="1" bgcolor="#4C6C8F"><img height="1" width="1" alt="" src="skin/images/spacer.gif"><a href="skin/images/label.gif"></a><a href="skin/images/page.gif"></a><a href="skin/images/chapter.gif"></a><a href="skin/images/chapter_open.gif"></a><a href="skin/images/current.gif"></a><a href="/favicon.ico"></a></td>
541</tr>
542<tr>
543<td colspan="2" bgcolor="#CFDCED" class="copyright" align="center"><font size="2" face="Arial, Helvetica, Sans-Serif">Copyright &copy;
544 1999-2003&nbsp;The Apache Software Foundation. All rights reserved.<script type="text/javascript" language="JavaScript"><!--
545 document.write(" - "+"Last Published: " + document.lastModified);
546 // --></script></font></td>
547</tr>
548<tr>
549<td colspan="2" align="left" bgcolor="#CFDCED" class="logos"></td>
550</tr>
551</table>
552<!--================= end Footer ==================-->
553</body>
554</html>
Note: See TracBrowser for help on using the repository browser.