java.lang.Object
org.apache.xml.security.encryption.params.KeyDerivationParameters
org.apache.xml.security.encryption.params.HKDFParams

public class HKDFParams extends KeyDerivationParameters
Class HKDFParams (HKDF parameter) is used to specify parameters for the HMAC-based Extract-and-Expand Key Derivation Function.
See Also:
  • Constructor Details

    • HKDFParams

      protected HKDFParams(int keyBitLength, String hmacHashAlgorithm)
      Constructor HKDFParams with specified digest algorithm.
      Parameters:
      keyBitLength - the length of the derived key in bits
      hmacHashAlgorithm - the HMAC hash algorithm to use for the key derivation
  • Method Details

    • getHmacHashAlgorithm

      public String getHmacHashAlgorithm()
      Method return the digest algorithm URI. In case of algorithm is not set, the "default" algorithm http://www.w3.org/2001/04/xmldsig-more#hmac-sha256 URI algorithm is returned.
      Returns:
      the hmac algorithm
    • setHmacHashAlgorithm

      public void setHmacHashAlgorithm(String hmacHashAlgorithm)
      Method set the digest algorithm URI.
      Parameters:
      hmacHashAlgorithm - the hmac algorithm URI
    • getSalt

      public byte[] getSalt()
      Method return the salt value which is used for the key derivation.
      Returns:
      the salt value
    • setSalt

      public void setSalt(byte[] salt)
      Method set the salt value which is used for the key derivation.
      Parameters:
      salt -
    • getInfo

      public byte[] getInfo()
      Method return the info value which is used for the key derivation.
      Returns:
      the info value
    • setInfo

      public void setInfo(byte[] info)
      Method set the info value which is used for the key derivation.
      Parameters:
      info -
    • createBuilder

      public static HKDFParams.Builder createBuilder(int keyBitLength, String hmacHashAlgorithm)
      Method create a new builder for the HKDFParams.
      Parameters:
      keyBitLength - the length of the derived key in bits
      hmacHashAlgorithm - the HMAC hash algorithm URI to use for the key derivation
      Returns:
      a new builder instance