md5md5
Security
Home > Books > NetKernel API and Services Reference > Accessor Listing > Security Extensions > md5

Rate this page:
Really useful
Satisfactory
Not helpful
Confusing
Incorrect
Unsure
Extra comments:


Module

urn:org:ten60:netkernel:ext:xsecurity

The md5 accessor is exported by the urn:org:ten60:netkernel:ext:xsecurity module. Import this module to gain access to the accessor.

Syntax

URI
active:md5

ArgumentRulesDescription
operandOptional required the resource to be hashed
operatorOptional n/a
paramOptional n/a

Example Usage

DPML

<instr>
  <type>md5</type>
  <operand>foo.xml</operand>
  <target>this:response</target>
</instr>

NetKernel Foundation API

req=context.createSubRequest("active:md5");
result=context.issueSubRequest(req);

Purpose

The md5 accessor generates an MD5 hash of the operand document. The result is a document with a root element <md5> containing the md5 hash. Here is an example:

<md5>6BBE1AF635E1CFC43006390B791D710F</md5>

Note: The md5 accessor is ideal for hashing short sensitive documents such as passwords whose source document is known to be reproducible. One must be cautious when using md5 with longer documents or when the result has undergone external serialization.

The operand document is serialized using the default serializer. For documents generated and processed internally it can be assumed that two identical documents will generate an identical hash value - it is therefore possible to use the md5 accessor to hash passwords etc. It cannot be assumed that a document that has been externally serialized or in other ways processed will generate a repeatable hash value. For documents that undergo external processing the xsign accessor should be used in combination with a canonical serializer

Example

Hash a password document

This crude example shows how the md5 accessor can be used to hash a short password document. We don't recommend passwords in literals or sending the result to the response!!

<instr>
  <type>md5</type>
  <operand>
    <password>foobar</password>
  </operand>
  <target>this:response</target>
</instr>

References

xsign accessor
Apache XML Security
W3C XML Signature


(C) 2003, 1060 Research Limited
© 2003-2007, 1060 Research Limited. 1060 registered trademark, NetKernel trademark of 1060 Research Limited.