Package org.bouncycastle.crypto.params

## Class HKDFParameters

- java.lang.Object
- - org.bouncycastle.crypto.params.HKDFParameters

- All Implemented Interfaces:
    `DerivationParameters`

      public class HKDFParameters
      extends java.lang.Object
      implements DerivationParameters

  Parameter class for the HKDFBytesGenerator class.

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `HKDFParameters​(byte[] ikm, byte[] salt, byte[] info)` | Generates parameters for HKDF, specifying both the optional salt and optional info.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static HKDFParameters` | `defaultParameters​(byte[] ikm)` |
    `byte[]` | `getIKM()` | Returns the input keying material or seed.
    `byte[]` | `getInfo()` | Returns the info field, which may be empty (null is converted to empty).
    `byte[]` | `getSalt()` | Returns the salt, or null if the salt should be generated as a byte array of HashLen zeros.
    `boolean` | `skipExtract()` | Returns if step 1: extract has to be skipped or not
    `static HKDFParameters` | `skipExtractParameters​(byte[] ikm, byte[] info)` | Factory method that makes the HKDF skip the extract part of the key derivation function.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### 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