Package iu.crypt

Class EncodingUtils

java.lang.Object
iu.crypt.EncodingUtils

class EncodingUtils extends Object
Provides basic internal binary encoding behavior for JSON web crypto algorithms.
  • Method Details

    • bigEndian

      static void bigEndian(int value, ByteBuffer buffer)
      Copies an 32-bit integer into a ByteBuffer
      Parameters:
      value - integer to encode
      buffer - ByteBuffer
    • bigEndian

      static void bigEndian(long value, ByteBuffer buffer)
      Copies an 64-bit long into a ByteBuffer
      Parameters:
      value - integer to encode
      buffer - ByteBuffer
    • concatKdfFragment

      static void concatKdfFragment(byte[] data, ByteBuffer buffer)
      Encodes data in NIST.800-56A Concatenated Key Derivation Format (KDF).
      Parameters:
      data - data to encode
      buffer - ByteBuffer
    • concatKdf

      static byte[] concatKdf(int round, byte[] z, byte[] algid, byte[] uinfo, byte[] vinfo, int datalen)
      Gets the hash input data for one round of the NIST.800-56A Section 5.8.1 Concatenated Key Derivation Format (KDF)
      Parameters:
      round - round number
      z - key derivation output
      algid - algorithm ID
      uinfo - party UInfo value
      vinfo - party VInfo value
      datalen - data length
      Returns:
      Concat KDF hash input
    • reverse

      static byte[] reverse(byte[] bytes)
      Reverses byte order
      Parameters:
      bytes - big-endian data (or vice-versa)
      Returns:
      little-endian data (or vice-versa)