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

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

Working unit tests for WSGI based Attribute Authority.

  • Altered so that all Attribute Config is picked up from the Paste ini file. Separate cfg or xml based config file is still supported.

TODO:

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