<br><font size=2 face="sans-serif">We have been using encrypted files for quite a while now and not had any problems, we do not however write out &nbsp;a plain file, we build directly from the encrypt stream</font>
<br>
<br><font size=2><tt>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </tt></font><font size=2 color=#820040><tt>if</tt></font><font size=2><tt> (encrypt == </tt></font><font size=2 color=#820040><tt>true</tt></font><font size=2><tt>) {</tt></font>
<br>
<br><font size=2><tt>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </tt></font><font size=2 color=#820040><tt>byte</tt></font><font size=2><tt>[] b = { magic numbers go here };</tt></font>
<br>
<br><font size=2><tt>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </tt></font><font size=2 color=#3f8080><tt>// Create PBE Cipher</tt></font>
<br><font size=2><tt>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Cipher pbeCipher = createCipher(b, </tt></font><font size=2 color=#820040><tt>false</tt></font><font size=2><tt>);</tt></font>
<br>
<br><font size=2><tt>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; FileInputStream fis = </tt></font><font size=2 color=#820040><tt>new</tt></font><font size=2><tt> FileInputStream(file.toString());</tt></font>
<br><font size=2><tt>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; in = </tt></font><font size=2 color=#820040><tt>new</tt></font><font size=2><tt> CipherInputStream(fis, pbeCipher);</tt></font>
<br>
<br><font size=2><tt>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } </tt></font><font size=2 color=#820040><tt>else</tt></font><font size=2><tt> {</tt></font>
<br><font size=2><tt>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; in = </tt></font><font size=2 color=#820040><tt>new</tt></font><font size=2><tt> FileInputStream(file.toString());</tt></font>
<br><font size=2><tt>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</tt></font>
<br><font size=2><tt>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SAXBuilder builder = </tt></font><font size=2 color=#820040><tt>new</tt></font><font size=2><tt> SAXBuilder();</tt></font>
<br><font size=2><tt>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; builder.setFactory(jdomFactory);</tt></font><font size=2 face="sans-serif"><br>
</font><font size=2><tt> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;doc = builder.build(in);</tt></font>
<br><font size=2 face="sans-serif"><br>
/Phill<br>
IS Dept, Software Engineer.<br>
phill_perryman@mitel.com<br>
http://www.mitel.com<br>
Tel: +44 1291 436023</font>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td>
<td><font size=1 face="sans-serif"><b>&quot;ÁÎÃûѧ&quot; &lt;mxliao@mails.gscas.ac.cn&gt;</b></font>
<br><font size=1 face="sans-serif">Sent by: jdom-interest-admin@jdom.org</font>
<p><font size=1 face="sans-serif">02/12/2003 02:57</font>
<br><font size=1 face="sans-serif">Please respond to &quot;ÁÎÃûѧ&quot;</font>
<br>
<td><font size=1 face="Arial">&nbsp; &nbsp; &nbsp; &nbsp; </font>
<br><font size=1 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; To: &nbsp; &nbsp; &nbsp; &nbsp;jdom-interest@jdom.org</font>
<br><font size=1 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; cc: &nbsp; &nbsp; &nbsp; &nbsp;</font>
<br><font size=1 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; Subject: &nbsp; &nbsp; &nbsp; &nbsp;[jdom-interest] Can file for Document be deleted?</font></table>
<br>
<br>
<br><font size=2 face="Courier New">Sometimes I use an encrypted(by FlowFish) xml file to construct a Document.<br>
Firstly I decrypt the file to a plain .xml file, then extract an instance of<br>
Document from the plain file. Generally, for the sake of security,the plain file<br>
should be deleted. I have done it this way and all does work. But I am not sure<br>
whether the Document instance will be somehow affected under some certain<br>
circumstance unknown to me.<br>
<br>
<br>
_______________________________________________<br>
To control your jdom-interest membership:<br>
http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhost.com<br>
</font>
<br>
<br>