Class HKDFParameters

    • Constructor Detail

      • HKDFParameters

        public HKDFParameters​(byte[] ikm,
                              byte[] salt,
                              byte[] info)
        Generates parameters for HKDF, specifying both the optional salt and optional info. Step 1: Extract won't be skipped.
        Parameters:
        ikm - the input keying material or seed
        salt - the salt to use, may be null for a salt for hashLen zeros
        info - the info to use, may be null for an info field of zero bytes
    • Method Detail

      • skipExtractParameters

        public static HKDFParameters skipExtractParameters​(byte[] ikm,
                                                           byte[] info)
        Factory method that makes the HKDF skip the extract part of the key derivation function.
        Parameters:
        ikm - the input keying material or seed, directly used for step 2: Expand
        info - the info to use, may be null for an info field of zero bytes
        Returns:
        HKDFParameters that makes the implementation skip step 1
      • defaultParameters

        public static HKDFParameters defaultParameters​(byte[] ikm)
      • getIKM

        public byte[] getIKM()
        Returns the input keying material or seed.
        Returns:
        the keying material
      • skipExtract

        public boolean skipExtract()
        Returns if step 1: extract has to be skipped or not
        Returns:
        true for skipping, false for no skipping of step 1
      • getSalt

        public byte[] getSalt()
        Returns the salt, or null if the salt should be generated as a byte array of HashLen zeros.
        Returns:
        the salt, or null
      • getInfo

        public byte[] getInfo()
        Returns the info field, which may be empty (null is converted to empty).
        Returns:
        the info field, never null