File: classXSECPlatformUtils.html

package info (click to toggle)
xml-security-c 1.2.1-3
  • links: PTS
  • area: main
  • in suites: etch-m68k
  • size: 24,464 kB
  • ctags: 6,673
  • sloc: cpp: 36,830; xml: 23,415; sh: 2,365; makefile: 340; perl: 221
file content (296 lines) | stat: -rw-r--r-- 15,583 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>XML-Security-C: XSECPlatformUtils Class Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.4.2 -->
<div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="hierarchy.html">Class&nbsp;Hierarchy</a> | <a class="qindex" href="annotated.html">Class&nbsp;List</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Class&nbsp;Members</a> | <a class="qindex" href="globals.html">File&nbsp;Members</a> | <a class="qindex" href="pages.html">Related&nbsp;Pages</a></div>
<h1>XSECPlatformUtils Class Reference<br>
<small>
[<a class="el" href="group__internal.html">Internal Classes</a>]</small>
</h1><code>#include &lt;<a class="el" href="XSECPlatformUtils_8hpp-source.html">XSECPlatformUtils.hpp</a>&gt;</code>
<p>
Collaboration diagram for XSECPlatformUtils:<p><center><img src="classXSECPlatformUtils__coll__graph.png" border="0" usemap="#XSECPlatformUtils__coll__map" alt="Collaboration graph"></center>
<map name="XSECPlatformUtils__coll__map">
<area href="classXSECCryptoProvider.html" shape="rect" coords="7,9,157,33" alt="">
<area href="classXSECAlgorithmMapper.html" shape="rect" coords="181,9,341,33" alt="">
</map>
<center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center><a href="classXSECPlatformUtils-members.html">List of all members.</a><hr><a name="_details"></a><h2>Detailed Description</h2>
High level library interface class. 
<p>
This class is used primarily to initialise the library and communicate high level parameters that will be common to all objects from the class in any given session.<p>
It is primarily a static class. 
<p>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Static Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classXSECPlatformUtils.html#e0">Initialise</a> (<a class="el" href="classXSECCryptoProvider.html">XSECCryptoProvider</a> *p=NULL)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Initialise the library.  <a href="#e0"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classXSECPlatformUtils.html#e1">SetCryptoProvider</a> (<a class="el" href="classXSECCryptoProvider.html">XSECCryptoProvider</a> *p)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set a new crypto provider.  <a href="#e1"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classXSECPlatformUtils.html#e2">registerAlgorithmHandler</a> (const XMLCh *uri, const <a class="el" href="classXSECAlgorithmHandler.html">XSECAlgorithmHandler</a> &amp;handler)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Add a new algorithm Handler.  <a href="#e2"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classXSECPlatformUtils.html#e3">Terminate</a> (void)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Terminate.  <a href="#e3"></a><br></td></tr>
<tr><td colspan="2"><br><h2>Static Public Attributes</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classXSECPlatformUtils.html#s0">initCount</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Number of times initialise has been called.  <a href="#s0"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static <a class="el" href="classXSECCryptoProvider.html">XSECCryptoProvider</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classXSECPlatformUtils.html#s1">g_cryptoProvider</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The main cryptographic provider.  <a href="#s1"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static const <a class="el" href="classXSECAlgorithmMapper.html">XSECAlgorithmMapper</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classXSECPlatformUtils.html#s2">g_algorithmMapper</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The global Algorithm Mapper.  <a href="#s2"></a><br></td></tr>
</table>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="e0" doxytag="XSECPlatformUtils::Initialise"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">static void XSECPlatformUtils::Initialise           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="classXSECCryptoProvider.html">XSECCryptoProvider</a> *&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>p</em> = <code>NULL</code>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap><code> [static]</code></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Initialise the library. 
<p>
<b>Must</b> be called prior to using any functions in the library.<p>
Primarily sets up static variables used by all classes in the library.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>p</em>&nbsp;</td><td>A pointer to a <a class="el" href="classXSECCryptoProvider.html">XSECCryptoProvider</a> object that the library should use for cryptographic functions. If p == NULL, the library will instantiate an <a class="el" href="classOpenSSLCryptoProvider.html">OpenSSLCryptoProvider</a> object. </td></tr>
  </table>
</dl>
    </td>
  </tr>
</table>
<a class="anchor" name="e2" doxytag="XSECPlatformUtils::registerAlgorithmHandler"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">static void XSECPlatformUtils::registerAlgorithmHandler           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">const XMLCh *&nbsp;</td>
          <td class="mdname" nowrap> <em>uri</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>const <a class="el" href="classXSECAlgorithmHandler.html">XSECAlgorithmHandler</a> &amp;&nbsp;</td>
          <td class="mdname" nowrap> <em>handler</em></td>
        </tr>
        <tr>
          <td class="md"></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"><code> [static]</code></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Add a new algorithm Handler. 
<p>
Application developers can extend the <a class="el" href="classXSECAlgorithmHandler.html">XSECAlgorithmHandler</a> class to implement new cryptographic algorithms. This will then allow the library to call the provided handler whenever trying to process a type it doesn't understand.<p>
Any handler previously registered for this URI will be overwritten, allowing callers to overwrite the handlers for default URIs.<p>
<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="classXSECAlgorithmHandler.html">XSECAlgorithmHandler</a> </dd></dl>
<dl compact><dt><b>Note:</b></dt><dd>This is <b>not</b> thread safe. Algorithm handlers should be added prior to any processing of signatures etc. </dd></dl>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>uri</em>&nbsp;</td><td>Type URI that maps to this handler </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>handler</em>&nbsp;</td><td>The handler to be used whenever this URI is seen by the library. </td></tr>
  </table>
</dl>
    </td>
  </tr>
</table>
<a class="anchor" name="e1" doxytag="XSECPlatformUtils::SetCryptoProvider"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">static void XSECPlatformUtils::SetCryptoProvider           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="classXSECCryptoProvider.html">XSECCryptoProvider</a> *&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>p</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap><code> [static]</code></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Set a new crypto provider. 
<p>
Set the crypto provider to the value passed in. Any current provider is deleted.<p>
<dl compact><dt><b>Note:</b></dt><dd>This is not thread-safe. It should be called prior to any real usage of the library.</dd></dl>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>p</em>&nbsp;</td><td>A pointer to a <a class="el" href="classXSECCryptoProvider.html">XSECCryptoProvider</a> object that the library should use for cryptographic functions. </td></tr>
  </table>
</dl>
<dl compact><dt><b>Note:</b></dt><dd>Ownership of the provider is passed to the library, which will delete it at Termination. </dd></dl>
    </td>
  </tr>
</table>
<a class="anchor" name="e3" doxytag="XSECPlatformUtils::Terminate"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">static void XSECPlatformUtils::Terminate           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">void&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap><code> [static]</code></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Terminate. 
<p>
Should be called prior to any program exist to allow the library to cleanly delete any memory associated with the library as a whole.<p>
<dl compact><dt><b>Note:</b></dt><dd>Do not call this function while any xml-security-c object remain instantiated. The results of doing so is undefined, and could cause bad results. </dd></dl>
    </td>
  </tr>
</table>
<hr><h2>Member Data Documentation</h2>
<a class="anchor" name="s2" doxytag="XSECPlatformUtils::g_algorithmMapper"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">const <a class="el" href="classXSECAlgorithmMapper.html">XSECAlgorithmMapper</a>* <a class="el" href="classXSECPlatformUtils.html#s2">XSECPlatformUtils::g_algorithmMapper</a><code> [static]</code>          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
The global Algorithm Mapper. 
<p>
The algorithm mapper is used to map algorithm type URI strings to algorithm implementations. Note that this is a level of indirection above actual cryptographic algorithms. For example:<p>
URI = <a href="http://www.w3.org/2001/04/xmlenc#tripledes-cbc">http://www.w3.org/2001/04/xmlenc#tripledes-cbc</a><p>
is the URI for 3DES in CBC mode. The mapper will return an algorithm handler that understands what this means in terms of IVs and how to call the <a class="el" href="classXSECCryptoKey.html">XSECCryptoKey</a> interface. It then uses the cryptographic provider to actually perform the encryption.<p>
This allows applications to provide new algorithm types. The mapper is used to map the type string to the means of doing the encryption, and a new <a class="el" href="classXSECCryptoKey.html">XSECCryptoKey</a> derivative can be provided to perform the actual crypo work.<p>
<dl compact><dt><b>Note:</b></dt><dd>The provider should only be added to via the XSECPlatformUtils::addAlgorithmHandler() call.</dd></dl>
<dl compact><dt><b>See also:</b></dt><dd>#addAlgorithmHandler() </dd></dl>
    </td>
  </tr>
</table>
<a class="anchor" name="s1" doxytag="XSECPlatformUtils::g_cryptoProvider"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"><a class="el" href="classXSECCryptoProvider.html">XSECCryptoProvider</a>* <a class="el" href="classXSECPlatformUtils.html#s1">XSECPlatformUtils::g_cryptoProvider</a><code> [static]</code>          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
The main cryptographic provider. 
<p>
This pointer can be used to determine the primary crypto provider registered in the library.<p>
Individual signatures can over-ride this default.     </td>
  </tr>
</table>
<a class="anchor" name="s0" doxytag="XSECPlatformUtils::initCount"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">int <a class="el" href="classXSECPlatformUtils.html#s0">XSECPlatformUtils::initCount</a><code> [static]</code>          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Number of times initialise has been called. 
<p>
initCount can be read by any class or function to determine how many times the library has been initialised.     </td>
  </tr>
</table>
<hr>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="XSECPlatformUtils_8hpp-source.html">XSECPlatformUtils.hpp</a></ul>
<hr size="1"><address style="align: right;"><small>Generated on Sun Jul 3 17:45:50 2005 for XML-Security-C by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.2 </small></address>
</body>
</html>