Class HKDFParameters

java.lang.Object
org.bouncycastle.crypto.params.HKDFParameters
All Implemented Interfaces:
DerivationParameters

public class HKDFParameters extends 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

    Modifier and Type
    Method
    Description
    defaultParameters(byte[] ikm)
     
    byte[]
    Returns the input keying material or seed.
    byte[]
    Returns the info field, which may be empty (null is converted to empty).
    byte[]
    Returns the salt, or null if the salt should be generated as a byte array of HashLen zeros.
    boolean
    Returns if step 1: extract has to be skipped or not
    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 Details

    • 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 Details

    • 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