Class HexSupport

java.lang.Object
net.shibboleth.shared.codec.HexSupport

public final class HexSupport extends Object
Helper class for working with hex encoding/decoding of binary data.

This wraps the current commons-codec implementation to insulate calling code from the specific implementation for future revision.

Since:
9.3.0
  • Constructor Details

    • HexSupport

      private HexSupport()
      Constructor.
  • Method Details

    • encodeLowerCase

      @Nonnull public static String encodeLowerCase(@Nonnull byte[] data)
      Hex-encodes the given binary data into lower case characters.
      Parameters:
      data - data to encode
      Returns:
      the hex-encoded data
    • encodeUpperCase

      @Nonnull public static String encodeUpperCase(@Nonnull byte[] data)
      Hex-encodes the given binary data into upper case characters.
      Parameters:
      data - data to encode
      Returns:
      the hex-encoded data
    • decode

      @Nonnull public static byte[] decode(@Nonnull String data) throws DecodingException
      Decodes hex-encoded data back into binary.
      Parameters:
      data - hex-encoded string
      Returns:
      the decoded data
      Throws:
      DecodingException - if unable to decode