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 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366
|
<!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: XSECAlgorithmHandler 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 Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="annotated.html">Class List</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Class Members</a> | <a class="qindex" href="globals.html">File Members</a> | <a class="qindex" href="pages.html">Related Pages</a></div>
<h1>XSECAlgorithmHandler Class Reference<br>
<small>
[<a class="el" href="group__xenc.html">XML Encryption Implementation</a>]</small>
</h1><code>#include <<a class="el" href="XSECAlgorithmHandler_8hpp-source.html">XSECAlgorithmHandler.hpp</a>></code>
<p>
<a href="classXSECAlgorithmHandler-members.html">List of all members.</a><hr><a name="_details"></a><h2>Detailed Description</h2>
Interface class to provide handlers for processing different encryption types.
<p>
The <a class="el" href="classXENCCipher.html">XENCCipher</a> class allows users and callers to register algorithm handlers for different Type URIs, as defined in the EncryptionMethod element within XML Encryption.<p>
A default handler (XENCAlgorithmHandlerDefault) is provided by the library, and is used to process all algorithms defined as mandatory (and many optional) within the standard.<p>
Users can extend this class to provide custom algorithm handlers for their own classes.<p>
<dl compact><dt><b>Note:</b></dt><dd>The library will use a single clone of any provided object for a given algorithm. So all implementation classes <b>must</b> be thread safe! </dd></dl>
<p>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
<tr><td colspan="2"><div class="groupHeader">Constructors and Destructors</div></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual </td><td class="memItemRight" valign="bottom"><a class="el" href="classXSECAlgorithmHandler.html#z185_0">~XSECAlgorithmHandler</a> ()</td></tr>
<tr><td colspan="2"><div class="groupHeader">Encryption Methods</div></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classXSECAlgorithmHandler.html#z186_0">encryptToSafeBuffer</a> (<a class="el" href="classTXFMChain.html">TXFMChain</a> *plainText, <a class="el" href="classXENCEncryptionMethod.html">XENCEncryptionMethod</a> *<a class="el" href="DSIGConstants_8hpp.html#a107">encryptionMethod</a>, <a class="el" href="classXSECCryptoKey.html">XSECCryptoKey</a> *key, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *doc, <a class="el" href="classsafeBuffer.html">safeBuffer</a> &result)=0</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Encrypt an input Transform chain to a <a class="el" href="classsafeBuffer.html">safeBuffer</a>. <a href="#z186_0"></a><br></td></tr>
<tr><td colspan="2"><div class="groupHeader">Decryption Methods</div></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual unsigned int </td><td class="memItemRight" valign="bottom"><a class="el" href="classXSECAlgorithmHandler.html#z187_0">decryptToSafeBuffer</a> (<a class="el" href="classTXFMChain.html">TXFMChain</a> *cipherText, <a class="el" href="classXENCEncryptionMethod.html">XENCEncryptionMethod</a> *<a class="el" href="DSIGConstants_8hpp.html#a107">encryptionMethod</a>, <a class="el" href="classXSECCryptoKey.html">XSECCryptoKey</a> *key, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *doc, <a class="el" href="classsafeBuffer.html">safeBuffer</a> &result)=0</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Decrypt an input Transform chain to a <a class="el" href="classsafeBuffer.html">safeBuffer</a>. <a href="#z187_0"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classXSECAlgorithmHandler.html#z187_1">appendDecryptCipherTXFM</a> (<a class="el" href="classTXFMChain.html">TXFMChain</a> *cipherText, <a class="el" href="classXENCEncryptionMethod.html">XENCEncryptionMethod</a> *<a class="el" href="DSIGConstants_8hpp.html#a107">encryptionMethod</a>, <a class="el" href="classXSECCryptoKey.html">XSECCryptoKey</a> *key, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *doc)=0</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Append an appropriate decrypt TXFMer to a cipher txfm chain. <a href="#z187_1"></a><br></td></tr>
<tr><td colspan="2"><div class="groupHeader">Key handling</div></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual <a class="el" href="classXSECCryptoKey.html">XSECCryptoKey</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classXSECAlgorithmHandler.html#z188_0">createKeyForURI</a> (const XMLCh *uri, unsigned char *keyBuffer, unsigned int keyLen)=0</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Create a key that will support a given URI. <a href="#z188_0"></a><br></td></tr>
<tr><td colspan="2"><div class="groupHeader">Miscellaneous Functions</div></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual <a class="el" href="classXSECAlgorithmHandler.html">XSECAlgorithmHandler</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classXSECAlgorithmHandler.html#z189_0">clone</a> (void) const =0</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Create a new instance of the handler. <a href="#z189_0"></a><br></td></tr>
</table>
<hr><h2>Constructor & Destructor Documentation</h2>
<a class="anchor" name="z185_0" doxytag="XSECAlgorithmHandler::~XSECAlgorithmHandler"></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">virtual XSECAlgorithmHandler::~XSECAlgorithmHandler </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap><code> [inline, virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
</td>
</tr>
</table>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="z187_1" doxytag="XSECAlgorithmHandler::appendDecryptCipherTXFM"></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">virtual bool XSECAlgorithmHandler::appendDecryptCipherTXFM </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="el" href="classTXFMChain.html">TXFMChain</a> * </td>
<td class="mdname" nowrap> <em>cipherText</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap><a class="el" href="classXENCEncryptionMethod.html">XENCEncryptionMethod</a> * </td>
<td class="mdname" nowrap> <em>encryptionMethod</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap><a class="el" href="classXSECCryptoKey.html">XSECCryptoKey</a> * </td>
<td class="mdname" nowrap> <em>key</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * </td>
<td class="mdname" nowrap> <em>doc</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">) </td>
<td class="md" colspan="2"><code> [pure virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Append an appropriate decrypt TXFMer to a cipher txfm chain.
<p>
This method takes a <a class="el" href="classTXFMChain.html">TXFMChain</a> that will provide the cipher text data, and appends the appropriate cipher transformer to decrypt the output.<p>
The EncryptionMethod object is provided so that any algorithm specific parameters can be found by the processor. It also allows applications to embed multiple algorithms in a single processing object. The Type value can then be read from the EncryptionMethod object to determine what to do.<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>cipherText</em> </td><td>Chain that will provide the cipherText. Ownership remains with the caller - do not delete. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>encryptionMethod</em> </td><td>Information about the algorithm to use </td></tr>
<tr><td valign="top"></td><td valign="top"><em>key</em> </td><td>The key that has been determined via a resolver or that has been provided by the calling application. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>doc</em> </td><td>Document from which to create XML Nodes </td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>The resulting BinInputStream </dd></dl>
</td>
</tr>
</table>
<a class="anchor" name="z189_0" doxytag="XSECAlgorithmHandler::clone"></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">virtual <a class="el" href="classXSECAlgorithmHandler.html">XSECAlgorithmHandler</a>* XSECAlgorithmHandler::clone </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">void </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap> const<code> [pure virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Create a new instance of the handler.
<p>
Provides a means for the library to create a new instance of the object without knowing its type </td>
</tr>
</table>
<a class="anchor" name="z188_0" doxytag="XSECAlgorithmHandler::createKeyForURI"></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">virtual <a class="el" href="classXSECCryptoKey.html">XSECCryptoKey</a>* XSECAlgorithmHandler::createKeyForURI </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">const XMLCh * </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>unsigned char * </td>
<td class="mdname" nowrap> <em>keyBuffer</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>unsigned int </td>
<td class="mdname" nowrap> <em>keyLen</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">) </td>
<td class="md" colspan="2"><code> [pure virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Create a key that will support a given URI.
<p>
Given a URI string and a raw bit string, create the associated key<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>uri</em> </td><td>URI string to match key to </td></tr>
<tr><td valign="top"></td><td valign="top"><em>keyBuffer</em> </td><td>Raw bits to set in the key </td></tr>
<tr><td valign="top"></td><td valign="top"><em>keyLen</em> </td><td>Number of bytes in the key </td></tr>
</table>
</dl>
</td>
</tr>
</table>
<a class="anchor" name="z187_0" doxytag="XSECAlgorithmHandler::decryptToSafeBuffer"></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">virtual unsigned int XSECAlgorithmHandler::decryptToSafeBuffer </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="el" href="classTXFMChain.html">TXFMChain</a> * </td>
<td class="mdname" nowrap> <em>cipherText</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap><a class="el" href="classXENCEncryptionMethod.html">XENCEncryptionMethod</a> * </td>
<td class="mdname" nowrap> <em>encryptionMethod</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap><a class="el" href="classXSECCryptoKey.html">XSECCryptoKey</a> * </td>
<td class="mdname" nowrap> <em>key</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * </td>
<td class="mdname" nowrap> <em>doc</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap><a class="el" href="classsafeBuffer.html">safeBuffer</a> & </td>
<td class="mdname" nowrap> <em>result</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">) </td>
<td class="md" colspan="2"><code> [pure virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Decrypt an input Transform chain to a <a class="el" href="classsafeBuffer.html">safeBuffer</a>.
<p>
This method takes a <a class="el" href="classTXFMChain.html">TXFMChain</a> that will provide the cipher text data, and places the output in a <a class="el" href="classsafeBuffer.html">safeBuffer</a>.<p>
The EncryptionMethod object is provided so that any algorithm specific parameters can be found by the processor. It also allows applications to embed multiple algorithms in a single processing object. The Type value can then be read from the EncryptionMethod object to determine what to do.<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>cipherText</em> </td><td>Chain that will provide the cipherText. Ownership remains with the caller - do not delete. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>encryptionMethod</em> </td><td>Information about the algorithm to use </td></tr>
<tr><td valign="top"></td><td valign="top"><em>key</em> </td><td>The key that has been determined via a resolver or that has been provided by the calling application. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>doc</em> </td><td>Document in which to operate </td></tr>
<tr><td valign="top"></td><td valign="top"><em>result</em> </td><td>SafeBuffer object to place result into </td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>The number of plain bytes placed in the <a class="el" href="classsafeBuffer.html">safeBuffer</a> </dd></dl>
</td>
</tr>
</table>
<a class="anchor" name="z186_0" doxytag="XSECAlgorithmHandler::encryptToSafeBuffer"></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">virtual bool XSECAlgorithmHandler::encryptToSafeBuffer </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="el" href="classTXFMChain.html">TXFMChain</a> * </td>
<td class="mdname" nowrap> <em>plainText</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap><a class="el" href="classXENCEncryptionMethod.html">XENCEncryptionMethod</a> * </td>
<td class="mdname" nowrap> <em>encryptionMethod</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap><a class="el" href="classXSECCryptoKey.html">XSECCryptoKey</a> * </td>
<td class="mdname" nowrap> <em>key</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * </td>
<td class="mdname" nowrap> <em>doc</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap><a class="el" href="classsafeBuffer.html">safeBuffer</a> & </td>
<td class="mdname" nowrap> <em>result</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">) </td>
<td class="md" colspan="2"><code> [pure virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Encrypt an input Transform chain to a <a class="el" href="classsafeBuffer.html">safeBuffer</a>.
<p>
This method takes a <a class="el" href="classTXFMChain.html">TXFMChain</a> that will provide the plain text data, and places the encrypted and base64 encoded output in a <a class="el" href="classsafeBuffer.html">safeBuffer</a>.<p>
The EncryptionMethod object is provided so that any algorithm specific parameters can be embedded by the processor. Default parameters can be set directly (OAEParams and KeySize). Anything additional will need to be set within the DOM directly.<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>plainText</em> </td><td>Chain that will provide the plain bytes. Ownership remains with the caller - do not delete. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>encryptionMethod</em> </td><td>Information about the algorithm to use. Can also be used to set the required encryption parameters </td></tr>
<tr><td valign="top"></td><td valign="top"><em>key</em> </td><td>The key that has been provided by the calling application to perform the encryption.</td></tr>
<tr><td valign="top"></td><td valign="top"><em>doc</em> </td><td>Document in which to operate </td></tr>
<tr><td valign="top"></td><td valign="top"><em>result</em> </td><td>SafeBuffer object to place result into </td></tr>
</table>
</dl>
<dl compact><dt><b>Note:</b></dt><dd>This is not quite the symmetric opposite of decryptToSafeBuffer because of the way the library uses transformers. It is expected that this method will create a <a class="el" href="classsafeBuffer.html">safeBuffer</a> with <b>base64</b> encoded data. (It's easier to throw a <a class="el" href="classTXFMBase64.html">TXFMBase64</a> txfmer on the end of the chain than to do the encryption and then separately base64 encode.) </dd></dl>
</td>
</tr>
</table>
<hr>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="XSECAlgorithmHandler_8hpp-source.html">XSECAlgorithmHandler.hpp</a></ul>
<hr size="1"><address style="align: right;"><small>Generated on Sun Jul 3 17:45:09 2005 for XML-Security-C by
<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>
|