Class PBKDF2Params

  • All Implemented Interfaces:
    ASN1Encodable, Encodable

    public class PBKDF2Params
    extends ASN1Object
         PBKDF2-params ::= SEQUENCE {
                   salt CHOICE {
                          specified OCTET STRING,
                          otherSource AlgorithmIdentifier {{PBKDF2-SaltSources}}
                   },
                  iterationCount INTEGER (1..MAX),
                  keyLength INTEGER (1..MAX) OPTIONAL,
                  prf AlgorithmIdentifier {{PBKDF2-PRFs}} DEFAULT algid-hmacWithSHA1 }
     
    • Constructor Detail

      • PBKDF2Params

        public PBKDF2Params​(byte[] salt,
                            int iterationCount)
        Create a PBKDF2Params with the specified salt, iteration count, and algid-hmacWithSHA1 for the prf.
        Parameters:
        salt - input salt.
        iterationCount - input iteration count.
      • PBKDF2Params

        public PBKDF2Params​(byte[] salt,
                            int iterationCount,
                            int keyLength)
        Create a PBKDF2Params with the specified salt, iteration count, keyLength, and algid-hmacWithSHA1 for the prf.
        Parameters:
        salt - input salt.
        iterationCount - input iteration count.
        keyLength - intended key length to be produced.
      • PBKDF2Params

        public PBKDF2Params​(byte[] salt,
                            int iterationCount,
                            int keyLength,
                            AlgorithmIdentifier prf)
        Create a PBKDF2Params with the specified salt, iteration count, keyLength, and a defined prf.
        Parameters:
        salt - input salt.
        iterationCount - input iteration count.
        keyLength - intended key length to be produced.
        prf - the pseudo-random function to use.
      • PBKDF2Params

        public PBKDF2Params​(byte[] salt,
                            int iterationCount,
                            AlgorithmIdentifier prf)
        Create a PBKDF2Params with the specified salt, iteration count, and a defined prf.
        Parameters:
        salt - input salt.
        iterationCount - input iteration count.
        prf - the pseudo-random function to use.
    • Method Detail

      • getInstance

        public static PBKDF2Params getInstance​(java.lang.Object obj)
        Create PBKDF2Params from the passed in object,
        Parameters:
        obj - either PBKDF2Params or an ASN1Sequence.
        Returns:
        a PBKDF2Params instance.
      • getSalt

        public byte[] getSalt()
        Return the salt to use.
        Returns:
        the input salt.
      • getIterationCount

        public java.math.BigInteger getIterationCount()
        Return the iteration count to use.
        Returns:
        the input iteration count.
      • getKeyLength

        public java.math.BigInteger getKeyLength()
        Return the intended length in octets of the derived key.
        Returns:
        length in octets for derived key, if specified.
      • isDefaultPrf

        public boolean isDefaultPrf()
        Return true if the PRF is the default (hmacWithSHA1)
        Returns:
        true if PRF is default, false otherwise.
      • getPrf

        public AlgorithmIdentifier getPrf()
        Return the algId of the underlying pseudo random function to use.
        Returns:
        the prf algorithm identifier.