source: TI12-security/trunk/documentation/epydoc/ndg.security.common.XMLSec.XMLSecDoc-class.html @ 3153

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI12-security/trunk/documentation/epydoc/ndg.security.common.XMLSec.XMLSecDoc-class.html@3153
Revision 3153, 56.3 KB checked in by pjkersha, 13 years ago (diff)

NDG Security release updated to 0.8.7. Changes in this version enable full support for multiple CAs and use of MyProxy? SimpleCA dynamically created cert.s. These differ from previous use of MyProxy? in that they are issued directly from a CA instead of a user cert held in the repository.

setup.py,
ndg.security.server/setup.py,
ndg.security.server/ndg/security/server/MyProxy.py,
ndg.security.client/setup.py,
ndg.security.test/setup.py,
ndg.security.common/setup.py: updated NDG Security release num

ndg.security.server/ndg/security/server/SessionMgr/init.py,
ndg.security.test/ndg/security/test/sessionMgrClient/SessionMgrClientTest.py: SessionCookie? class not used. Pylons framework handles this.

ndg.security.test/ndg/security/test/sessionCookie: renamed package from SessionCookie?

Line 
1<?xml version="1.0" encoding="ascii"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
3          "DTD/xhtml1-transitional.dtd">
4<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5<head>
6  <title>ndg.security.common.XMLSec.XMLSecDoc</title>
7  <link rel="stylesheet" href="epydoc.css" type="text/css" />
8  <script type="text/javascript" src="epydoc.js"></script>
9</head>
10
11<body bgcolor="white" text="black" link="blue" vlink="#204080"
12      alink="#204080">
13<!-- ==================== NAVIGATION BAR ==================== -->
14<table class="navbar" border="0" width="100%" cellpadding="0"
15       bgcolor="#a0c0ff" cellspacing="0">
16  <tr valign="middle">
17  <!-- Home link -->
18      <th>&nbsp;&nbsp;&nbsp;<a
19        href="ndg-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
20
21  <!-- Tree link -->
22      <th>&nbsp;&nbsp;&nbsp;<a
23        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
24
25  <!-- Index link -->
26      <th>&nbsp;&nbsp;&nbsp;<a
27        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
28
29  <!-- Help link -->
30      <th>&nbsp;&nbsp;&nbsp;<a
31        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
32
33  <!-- Project homepage -->
34      <th class="navbar" align="right" width="100%">
35        <table border="0" cellpadding="0" cellspacing="0">
36          <tr><th class="navbar" align="center"
37            >NDG Security</th>
38          </tr></table></th>
39  </tr>
40</table>
41<table width="100%" cellpadding="0" cellspacing="0">
42  <tr valign="top">
43    <td width="100%">
44      <span class="breadcrumbs">
45        <a href="ndg-module.html">Package&nbsp;ndg</a> ::
46        <a href="ndg.security-module.html">Package&nbsp;security</a> ::
47        <a href="ndg.security.common-module.html">Package&nbsp;common</a> ::
48        <a href="ndg.security.common.XMLSec-module.html">Module&nbsp;XMLSec</a> ::
49        Class&nbsp;XMLSecDoc
50      </span>
51    </td>
52    <td>
53      <table cellpadding="0" cellspacing="0">
54        <!-- hide/show private -->
55        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
56    onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
57      </table>
58    </td>
59  </tr>
60</table>
61<!-- ==================== CLASS DESCRIPTION ==================== -->
62<h1 class="epydoc">Class XMLSecDoc</h1><span class="codelink"><a href="ndg.security.common.XMLSec-pysrc.html#XMLSecDoc">source&nbsp;code</a></span><br /><br />
63<center>
64<center>  <map id="uml_class_diagram_for_ndg_secu_76" name="uml_class_diagram_for_ndg_secu_76">
65<area shape="rect" href="ndg.security.common.AttCert.AttCert&#45;class.html" title="NDG Attribute Certificate (Authorisation or Access Token)." alt="" coords="15,56,67,72"/>
66<area shape="rect" href="ndg.security.common.XMLSec.XMLSecDoc&#45;class.html" title="Implements XML Signature and XML Encryption for a Document." alt="" coords="15,11,67,27"/>
67</map>
68  <img src="uml_class_diagram_for_ndg_secu_76.gif" alt='' usemap="#uml_class_diagram_for_ndg_secu_76" ismap="ismap" class="graph-without-title" />
69</center></center>
70<hr />
71Implements XML Signature and XML Encryption for a Document.<br /><br />
72
73<!-- ==================== INSTANCE METHODS ==================== -->
74<a name="section-InstanceMethods"></a>
75<table class="summary" border="1" cellpadding="3"
76       cellspacing="0" width="100%" bgcolor="white">
77<tr bgcolor="#70b0f0" class="table-header">
78  <td colspan="2" class="table-header">
79    <table border="0" cellpadding="0" cellspacing="0" width="100%">
80      <tr valign="top">
81        <td align="left"><span class="table-header">Instance Methods</span></td>
82        <td align="right" valign="top"
83         ><span class="options">[<a href="#section-InstanceMethods"
84         class="privatelink" onclick="toggle_private();"
85         >hide private</a>]</span></td>
86      </tr>
87    </table>
88  </td>
89</tr>
90<tr>
91    <td width="15%" align="right" valign="top" class="summary">
92      <span class="summary-type">&nbsp;</span>
93    </td><td class="summary">
94      <table width="100%" cellpadding="0" cellspacing="0" border="0">
95        <tr>
96          <td><span class="summary-sig"><a href="ndg.security.common.XMLSec.XMLSecDoc-class.html#__init__" class="summary-sig-name">__init__</a>(<span class="summary-sig-arg">self</span>,
97        <span class="summary-sig-arg">filePath</span>=<span class="summary-sig-default">None</span>,
98        <span class="summary-sig-arg">signingKeyFilePath</span>=<span class="summary-sig-default">None</span>,
99        <span class="summary-sig-arg">signingKeyPwd</span>=<span class="summary-sig-default">None</span>,
100        <span class="summary-sig-arg">certFilePathList</span>=<span class="summary-sig-default">None</span>,
101        <span class="summary-sig-arg">encrCertFilePath</span>=<span class="summary-sig-default">None</span>,
102        <span class="summary-sig-arg">encrPriKeyFilePath</span>=<span class="summary-sig-default">None</span>)</span><br />
103      Initialisation -</td>
104          <td align="right" valign="top">
105            <span class="codelink"><a href="ndg.security.common.XMLSec-pysrc.html#XMLSecDoc.__init__">source&nbsp;code</a></span>
106           
107          </td>
108        </tr>
109      </table>
110     
111    </td>
112  </tr>
113<tr>
114    <td width="15%" align="right" valign="top" class="summary">
115      <span class="summary-type">&nbsp;</span>
116    </td><td class="summary">
117      <table width="100%" cellpadding="0" cellspacing="0" border="0">
118        <tr>
119          <td><span class="summary-sig"><a href="ndg.security.common.XMLSec.XMLSecDoc-class.html#__str__" class="summary-sig-name">__str__</a>(<span class="summary-sig-arg">self</span>)</span><br />
120      String representation of doc - only applies if doc had been read
121      or parsed</td>
122          <td align="right" valign="top">
123            <span class="codelink"><a href="ndg.security.common.XMLSec-pysrc.html#XMLSecDoc.__str__">source&nbsp;code</a></span>
124           
125          </td>
126        </tr>
127      </table>
128     
129    </td>
130  </tr>
131<tr class="private">
132    <td width="15%" align="right" valign="top" class="summary">
133      <span class="summary-type">&nbsp;</span>
134    </td><td class="summary">
135      <table width="100%" cellpadding="0" cellspacing="0" border="0">
136        <tr>
137          <td><span class="summary-sig"><a name="__getFilePath"></a><span class="summary-sig-name">__getFilePath</span>(<span class="summary-sig-arg">self</span>)</span><br />
138      Get file path for file to be signed/encrypted.</td>
139          <td align="right" valign="top">
140            <span class="codelink"><a href="ndg.security.common.XMLSec-pysrc.html#XMLSecDoc.__getFilePath">source&nbsp;code</a></span>
141           
142          </td>
143        </tr>
144      </table>
145     
146    </td>
147  </tr>
148<tr class="private">
149    <td width="15%" align="right" valign="top" class="summary">
150      <span class="summary-type">&nbsp;</span>
151    </td><td class="summary">
152      <table width="100%" cellpadding="0" cellspacing="0" border="0">
153        <tr>
154          <td><span class="summary-sig"><a href="ndg.security.common.XMLSec.XMLSecDoc-class.html#__setFilePath" class="summary-sig-name">__setFilePath</a>(<span class="summary-sig-arg">self</span>,
155        <span class="summary-sig-arg">filePath</span>)</span><br />
156      Set file path for file to be
157      signed/verified/encrypted/decrypted</td>
158          <td align="right" valign="top">
159            <span class="codelink"><a href="ndg.security.common.XMLSec-pysrc.html#XMLSecDoc.__setFilePath">source&nbsp;code</a></span>
160           
161          </td>
162        </tr>
163      </table>
164     
165    </td>
166  </tr>
167<tr class="private">
168    <td width="15%" align="right" valign="top" class="summary">
169      <span class="summary-type">&nbsp;</span>
170    </td><td class="summary">
171      <table width="100%" cellpadding="0" cellspacing="0" border="0">
172        <tr>
173          <td><span class="summary-sig"><a name="__delFilePath"></a><span class="summary-sig-name">__delFilePath</span>(<span class="summary-sig-arg">self</span>)</span><br />
174      Prevent file path being deleted.</td>
175          <td align="right" valign="top">
176            <span class="codelink"><a href="ndg.security.common.XMLSec-pysrc.html#XMLSecDoc.__delFilePath">source&nbsp;code</a></span>
177           
178          </td>
179        </tr>
180      </table>
181     
182    </td>
183  </tr>
184<tr class="private">
185    <td width="15%" align="right" valign="top" class="summary">
186      <span class="summary-type">&nbsp;</span>
187    </td><td class="summary">
188      <table width="100%" cellpadding="0" cellspacing="0" border="0">
189        <tr>
190          <td><span class="summary-sig"><a name="__getDocNode"></a><span class="summary-sig-name">__getDocNode</span>(<span class="summary-sig-arg">self</span>)</span><br />
191      Get file path for file to be signed/encrypted.</td>
192          <td align="right" valign="top">
193            <span class="codelink"><a href="ndg.security.common.XMLSec-pysrc.html#XMLSecDoc.__getDocNode">source&nbsp;code</a></span>
194           
195          </td>
196        </tr>
197      </table>
198     
199    </td>
200  </tr>
201<tr class="private">
202    <td width="15%" align="right" valign="top" class="summary">
203      <span class="summary-type">&nbsp;</span>
204    </td><td class="summary">
205      <table width="100%" cellpadding="0" cellspacing="0" border="0">
206        <tr>
207          <td><span class="summary-sig"><a name="__delDocNode"></a><span class="summary-sig-name">__delDocNode</span>(<span class="summary-sig-arg">self</span>)</span><br />
208      Prevent file path being deleted.</td>
209          <td align="right" valign="top">
210            <span class="codelink"><a href="ndg.security.common.XMLSec-pysrc.html#XMLSecDoc.__delDocNode">source&nbsp;code</a></span>
211           
212          </td>
213        </tr>
214      </table>
215     
216    </td>
217  </tr>
218<tr class="private">
219    <td width="15%" align="right" valign="top" class="summary">
220      <span class="summary-type">&nbsp;</span>
221    </td><td class="summary">
222      <table width="100%" cellpadding="0" cellspacing="0" border="0">
223        <tr>
224          <td><span class="summary-sig"><a href="ndg.security.common.XMLSec.XMLSecDoc-class.html#__setCertFilePathList" class="summary-sig-name">__setCertFilePathList</a>(<span class="summary-sig-arg">self</span>,
225        <span class="summary-sig-arg">filePath</span>)</span><br />
226      File path for certificate used to sign document / list of
227      certificates used to check the signature of a document</td>
228          <td align="right" valign="top">
229            <span class="codelink"><a href="ndg.security.common.XMLSec-pysrc.html#XMLSecDoc.__setCertFilePathList">source&nbsp;code</a></span>
230           
231          </td>
232        </tr>
233      </table>
234     
235    </td>
236  </tr>
237<tr class="private">
238    <td width="15%" align="right" valign="top" class="summary">
239      <span class="summary-type">&nbsp;</span>
240    </td><td class="summary">
241      <table width="100%" cellpadding="0" cellspacing="0" border="0">
242        <tr>
243          <td><span class="summary-sig"><a name="__setSigningKeyFilePath"></a><span class="summary-sig-name">__setSigningKeyFilePath</span>(<span class="summary-sig-arg">self</span>,
244        <span class="summary-sig-arg">filePath</span>)</span><br />
245      Set file path for certificate private key used to sign doc.</td>
246          <td align="right" valign="top">
247            <span class="codelink"><a href="ndg.security.common.XMLSec-pysrc.html#XMLSecDoc.__setSigningKeyFilePath">source&nbsp;code</a></span>
248           
249          </td>
250        </tr>
251      </table>
252     
253    </td>
254  </tr>
255<tr class="private">
256    <td width="15%" align="right" valign="top" class="summary">
257      <span class="summary-type">&nbsp;</span>
258    </td><td class="summary">
259      <table width="100%" cellpadding="0" cellspacing="0" border="0">
260        <tr>
261          <td><span class="summary-sig"><a href="ndg.security.common.XMLSec.XMLSecDoc-class.html#__setSigningKeyPwd" class="summary-sig-name">__setSigningKeyPwd</a>(<span class="summary-sig-arg">self</span>,
262        <span class="summary-sig-arg">pwd</span>)</span><br />
263      Set password to read private key from file</td>
264          <td align="right" valign="top">
265            <span class="codelink"><a href="ndg.security.common.XMLSec-pysrc.html#XMLSecDoc.__setSigningKeyPwd">source&nbsp;code</a></span>
266           
267          </td>
268        </tr>
269      </table>
270     
271    </td>
272  </tr>
273<tr class="private">
274    <td width="15%" align="right" valign="top" class="summary">
275      <span class="summary-type">&nbsp;</span>
276    </td><td class="summary">
277      <table width="100%" cellpadding="0" cellspacing="0" border="0">
278        <tr>
279          <td><span class="summary-sig"><a href="ndg.security.common.XMLSec.XMLSecDoc-class.html#__setEncrCertFilePath" class="summary-sig-name">__setEncrCertFilePath</a>(<span class="summary-sig-arg">self</span>,
280        <span class="summary-sig-arg">filePath</span>)</span><br />
281      Set file path for X.509 certificate file containing public key
282      used to decrypt doc.</td>
283          <td align="right" valign="top">
284            <span class="codelink"><a href="ndg.security.common.XMLSec-pysrc.html#XMLSecDoc.__setEncrCertFilePath">source&nbsp;code</a></span>
285           
286          </td>
287        </tr>
288      </table>
289     
290    </td>
291  </tr>
292<tr class="private">
293    <td width="15%" align="right" valign="top" class="summary">
294      <span class="summary-type">&nbsp;</span>
295    </td><td class="summary">
296      <table width="100%" cellpadding="0" cellspacing="0" border="0">
297        <tr>
298          <td><span class="summary-sig"><a href="ndg.security.common.XMLSec.XMLSecDoc-class.html#__setEncrPriKeyFilePath" class="summary-sig-name">__setEncrPriKeyFilePath</a>(<span class="summary-sig-arg">self</span>,
299        <span class="summary-sig-arg">filePath</span>)</span><br />
300      Set file path for private key used to decrypt doc.</td>
301          <td align="right" valign="top">
302            <span class="codelink"><a href="ndg.security.common.XMLSec-pysrc.html#XMLSecDoc.__setEncrPriKeyFilePath">source&nbsp;code</a></span>
303           
304          </td>
305        </tr>
306      </table>
307     
308    </td>
309  </tr>
310<tr>
311    <td width="15%" align="right" valign="top" class="summary">
312      <span class="summary-type">&nbsp;</span>
313    </td><td class="summary">
314      <table width="100%" cellpadding="0" cellspacing="0" border="0">
315        <tr>
316          <td><span class="summary-sig"><a href="ndg.security.common.XMLSec.XMLSecDoc-class.html#toString" class="summary-sig-name">toString</a>(<span class="summary-sig-arg">self</span>,
317        <span class="summary-sig-arg">inclXMLhdr</span>=<span class="summary-sig-default">True</span>)</span><br />
318      Return certificate file content as a string</td>
319          <td align="right" valign="top">
320            <span class="codelink"><a href="ndg.security.common.XMLSec-pysrc.html#XMLSecDoc.toString">source&nbsp;code</a></span>
321           
322          </td>
323        </tr>
324      </table>
325     
326    </td>
327  </tr>
328<tr>
329    <td width="15%" align="right" valign="top" class="summary">
330      <span class="summary-type">&nbsp;</span>
331    </td><td class="summary">
332      <table width="100%" cellpadding="0" cellspacing="0" border="0">
333        <tr>
334          <td><span class="summary-sig"><a href="ndg.security.common.XMLSec.XMLSecDoc-class.html#parse" class="summary-sig-name">parse</a>(<span class="summary-sig-arg">self</span>,
335        <span class="summary-sig-arg">xmlTxt</span>)</span><br />
336      Parse string containing XML into a DOM to allow signature or
337      signature validation</td>
338          <td align="right" valign="top">
339            <span class="codelink"><a href="ndg.security.common.XMLSec-pysrc.html#XMLSecDoc.parse">source&nbsp;code</a></span>
340           
341          </td>
342        </tr>
343      </table>
344     
345    </td>
346  </tr>
347<tr>
348    <td width="15%" align="right" valign="top" class="summary">
349      <span class="summary-type">&nbsp;</span>
350    </td><td class="summary">
351      <table width="100%" cellpadding="0" cellspacing="0" border="0">
352        <tr>
353          <td><span class="summary-sig"><a href="ndg.security.common.XMLSec.XMLSecDoc-class.html#read" class="summary-sig-name">read</a>(<span class="summary-sig-arg">self</span>,
354        <span class="summary-sig-arg">stream</span>=<span class="summary-sig-default">None</span>)</span><br />
355      Read XML into a libxml2 document to allow signature validation</td>
356          <td align="right" valign="top">
357            <span class="codelink"><a href="ndg.security.common.XMLSec-pysrc.html#XMLSecDoc.read">source&nbsp;code</a></span>
358           
359          </td>
360        </tr>
361      </table>
362     
363    </td>
364  </tr>
365<tr>
366    <td width="15%" align="right" valign="top" class="summary">
367      <span class="summary-type">&nbsp;</span>
368    </td><td class="summary">
369      <table width="100%" cellpadding="0" cellspacing="0" border="0">
370        <tr>
371          <td><span class="summary-sig"><a name="write"></a><span class="summary-sig-name">write</span>(<span class="summary-sig-arg">self</span>)</span><br />
372      Write XML document</td>
373          <td align="right" valign="top">
374            <span class="codelink"><a href="ndg.security.common.XMLSec-pysrc.html#XMLSecDoc.write">source&nbsp;code</a></span>
375           
376          </td>
377        </tr>
378      </table>
379     
380    </td>
381  </tr>
382<tr>
383    <td width="15%" align="right" valign="top" class="summary">
384      <span class="summary-type">&nbsp;</span>
385    </td><td class="summary">
386      <table width="100%" cellpadding="0" cellspacing="0" border="0">
387        <tr>
388          <td><span class="summary-sig"><a href="ndg.security.common.XMLSec.XMLSecDoc-class.html#applyEnvelopedSignature" class="summary-sig-name">applyEnvelopedSignature</a>(<span class="summary-sig-arg">self</span>,
389        <span class="summary-sig-arg">xmlTxt</span>=<span class="summary-sig-default">None</span>,
390        <span class="summary-sig-arg">inclX509Cert</span>=<span class="summary-sig-default">True</span>,
391        <span class="summary-sig-arg">refC14nKw</span>=<span class="summary-sig-default"><code class="variable-group">{</code><code class="variable-quote">'</code><code class="variable-string">unsuppressedPrefixes</code><code class="variable-quote">'</code><code class="variable-op">: </code><code class="variable-group">[</code><code class="variable-quote">'</code><code class="variable-string">xmlns</code><code class="variable-quote">'</code><code class="variable-group">]</code><code class="variable-group">}</code></span>,
392        <span class="summary-sig-arg">signedInfoC14nKw</span>=<span class="summary-sig-default"><code class="variable-group">{</code><code class="variable-quote">'</code><code class="variable-string">unsuppressedPrefixes</code><code class="variable-quote">'</code><code class="variable-op">: </code><code class="variable-group">[</code><code class="variable-quote">'</code><code class="variable-string">ds</code><code class="variable-quote">'</code><code class="variable-group">]</code><code class="variable-group">}</code></span>)</span><br />
393      Make enveloped signature of XML document
394
395@param xmlTxt: string buffer containing xml to be signed.</td>
396          <td align="right" valign="top">
397            <span class="codelink"><a href="ndg.security.common.XMLSec-pysrc.html#XMLSecDoc.applyEnvelopedSignature">source&nbsp;code</a></span>
398           
399          </td>
400        </tr>
401      </table>
402     
403    </td>
404  </tr>
405<tr>
406    <td width="15%" align="right" valign="top" class="summary">
407      <span class="summary-type">&nbsp;</span>
408    </td><td class="summary">
409      <table width="100%" cellpadding="0" cellspacing="0" border="0">
410        <tr>
411          <td><span class="summary-sig"><a href="ndg.security.common.XMLSec.XMLSecDoc-class.html#verifyEnvelopedSignature" class="summary-sig-name">verifyEnvelopedSignature</a>(<span class="summary-sig-arg">self</span>,
412        <span class="summary-sig-arg">xmlTxt</span>=<span class="summary-sig-default">None</span>)</span><br />
413      Verify enveloped signature of XML document.</td>
414          <td align="right" valign="top">
415            <span class="codelink"><a href="ndg.security.common.XMLSec-pysrc.html#XMLSecDoc.verifyEnvelopedSignature">source&nbsp;code</a></span>
416           
417          </td>
418        </tr>
419      </table>
420     
421    </td>
422  </tr>
423<tr>
424    <td width="15%" align="right" valign="top" class="summary">
425      <span class="summary-type">&nbsp;</span>
426    </td><td class="summary">
427      <table width="100%" cellpadding="0" cellspacing="0" border="0">
428        <tr>
429          <td><span class="summary-sig"><a href="ndg.security.common.XMLSec.XMLSecDoc-class.html#encrypt" class="summary-sig-name">encrypt</a>(<span class="summary-sig-arg">self</span>,
430        <span class="summary-sig-arg">xmlTxt</span>=<span class="summary-sig-default">None</span>,
431        <span class="summary-sig-arg">filePath</span>=<span class="summary-sig-default">None</span>,
432        <span class="summary-sig-arg">inclX509SubjName</span>=<span class="summary-sig-default">True</span>,
433        <span class="summary-sig-arg">inclX509IssSerial</span>=<span class="summary-sig-default">True</span>)</span><br />
434      Encrypt a document using recipient's public key</td>
435          <td align="right" valign="top">
436            <span class="codelink"><a href="ndg.security.common.XMLSec-pysrc.html#XMLSecDoc.encrypt">source&nbsp;code</a></span>
437           
438          </td>
439        </tr>
440      </table>
441     
442    </td>
443  </tr>
444<tr>
445    <td width="15%" align="right" valign="top" class="summary">
446      <span class="summary-type">&nbsp;</span>
447    </td><td class="summary">
448      <table width="100%" cellpadding="0" cellspacing="0" border="0">
449        <tr>
450          <td><span class="summary-sig"><a href="ndg.security.common.XMLSec.XMLSecDoc-class.html#decrypt" class="summary-sig-name">decrypt</a>(<span class="summary-sig-arg">self</span>,
451        <span class="summary-sig-arg">xmlTxt</span>=<span class="summary-sig-default">None</span>,
452        <span class="summary-sig-arg">filePath</span>=<span class="summary-sig-default">None</span>)</span><br />
453      Decrypt a document using a private key of public/private key
454      pair</td>
455          <td align="right" valign="top">
456            <span class="codelink"><a href="ndg.security.common.XMLSec-pysrc.html#XMLSecDoc.decrypt">source&nbsp;code</a></span>
457           
458          </td>
459        </tr>
460      </table>
461     
462    </td>
463  </tr>
464  <tr>
465    <td colspan="2" class="summary">
466    <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
467      <code>__delattr__</code>,
468      <code>__getattribute__</code>,
469      <code>__hash__</code>,
470      <code>__new__</code>,
471      <code>__reduce__</code>,
472      <code>__reduce_ex__</code>,
473      <code>__repr__</code>,
474      <code>__setattr__</code>
475      </p>
476    </td>
477  </tr>
478</table>
479<!-- ==================== CLASS VARIABLES ==================== -->
480<a name="section-ClassVariables"></a>
481<table class="summary" border="1" cellpadding="3"
482       cellspacing="0" width="100%" bgcolor="white">
483<tr bgcolor="#70b0f0" class="table-header">
484  <td colspan="2" class="table-header">
485    <table border="0" cellpadding="0" cellspacing="0" width="100%">
486      <tr valign="top">
487        <td align="left"><span class="table-header">Class Variables</span></td>
488        <td align="right" valign="top"
489         ><span class="options">[<a href="#section-ClassVariables"
490         class="privatelink" onclick="toggle_private();"
491         >hide private</a>]</span></td>
492      </tr>
493    </table>
494  </td>
495</tr>
496<tr class="private">
497    <td width="15%" align="right" valign="top" class="summary">
498      <span class="summary-type">&nbsp;</span>
499    </td><td class="summary">
500        <a name="__beginCert"></a><span class="summary-name">__beginCert</span> = <code title="'''-----BEGIN CERTIFICATE-----
501'''"><code class="variable-quote">'</code><code class="variable-string">-----BEGIN CERTIFICATE-----\n</code><code class="variable-quote">'</code></code>
502    </td>
503  </tr>
504<tr class="private">
505    <td width="15%" align="right" valign="top" class="summary">
506      <span class="summary-type">&nbsp;</span>
507    </td><td class="summary">
508        <a name="__endCert"></a><span class="summary-name">__endCert</span> = <code title="'''
509-----END CERTIFICATE-----'''"><code class="variable-quote">'</code><code class="variable-string">\n-----END CERTIFICATE-----</code><code class="variable-quote">'</code></code>
510    </td>
511  </tr>
512<tr class="private">
513    <td width="15%" align="right" valign="top" class="summary">
514      <span class="summary-type">regular expression pattern object</span>
515    </td><td class="summary">
516        <a href="ndg.security.common.XMLSec.XMLSecDoc-class.html#__x509CertPat" class="summary-name">__x509CertPat</a> = <code title="re.compile(r'(?s)-----BEGIN CERTIFICATE-----\n?(.*?)\n?-----END CERTIF\
517ICATE-----')">re.compile(r'<code class="re-flags">(?s)</code>-----BEGIN CERTIFICATE-----\n<code class="variable-ellipsis">...</code></code><br />
518      regular expression for extracting the base64 encoded portion of a
519      PEM encoded X.509 certificate
520    </td>
521  </tr>
522</table>
523<!-- ==================== PROPERTIES ==================== -->
524<a name="section-Properties"></a>
525<table class="summary" border="1" cellpadding="3"
526       cellspacing="0" width="100%" bgcolor="white">
527<tr bgcolor="#70b0f0" class="table-header">
528  <td colspan="2" class="table-header">
529    <table border="0" cellpadding="0" cellspacing="0" width="100%">
530      <tr valign="top">
531        <td align="left"><span class="table-header">Properties</span></td>
532        <td align="right" valign="top"
533         ><span class="options">[<a href="#section-Properties"
534         class="privatelink" onclick="toggle_private();"
535         >hide private</a>]</span></td>
536      </tr>
537    </table>
538  </td>
539</tr>
540<tr>
541    <td width="15%" align="right" valign="top" class="summary">
542      <span class="summary-type">&nbsp;</span>
543    </td><td class="summary">
544        <a href="ndg.security.common.XMLSec.XMLSecDoc-class.html#filePath" class="summary-name">filePath</a><br />
545      File Path for XML document to apply security to
546    </td>
547  </tr>
548<tr>
549    <td width="15%" align="right" valign="top" class="summary">
550      <span class="summary-type">&nbsp;</span>
551    </td><td class="summary">
552        <a href="ndg.security.common.XMLSec.XMLSecDoc-class.html#docNode" class="summary-name">docNode</a><br />
553      DOM document node for XML
554    </td>
555  </tr>
556<tr>
557    <td width="15%" align="right" valign="top" class="summary">
558      <span class="summary-type">&nbsp;</span>
559    </td><td class="summary">
560        <a href="ndg.security.common.XMLSec.XMLSecDoc-class.html#certFilePathList" class="summary-name">certFilePathList</a><br />
561      File Path of certificate used to sign document / list of
562      certificates used to check the signature of a doc
563    </td>
564  </tr>
565<tr>
566    <td width="15%" align="right" valign="top" class="summary">
567      <span class="summary-type">&nbsp;</span>
568    </td><td class="summary">
569        <a href="ndg.security.common.XMLSec.XMLSecDoc-class.html#signingKeyFilePath" class="summary-name">signingKeyFilePath</a><br />
570      path for private key file used to sign doc
571    </td>
572  </tr>
573<tr>
574    <td width="15%" align="right" valign="top" class="summary">
575      <span class="summary-type">&nbsp;</span>
576    </td><td class="summary">
577        <a href="ndg.security.common.XMLSec.XMLSecDoc-class.html#signingKeyPwd" class="summary-name">signingKeyPwd</a><br />
578      Password protecting private key file used to sign doc
579    </td>
580  </tr>
581<tr>
582    <td width="15%" align="right" valign="top" class="summary">
583      <span class="summary-type">&nbsp;</span>
584    </td><td class="summary">
585        <a href="ndg.security.common.XMLSec.XMLSecDoc-class.html#encrCertFilePath" class="summary-name">encrCertFilePath</a><br />
586      file path for certificate publiv key used to decrypt doc
587    </td>
588  </tr>
589<tr>
590    <td width="15%" align="right" valign="top" class="summary">
591      <span class="summary-type">&nbsp;</span>
592    </td><td class="summary">
593        <a href="ndg.security.common.XMLSec.XMLSecDoc-class.html#encrPriKeyFilePath" class="summary-name">encrPriKeyFilePath</a><br />
594      file path for certificate private key used to decrypt doc
595    </td>
596  </tr>
597  <tr>
598    <td colspan="2" class="summary">
599    <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
600      <code>__class__</code>
601      </p>
602    </td>
603  </tr>
604</table>
605<!-- ==================== METHOD DETAILS ==================== -->
606<a name="section-MethodDetails"></a>
607<table class="details" border="1" cellpadding="3"
608       cellspacing="0" width="100%" bgcolor="white">
609<tr bgcolor="#70b0f0" class="table-header">
610  <td colspan="2" class="table-header">
611    <table border="0" cellpadding="0" cellspacing="0" width="100%">
612      <tr valign="top">
613        <td align="left"><span class="table-header">Method Details</span></td>
614        <td align="right" valign="top"
615         ><span class="options">[<a href="#section-MethodDetails"
616         class="privatelink" onclick="toggle_private();"
617         >hide private</a>]</span></td>
618      </tr>
619    </table>
620  </td>
621</tr>
622</table>
623<a name="__init__"></a>
624<div>
625<table class="details" border="1" cellpadding="3"
626       cellspacing="0" width="100%" bgcolor="white">
627<tr><td>
628  <table width="100%" cellpadding="0" cellspacing="0" border="0">
629  <tr valign="top"><td>
630  <h3 class="epydoc"><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>,
631        <span class="sig-arg">filePath</span>=<span class="sig-default">None</span>,
632        <span class="sig-arg">signingKeyFilePath</span>=<span class="sig-default">None</span>,
633        <span class="sig-arg">signingKeyPwd</span>=<span class="sig-default">None</span>,
634        <span class="sig-arg">certFilePathList</span>=<span class="sig-default">None</span>,
635        <span class="sig-arg">encrCertFilePath</span>=<span class="sig-default">None</span>,
636        <span class="sig-arg">encrPriKeyFilePath</span>=<span class="sig-default">None</span>)</span>
637    <br /><em class="fname">(Constructor)</em>
638  </h3>
639  </td><td align="right" valign="top"
640    ><span class="codelink"><a href="ndg.security.common.XMLSec-pysrc.html#XMLSecDoc.__init__">source&nbsp;code</a></span>&nbsp;
641    </td>
642  </table>
643 
644  Initialisation -
645  <dl class="fields">
646    <dt>Parameters:</dt>
647    <dd><ul class="nomargin-top">
648        <li><strong class="pname"><code>filePath</code></strong> - file path for document</li>
649        <li><strong class="pname"><code>signingKeyFilePath</code></strong> - file path for private key used in signature</li>
650        <li><strong class="pname"><code>certFilePathList</code></strong> - list of certificates used in verification of a signed
651          document</li>
652        <li><strong class="pname"><code>encrCertFilePath</code></strong> - file path for X.509 cert used to encrypt the document - see
653          note for __setCertFilePathList() method</li>
654        <li><strong class="pname"><code>encrPriKeyFilePath</code></strong> - file path for private key used to decrypt previously encrypted
655          document</li>
656        <li><strong class="pname"><code>__beginCert</code></strong> (string) - delimiter for beginning of base64 encoded portion of a PEM
657          encoded X.509 certificate</li>
658    </ul></dd>
659    <dt>Overrides:
660      object.__init__
661    </dt>
662  </dl>
663</td></tr></table>
664</div>
665<a name="__str__"></a>
666<div>
667<table class="details" border="1" cellpadding="3"
668       cellspacing="0" width="100%" bgcolor="white">
669<tr><td>
670  <table width="100%" cellpadding="0" cellspacing="0" border="0">
671  <tr valign="top"><td>
672  <h3 class="epydoc"><span class="sig"><span class="sig-name">__str__</span>(<span class="sig-arg">self</span>)</span>
673    <br /><em class="fname">(Informal representation operator)</em>
674  </h3>
675  </td><td align="right" valign="top"
676    ><span class="codelink"><a href="ndg.security.common.XMLSec-pysrc.html#XMLSecDoc.__str__">source&nbsp;code</a></span>&nbsp;
677    </td>
678  </table>
679 
680  String representation of doc - only applies if doc had been read or
681  parsed
682  <dl class="fields">
683    <dt>Overrides:
684      object.__str__
685    </dt>
686  </dl>
687</td></tr></table>
688</div>
689<a name="__setFilePath"></a>
690<div class="private">
691<table class="details" border="1" cellpadding="3"
692       cellspacing="0" width="100%" bgcolor="white">
693<tr><td>
694  <table width="100%" cellpadding="0" cellspacing="0" border="0">
695  <tr valign="top"><td>
696  <h3 class="epydoc"><span class="sig"><span class="sig-name">__setFilePath</span>(<span class="sig-arg">self</span>,
697        <span class="sig-arg">filePath</span>)</span>
698  </h3>
699  </td><td align="right" valign="top"
700    ><span class="codelink"><a href="ndg.security.common.XMLSec-pysrc.html#XMLSecDoc.__setFilePath">source&nbsp;code</a></span>&nbsp;
701    </td>
702  </table>
703 
704  Set file path for file to be signed/verified/encrypted/decrypted
705  <dl class="fields">
706    <dt>Parameters:</dt>
707    <dd><ul class="nomargin-top">
708        <li><strong class="pname"><code>filePath</code></strong> - file path of XML doc</li>
709    </ul></dd>
710  </dl>
711</td></tr></table>
712</div>
713<a name="__setCertFilePathList"></a>
714<div class="private">
715<table class="details" border="1" cellpadding="3"
716       cellspacing="0" width="100%" bgcolor="white">
717<tr><td>
718  <table width="100%" cellpadding="0" cellspacing="0" border="0">
719  <tr valign="top"><td>
720  <h3 class="epydoc"><span class="sig"><span class="sig-name">__setCertFilePathList</span>(<span class="sig-arg">self</span>,
721        <span class="sig-arg">filePath</span>)</span>
722  </h3>
723  </td><td align="right" valign="top"
724    ><span class="codelink"><a href="ndg.security.common.XMLSec-pysrc.html#XMLSecDoc.__setCertFilePathList">source&nbsp;code</a></span>&nbsp;
725    </td>
726  </table>
727 
728  File path for certificate used to sign document / list of certificates
729  used to check the signature of a document
730  <dl class="fields">
731    <dt>Parameters:</dt>
732    <dd><ul class="nomargin-top">
733        <li><p><strong class="pname"><code>filePath</code></strong> - file path or list of file paths to files used to verify a
734          signature.  The first element should be the cert corresponding to
735          the proviate key used to make the signature. Successive certs in
736          the list correspond to the chain of trust e.g. if a proxy
737          cert/private key was used the list would be</p>
738          proxy cert., user cert which issued the proxy cert, CA cert
739          that issued the user cert</li>
740    </ul></dd>
741  </dl>
742</td></tr></table>
743</div>
744<a name="__setSigningKeyPwd"></a>
745<div class="private">
746<table class="details" border="1" cellpadding="3"
747       cellspacing="0" width="100%" bgcolor="white">
748<tr><td>
749  <table width="100%" cellpadding="0" cellspacing="0" border="0">
750  <tr valign="top"><td>
751  <h3 class="epydoc"><span class="sig"><span class="sig-name">__setSigningKeyPwd</span>(<span class="sig-arg">self</span>,
752        <span class="sig-arg">pwd</span>)</span>
753  </h3>
754  </td><td align="right" valign="top"
755    ><span class="codelink"><a href="ndg.security.common.XMLSec-pysrc.html#XMLSecDoc.__setSigningKeyPwd">source&nbsp;code</a></span>&nbsp;
756    </td>
757  </table>
758 
759  Set password to read private key from file
760  <dl class="fields">
761    <dt>Parameters:</dt>
762    <dd><ul class="nomargin-top">
763        <li><strong class="pname"><code>pwd</code></strong> - password protecting private key file - set to None if no
764          password is set</li>
765    </ul></dd>
766  </dl>
767</td></tr></table>
768</div>
769<a name="__setEncrCertFilePath"></a>
770<div class="private">
771<table class="details" border="1" cellpadding="3"
772       cellspacing="0" width="100%" bgcolor="white">
773<tr><td>
774  <table width="100%" cellpadding="0" cellspacing="0" border="0">
775  <tr valign="top"><td>
776  <h3 class="epydoc"><span class="sig"><span class="sig-name">__setEncrCertFilePath</span>(<span class="sig-arg">self</span>,
777        <span class="sig-arg">filePath</span>)</span>
778  </h3>
779  </td><td align="right" valign="top"
780    ><span class="codelink"><a href="ndg.security.common.XMLSec-pysrc.html#XMLSecDoc.__setEncrCertFilePath">source&nbsp;code</a></span>&nbsp;
781    </td>
782  </table>
783 
784  Set file path for X.509 certificate file containing public key used to
785  decrypt doc.
786  <dl class="fields">
787    <dt>Parameters:</dt>
788    <dd><ul class="nomargin-top">
789        <li><strong class="pname"><code>filePath</code></strong> - path to X.509 Certificate file</li>
790    </ul></dd>
791  </dl>
792</td></tr></table>
793</div>
794<a name="__setEncrPriKeyFilePath"></a>
795<div class="private">
796<table class="details" border="1" cellpadding="3"
797       cellspacing="0" width="100%" bgcolor="white">
798<tr><td>
799  <table width="100%" cellpadding="0" cellspacing="0" border="0">
800  <tr valign="top"><td>
801  <h3 class="epydoc"><span class="sig"><span class="sig-name">__setEncrPriKeyFilePath</span>(<span class="sig-arg">self</span>,
802        <span class="sig-arg">filePath</span>)</span>
803  </h3>
804  </td><td align="right" valign="top"
805    ><span class="codelink"><a href="ndg.security.common.XMLSec-pysrc.html#XMLSecDoc.__setEncrPriKeyFilePath">source&nbsp;code</a></span>&nbsp;
806    </td>
807  </table>
808 
809  Set file path for private key used to decrypt doc.
810  <dl class="fields">
811    <dt>Parameters:</dt>
812    <dd><ul class="nomargin-top">
813        <li><strong class="pname"><code>filePath</code></strong> - path to private key file</li>
814    </ul></dd>
815  </dl>
816</td></tr></table>
817</div>
818<a name="toString"></a>
819<div>
820<table class="details" border="1" cellpadding="3"
821       cellspacing="0" width="100%" bgcolor="white">
822<tr><td>
823  <table width="100%" cellpadding="0" cellspacing="0" border="0">
824  <tr valign="top"><td>
825  <h3 class="epydoc"><span class="sig"><span class="sig-name">toString</span>(<span class="sig-arg">self</span>,
826        <span class="sig-arg">inclXMLhdr</span>=<span class="sig-default">True</span>)</span>
827  </h3>
828  </td><td align="right" valign="top"
829    ><span class="codelink"><a href="ndg.security.common.XMLSec-pysrc.html#XMLSecDoc.toString">source&nbsp;code</a></span>&nbsp;
830    </td>
831  </table>
832 
833  Return certificate file content as a string
834  <dl class="fields">
835    <dt>Parameters:</dt>
836    <dd><ul class="nomargin-top">
837        <li><strong class="pname"><code>inclXMLhdr</code></strong> - boolean - set to true to include XML header @return content of
838          document as a string or None if the document has not been
839          parsed.</li>
840    </ul></dd>
841  </dl>
842</td></tr></table>
843</div>
844<a name="parse"></a>
845<div>
846<table class="details" border="1" cellpadding="3"
847       cellspacing="0" width="100%" bgcolor="white">
848<tr><td>
849  <table width="100%" cellpadding="0" cellspacing="0" border="0">
850  <tr valign="top"><td>
851  <h3 class="epydoc"><span class="sig"><span class="sig-name">parse</span>(<span class="sig-arg">self</span>,
852        <span class="sig-arg">xmlTxt</span>)</span>
853  </h3>
854  </td><td align="right" valign="top"
855    ><span class="codelink"><a href="ndg.security.common.XMLSec-pysrc.html#XMLSecDoc.parse">source&nbsp;code</a></span>&nbsp;
856    </td>
857  </table>
858 
859  Parse string containing XML into a DOM to allow signature or signature
860  validation
861  <dl class="fields">
862    <dt>Parameters:</dt>
863    <dd><ul class="nomargin-top">
864        <li><strong class="pname"><code>xmlTxt</code></strong> - text to be parsed</li>
865    </ul></dd>
866  </dl>
867</td></tr></table>
868</div>
869<a name="read"></a>
870<div>
871<table class="details" border="1" cellpadding="3"
872       cellspacing="0" width="100%" bgcolor="white">
873<tr><td>
874  <table width="100%" cellpadding="0" cellspacing="0" border="0">
875  <tr valign="top"><td>
876  <h3 class="epydoc"><span class="sig"><span class="sig-name">read</span>(<span class="sig-arg">self</span>,
877        <span class="sig-arg">stream</span>=<span class="sig-default">None</span>)</span>
878  </h3>
879  </td><td align="right" valign="top"
880    ><span class="codelink"><a href="ndg.security.common.XMLSec-pysrc.html#XMLSecDoc.read">source&nbsp;code</a></span>&nbsp;
881    </td>
882  </table>
883 
884  Read XML into a libxml2 document to allow signature validation
885  <dl class="fields">
886    <dt>Parameters:</dt>
887    <dd><ul class="nomargin-top">
888        <li><strong class="pname"><code>stream</code></strong> - read from a file stream object instead of self.__filePath</li>
889    </ul></dd>
890  </dl>
891</td></tr></table>
892</div>
893<a name="applyEnvelopedSignature"></a>
894<div>
895<table class="details" border="1" cellpadding="3"
896       cellspacing="0" width="100%" bgcolor="white">
897<tr><td>
898  <table width="100%" cellpadding="0" cellspacing="0" border="0">
899  <tr valign="top"><td>
900  <h3 class="epydoc"><span class="sig"><span class="sig-name">applyEnvelopedSignature</span>(<span class="sig-arg">self</span>,
901        <span class="sig-arg">xmlTxt</span>=<span class="sig-default">None</span>,
902        <span class="sig-arg">inclX509Cert</span>=<span class="sig-default">True</span>,
903        <span class="sig-arg">refC14nKw</span>=<span class="sig-default"><code class="variable-group">{</code><code class="variable-quote">'</code><code class="variable-string">unsuppressedPrefixes</code><code class="variable-quote">'</code><code class="variable-op">: </code><code class="variable-group">[</code><code class="variable-quote">'</code><code class="variable-string">xmlns</code><code class="variable-quote">'</code><code class="variable-group">]</code><code class="variable-group">}</code></span>,
904        <span class="sig-arg">signedInfoC14nKw</span>=<span class="sig-default"><code class="variable-group">{</code><code class="variable-quote">'</code><code class="variable-string">unsuppressedPrefixes</code><code class="variable-quote">'</code><code class="variable-op">: </code><code class="variable-group">[</code><code class="variable-quote">'</code><code class="variable-string">ds</code><code class="variable-quote">'</code><code class="variable-group">]</code><code class="variable-group">}</code></span>)</span>
905  </h3>
906  </td><td align="right" valign="top"
907    ><span class="codelink"><a href="ndg.security.common.XMLSec-pysrc.html#XMLSecDoc.applyEnvelopedSignature">source&nbsp;code</a></span>&nbsp;
908    </td>
909  </table>
910 
911  <pre class="literalblock">
912Make enveloped signature of XML document
913
914@param xmlTxt: string buffer containing xml to be signed. If not
915provided, calls XMLSecDoc.createXML().  This is a virtual method so
916must be defined in a derived class.
917                   
918@param inclX509Cert: include MIME encoded content of X.509
919certificate.  This can be used by the  recipient of the XML in order
920to verify the message
921
922@param refC14nKw: Keywords for canonicalization of the reference
923- for enveloped type signature this is the parent element of the XML
924document.  If the key 'unsuppressedPrefixes' is set to a list of
925element prefix strings, exclusive canonicalization will be applied. 
926To use inclusive canonicalization set 'unsuppressedPrefixes' to None
927 or set refC14nKw to None.
928 
929@param signedInfoC14nKw: keywords for canonicalization of the
930SignedInfo section of the signature.  See explanation for refC14nKw
931keyword for options.
932
933</pre>
934  <dl class="fields">
935  </dl>
936</td></tr></table>
937</div>
938<a name="verifyEnvelopedSignature"></a>
939<div>
940<table class="details" border="1" cellpadding="3"
941       cellspacing="0" width="100%" bgcolor="white">
942<tr><td>
943  <table width="100%" cellpadding="0" cellspacing="0" border="0">
944  <tr valign="top"><td>
945  <h3 class="epydoc"><span class="sig"><span class="sig-name">verifyEnvelopedSignature</span>(<span class="sig-arg">self</span>,
946        <span class="sig-arg">xmlTxt</span>=<span class="sig-default">None</span>)</span>
947  </h3>
948  </td><td align="right" valign="top"
949    ><span class="codelink"><a href="ndg.security.common.XMLSec-pysrc.html#XMLSecDoc.verifyEnvelopedSignature">source&nbsp;code</a></span>&nbsp;
950    </td>
951  </table>
952 
953  Verify enveloped signature of XML document.  Raises InvalidSignature
954  exception if the signature is invalid
955  <dl class="fields">
956    <dt>Parameters:</dt>
957    <dd><ul class="nomargin-top">
958        <li><strong class="pname"><code>xmlTxt</code></strong> (string) - text from the XML file to be checked.  If omitted, the the
959          existing parse document is used instead.</li>
960    </ul></dd>
961  </dl>
962</td></tr></table>
963</div>
964<a name="encrypt"></a>
965<div>
966<table class="details" border="1" cellpadding="3"
967       cellspacing="0" width="100%" bgcolor="white">
968<tr><td>
969  <table width="100%" cellpadding="0" cellspacing="0" border="0">
970  <tr valign="top"><td>
971  <h3 class="epydoc"><span class="sig"><span class="sig-name">encrypt</span>(<span class="sig-arg">self</span>,
972        <span class="sig-arg">xmlTxt</span>=<span class="sig-default">None</span>,
973        <span class="sig-arg">filePath</span>=<span class="sig-default">None</span>,
974        <span class="sig-arg">inclX509SubjName</span>=<span class="sig-default">True</span>,
975        <span class="sig-arg">inclX509IssSerial</span>=<span class="sig-default">True</span>)</span>
976  </h3>
977  </td><td align="right" valign="top"
978    ><span class="codelink"><a href="ndg.security.common.XMLSec-pysrc.html#XMLSecDoc.encrypt">source&nbsp;code</a></span>&nbsp;
979    </td>
980  </table>
981 
982  <p>Encrypt a document using recipient's public key</p>
983  Encrypts xml file using a dynamically created template, a session
984  triple DES key and an RSA key from keys manager.
985  <dl class="fields">
986    <dt>Parameters:</dt>
987    <dd><ul class="nomargin-top">
988        <li><strong class="pname"><code>xmlTxt</code></strong> - string buffer containing the text from the XML file to be
989          encrypted.  If omitted, the filePath argument is used
990          instead.</li>
991        <li><strong class="pname"><code>filePath</code></strong> - file path to XML file to be encrypted.  This argument is used
992          if no xmlTxt was provided.  If filePath itself is omitted the
993          file set by self.__filePath is read instead.</li>
994        <li><strong class="pname"><code>inclX509SubjName</code></strong> - include subject name of signing X.509 certificate.</li>
995        <li><strong class="pname"><code>inclX509IssSerial</code></strong> - include issuer name and serial number in signature</li>
996    </ul></dd>
997  </dl>
998</td></tr></table>
999</div>
1000<a name="decrypt"></a>
1001<div>
1002<table class="details" border="1" cellpadding="3"
1003       cellspacing="0" width="100%" bgcolor="white">
1004<tr><td>
1005  <table width="100%" cellpadding="0" cellspacing="0" border="0">
1006  <tr valign="top"><td>
1007  <h3 class="epydoc"><span class="sig"><span class="sig-name">decrypt</span>(<span class="sig-arg">self</span>,
1008        <span class="sig-arg">xmlTxt</span>=<span class="sig-default">None</span>,
1009        <span class="sig-arg">filePath</span>=<span class="sig-default">None</span>)</span>
1010  </h3>
1011  </td><td align="right" valign="top"
1012    ><span class="codelink"><a href="ndg.security.common.XMLSec-pysrc.html#XMLSecDoc.decrypt">source&nbsp;code</a></span>&nbsp;
1013    </td>
1014  </table>
1015 
1016  Decrypt a document using a private key of public/private key pair
1017  <dl class="fields">
1018    <dt>Parameters:</dt>
1019    <dd><ul class="nomargin-top">
1020        <li><strong class="pname"><code>xmlTxt</code></strong> - string buffer containing the text from the XML file to be
1021          decrypted.  If omitted, the filePath argument is used
1022          instead.</li>
1023        <li><strong class="pname"><code>filePath</code></strong> - file path to XML file to be decrypted.  This argument is used
1024          if no xmlTxt was provided.  If filePath itself is omitted the
1025          file set by self.__filePath is read instead.</li>
1026    </ul></dd>
1027  </dl>
1028</td></tr></table>
1029</div>
1030<br />
1031<!-- ==================== CLASS VARIABLE DETAILS ==================== -->
1032<a name="section-ClassVariableDetails"></a>
1033<table class="details" border="1" cellpadding="3"
1034       cellspacing="0" width="100%" bgcolor="white">
1035<tr bgcolor="#70b0f0" class="table-header">
1036  <td colspan="2" class="table-header">
1037    <table border="0" cellpadding="0" cellspacing="0" width="100%">
1038      <tr valign="top">
1039        <td align="left"><span class="table-header">Class Variable Details</span></td>
1040        <td align="right" valign="top"
1041         ><span class="options">[<a href="#section-ClassVariableDetails"
1042         class="privatelink" onclick="toggle_private();"
1043         >hide private</a>]</span></td>
1044      </tr>
1045    </table>
1046  </td>
1047</tr>
1048</table>
1049<a name="__x509CertPat"></a>
1050<div class="private">
1051<table class="details" border="1" cellpadding="3"
1052       cellspacing="0" width="100%" bgcolor="white">
1053<tr><td>
1054  <h3 class="epydoc">__x509CertPat</h3>
1055  regular expression for extracting the base64 encoded portion of a PEM
1056  encoded X.509 certificate
1057  <dl class="fields">
1058    <dt>Type:</dt>
1059      <dd>regular expression pattern object</dd>
1060  </dl>
1061  <dl class="fields">
1062    <dt>Value:</dt>
1063      <dd><table><tr><td><pre class="variable">
1064re.compile(r'<code class="re-flags">(?s)</code>-----BEGIN CERTIFICATE-----\n<code class="re-op">?</code><code class="re-group">(</code>.<code class="re-op">*?</code><code class="re-group">)</code>\n<code class="re-op">?</code>-----END CERTIF<span class="variable-linewrap"><img src="crarr.png" alt="\" /></span>
1065ICATE-----')
1066</pre></td></tr></table>
1067</dd>
1068  </dl>
1069</td></tr></table>
1070</div>
1071<br />
1072<!-- ==================== PROPERTY DETAILS ==================== -->
1073<a name="section-PropertyDetails"></a>
1074<table class="details" border="1" cellpadding="3"
1075       cellspacing="0" width="100%" bgcolor="white">
1076<tr bgcolor="#70b0f0" class="table-header">
1077  <td colspan="2" class="table-header">
1078    <table border="0" cellpadding="0" cellspacing="0" width="100%">
1079      <tr valign="top">
1080        <td align="left"><span class="table-header">Property Details</span></td>
1081        <td align="right" valign="top"
1082         ><span class="options">[<a href="#section-PropertyDetails"
1083         class="privatelink" onclick="toggle_private();"
1084         >hide private</a>]</span></td>
1085      </tr>
1086    </table>
1087  </td>
1088</tr>
1089</table>
1090<a name="filePath"></a>
1091<div>
1092<table class="details" border="1" cellpadding="3"
1093       cellspacing="0" width="100%" bgcolor="white">
1094<tr><td>
1095  <h3 class="epydoc">filePath</h3>
1096  File Path for XML document to apply security to
1097  <dl class="fields">
1098    <dt>Get Method:</dt>
1099    <dd class="value"><span class="summary-sig"><a href="ndg.security.common.XMLSec.XMLSecDoc-class.html#__getFilePath" class="summary-sig-name">ndg.security.common.XMLSec.XMLSecDoc.__getFilePath</a>(<span class="summary-sig-arg">self</span>)</span>
1100        - Get file path for file to be signed/encrypted.
1101    </dd>
1102    <dt>Set Method:</dt>
1103    <dd class="value"><span class="summary-sig"><a href="ndg.security.common.XMLSec.XMLSecDoc-class.html#__setFilePath" class="summary-sig-name">ndg.security.common.XMLSec.XMLSecDoc.__setFilePath</a>(<span class="summary-sig-arg">self</span>,
1104        <span class="summary-sig-arg">filePath</span>)</span>
1105        - Set file path for file to be
1106      signed/verified/encrypted/decrypted
1107    </dd>
1108    <dt>Delete Method:</dt>
1109    <dd class="value"><span class="summary-sig"><a href="ndg.security.common.XMLSec.XMLSecDoc-class.html#__delFilePath" class="summary-sig-name">ndg.security.common.XMLSec.XMLSecDoc.__delFilePath</a>(<span class="summary-sig-arg">self</span>)</span>
1110        - Prevent file path being deleted.
1111    </dd>
1112  </dl>
1113</td></tr></table>
1114</div>
1115<a name="docNode"></a>
1116<div>
1117<table class="details" border="1" cellpadding="3"
1118       cellspacing="0" width="100%" bgcolor="white">
1119<tr><td>
1120  <h3 class="epydoc">docNode</h3>
1121  DOM document node for XML
1122  <dl class="fields">
1123    <dt>Get Method:</dt>
1124    <dd class="value"><span class="summary-sig"><a href="ndg.security.common.XMLSec.XMLSecDoc-class.html#__getDocNode" class="summary-sig-name">ndg.security.common.XMLSec.XMLSecDoc.__getDocNode</a>(<span class="summary-sig-arg">self</span>)</span>
1125        - Get file path for file to be signed/encrypted.
1126    </dd>
1127    <dt>Delete Method:</dt>
1128    <dd class="value"><span class="summary-sig"><a href="ndg.security.common.XMLSec.XMLSecDoc-class.html#__delDocNode" class="summary-sig-name">ndg.security.common.XMLSec.XMLSecDoc.__delDocNode</a>(<span class="summary-sig-arg">self</span>)</span>
1129        - Prevent file path being deleted.
1130    </dd>
1131  </dl>
1132</td></tr></table>
1133</div>
1134<a name="certFilePathList"></a>
1135<div>
1136<table class="details" border="1" cellpadding="3"
1137       cellspacing="0" width="100%" bgcolor="white">
1138<tr><td>
1139  <h3 class="epydoc">certFilePathList</h3>
1140  File Path of certificate used to sign document / list of certificates
1141  used to check the signature of a doc
1142  <dl class="fields">
1143    <dt>Set Method:</dt>
1144    <dd class="value"><span class="summary-sig"><a href="ndg.security.common.XMLSec.XMLSecDoc-class.html#__setCertFilePathList" class="summary-sig-name">ndg.security.common.XMLSec.XMLSecDoc.__setCertFilePathList</a>(<span class="summary-sig-arg">self</span>,
1145        <span class="summary-sig-arg">filePath</span>)</span>
1146        - File path for certificate used to sign document / list of
1147      certificates used to check the signature of a document
1148    </dd>
1149  </dl>
1150</td></tr></table>
1151</div>
1152<a name="signingKeyFilePath"></a>
1153<div>
1154<table class="details" border="1" cellpadding="3"
1155       cellspacing="0" width="100%" bgcolor="white">
1156<tr><td>
1157  <h3 class="epydoc">signingKeyFilePath</h3>
1158  path for private key file used to sign doc
1159  <dl class="fields">
1160    <dt>Set Method:</dt>
1161    <dd class="value"><span class="summary-sig"><a href="ndg.security.common.XMLSec.XMLSecDoc-class.html#__setSigningKeyFilePath" class="summary-sig-name">ndg.security.common.XMLSec.XMLSecDoc.__setSigningKeyFilePath</a>(<span class="summary-sig-arg">self</span>,
1162        <span class="summary-sig-arg">filePath</span>)</span>
1163        - Set file path for certificate private key used to sign doc.
1164    </dd>
1165  </dl>
1166</td></tr></table>
1167</div>
1168<a name="signingKeyPwd"></a>
1169<div>
1170<table class="details" border="1" cellpadding="3"
1171       cellspacing="0" width="100%" bgcolor="white">
1172<tr><td>
1173  <h3 class="epydoc">signingKeyPwd</h3>
1174  Password protecting private key file used to sign doc
1175  <dl class="fields">
1176    <dt>Set Method:</dt>
1177    <dd class="value"><span class="summary-sig"><a href="ndg.security.common.XMLSec.XMLSecDoc-class.html#__setSigningKeyPwd" class="summary-sig-name">ndg.security.common.XMLSec.XMLSecDoc.__setSigningKeyPwd</a>(<span class="summary-sig-arg">self</span>,
1178        <span class="summary-sig-arg">pwd</span>)</span>
1179        - Set password to read private key from file
1180    </dd>
1181  </dl>
1182</td></tr></table>
1183</div>
1184<a name="encrCertFilePath"></a>
1185<div>
1186<table class="details" border="1" cellpadding="3"
1187       cellspacing="0" width="100%" bgcolor="white">
1188<tr><td>
1189  <h3 class="epydoc">encrCertFilePath</h3>
1190  file path for certificate publiv key used to decrypt doc
1191  <dl class="fields">
1192    <dt>Set Method:</dt>
1193    <dd class="value"><span class="summary-sig"><a href="ndg.security.common.XMLSec.XMLSecDoc-class.html#__setEncrCertFilePath" class="summary-sig-name">ndg.security.common.XMLSec.XMLSecDoc.__setEncrCertFilePath</a>(<span class="summary-sig-arg">self</span>,
1194        <span class="summary-sig-arg">filePath</span>)</span>
1195        - Set file path for X.509 certificate file containing public key
1196      used to decrypt doc.
1197    </dd>
1198  </dl>
1199</td></tr></table>
1200</div>
1201<a name="encrPriKeyFilePath"></a>
1202<div>
1203<table class="details" border="1" cellpadding="3"
1204       cellspacing="0" width="100%" bgcolor="white">
1205<tr><td>
1206  <h3 class="epydoc">encrPriKeyFilePath</h3>
1207  file path for certificate private key used to decrypt doc
1208  <dl class="fields">
1209    <dt>Set Method:</dt>
1210    <dd class="value"><span class="summary-sig"><a href="ndg.security.common.XMLSec.XMLSecDoc-class.html#__setEncrPriKeyFilePath" class="summary-sig-name">ndg.security.common.XMLSec.XMLSecDoc.__setEncrPriKeyFilePath</a>(<span class="summary-sig-arg">self</span>,
1211        <span class="summary-sig-arg">filePath</span>)</span>
1212        - Set file path for private key used to decrypt doc.
1213    </dd>
1214  </dl>
1215</td></tr></table>
1216</div>
1217<br />
1218<!-- ==================== NAVIGATION BAR ==================== -->
1219<table class="navbar" border="0" width="100%" cellpadding="0"
1220       bgcolor="#a0c0ff" cellspacing="0">
1221  <tr valign="middle">
1222  <!-- Home link -->
1223      <th>&nbsp;&nbsp;&nbsp;<a
1224        href="ndg-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
1225
1226  <!-- Tree link -->
1227      <th>&nbsp;&nbsp;&nbsp;<a
1228        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
1229
1230  <!-- Index link -->
1231      <th>&nbsp;&nbsp;&nbsp;<a
1232        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
1233
1234  <!-- Help link -->
1235      <th>&nbsp;&nbsp;&nbsp;<a
1236        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
1237
1238  <!-- Project homepage -->
1239      <th class="navbar" align="right" width="100%">
1240        <table border="0" cellpadding="0" cellspacing="0">
1241          <tr><th class="navbar" align="center"
1242            >NDG Security</th>
1243          </tr></table></th>
1244  </tr>
1245</table>
1246<table border="0" cellpadding="0" cellspacing="0" width="100%%">
1247  <tr>
1248    <td align="left" class="footer">
1249    <a href="epydoc-log.html">Generated by Epydoc
1250    3.0beta1 on Mon Dec 17 09:22:45 2007</a>
1251    </td>
1252    <td align="right" class="footer">
1253      <a href="http://epydoc.sourceforge.net">http://epydoc.sourceforge.net</a>
1254    </td>
1255  </tr>
1256</table>
1257
1258<script type="text/javascript">
1259  <!--
1260  // Private objects are initially displayed (because if
1261  // javascript is turned off then we want them to be
1262  // visible); but by default, we want to hide them.  So hide
1263  // them unless we have a cookie that says to show them.
1264  checkCookie()
1265  // -->
1266</script>
1267 
1268</body>
1269</html>
Note: See TracBrowser for help on using the repository browser.