org.nees.util
Class HexEncoder

java.lang.Object
  extended byorg.nees.util.HexEncoder

public class HexEncoder
extends java.lang.Object

This is an implementation-neutral hex encoder. It's currently implemented using the apache xml security utils.


Constructor Summary
HexEncoder()
           
 
Method Summary
static byte[] decode(java.lang.String encoded)
          Decode a hex-encoded octet string.
static java.lang.String encode(byte[] octets)
          Return a hex encoded version of the octet string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HexEncoder

public HexEncoder()
Method Detail

encode

public static java.lang.String encode(byte[] octets)
Return a hex encoded version of the octet string. Hex digits a-f are encoded as lowercase. There are no spaces between octet representations. For instance it will return "a8f08c", rather than "A8F08C" or "A8 F0 8C".


decode

public static byte[] decode(java.lang.String encoded)
Decode a hex-encoded octet string. Hex digits a-f are encoded as lowercase. There are no spaces between octet representations. For instance it requires "a8f08c", rather than "A8F08C" or "A8 F0 8C".

Parameters:
encoded - the encoded octet string
Returns:
the decoded octet string