The security.HexBinary class includes methods for encoding to hexadecimal or decoding from hexadecimal.