Class HKDFParams.Builder

  • Enclosing class:
    HKDFParams

    public static class HKDFParams.Builder
    extends java.lang.Object
    This class is used to create HKDF configuration parameters HKDFParams. The key length and HMAC hash algorithm are required parameters.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected Builder​(int keyBitLength, java.lang.String hmacHashAlgorithm)
      Constructor for the HKDFParams builder.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      HKDFParams build()
      Build the HKDFParams instance with the configured parameters.
      HKDFParams.Builder info​(byte[] info)
      Set the (optional) info value which is used for the key derivation.
      HKDFParams.Builder salt​(byte[] salt)
      Set the (optional) salt value which is used for the key derivation.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • keyBitLength

        private final int keyBitLength
      • hmacHashAlgorithm

        private final java.lang.String hmacHashAlgorithm
      • salt

        private byte[] salt
      • info

        private byte[] info
    • Constructor Detail

      • Builder

        protected Builder​(int keyBitLength,
                          java.lang.String hmacHashAlgorithm)
        Constructor for the HKDFParams builder. The key bit length and HMAC hash algorithm are required parameters.
        Parameters:
        keyBitLength - the length of the derived key in bits
        hmacHashAlgorithm - the HMAC hash algorithm URI to use for the key derivation
    • Method Detail

      • salt

        public HKDFParams.Builder salt​(byte[] salt)
        Set the (optional) salt value which is used for the key derivation.
        Parameters:
        salt - the hkdf salt value
        Returns:
        the self updated builder instance
      • info

        public HKDFParams.Builder info​(byte[] info)
        Set the (optional) info value which is used for the key derivation.
        Parameters:
        info - the hkdf info value
        Returns:
        the self updated builder instance
      • build

        public HKDFParams build()
        Build the HKDFParams instance with the configured parameters.
        Returns:
        the configured HKDFParams instance