Difference between revisions of "Cryptographic Module"

From BaseX Documentation
Jump to navigation Jump to search
m
m
Line 8: Line 8:
 
|-
 
|-
 
| valign='top' width='90' | '''Signatures'''
 
| valign='top' width='90' | '''Signatures'''
|<code><b>crypto:hmac</b>($message as xs:string(), $secret-key as xs:string(), algorithm as xs:string()) as xs:string()</code>
+
|<code><b>crypto:hmac</b>($message as xs:string(), $secret-key as xs:string(), algorithm as xs:string()) as xs:string()</code><br/><code><b>crypto:hmac</b>($message as xs:string(), $secret-key as xs:string(), algorithm as xs:string(), $encoding as xs:string()) as xs:string()</code>
 
|-
 
|-
 
| valign='top' | '''Summary'''
 
| valign='top' | '''Summary'''
|This function creates a message authentication code via a cryptographic hash function and a secret key.
+
|Creates a message authentication code via a cryptographic hash function and a secret key. $encoding must either be <code>hex</code>, <code>base64</code> or the empty string (default is <code>base64</code>) and specifies the encoding of the returned authentication code.
 
|-
 
|-
 
| valign='top' | '''Errors'''
 
| valign='top' | '''Errors'''
 
|<b>?</b>
 
|<b>?</b>
 
|}
 
|}

Revision as of 14:21, 6 October 2011

The cryptographic module is based on an early draft of the EXPath Cryptographic Module and provides the following functionality:

  1. Creation of message authentication codes (HMAC)
  2. Creation and validation of an XML Digital Signature
  3. Encryption and decryption

crypto:hmac

Signatures crypto:hmac($message as xs:string(), $secret-key as xs:string(), algorithm as xs:string()) as xs:string()
crypto:hmac($message as xs:string(), $secret-key as xs:string(), algorithm as xs:string(), $encoding as xs:string()) as xs:string()
Summary Creates a message authentication code via a cryptographic hash function and a secret key. $encoding must either be hex, base64 or the empty string (default is base64) and specifies the encoding of the returned authentication code.
Errors ?