Class XmlSafeSaltedHashCodec

java.lang.Object
org.exoplatform.web.security.hash.XmlSafeSaltedHashCodec
All Implemented Interfaces:
SaltedHashCodec

public class XmlSafeSaltedHashCodec extends Object implements SaltedHashCodec
A codec able to transform a SaltedHash to and from String. The string representations produced by encode(SaltedHash) are granted to be valid XML element names if the length of byte arrays returned by SaltedHash.getSalt() and SaltedHash.getHash() is divisible by 12. This important because encode(SaltedHash) uses the URL safe variant of Byte64 encoding (see Base64) and for byte array lengths other than 12, the string encoded by Byte64 would have to be padded with character '*' which would make the result an invalid XML name.