Class PRFParams


  • @Immutable
    public final class PRFParams
    extends Object
    Pseudo-Random Function (PRF) parameters, intended for use in the Password- Based Key Derivation Function 2 (PBKDF2).
    Version:
    2015-05-26
    Author:
    Vladimir Dzhuvinov
    • Constructor Detail

      • PRFParams

        public PRFParams​(String jcaMacAlg,
                         Provider macProvider,
                         int dkLen)
        Creates a new pseudo-random function parameters instance.
        Parameters:
        jcaMacAlg - The JCA MAC algorithm name. Must not be null.
        macProvider - The JCA MAC provider, null to use the default one.
        dkLen - The byte length of the key to derive.
    • Method Detail

      • getMACAlgorithm

        public String getMACAlgorithm()
        Returns the JCA MAC algorithm name.
        Returns:
        The JCA MAC algorithm name.
      • getMacProvider

        public Provider getMacProvider()
        Returns the JCA MAC provider.
        Returns:
        The JCA MAC provider, null to use the default one.
      • getDerivedKeyByteLength

        public int getDerivedKeyByteLength()
        Returns the byte length of the key to derive.
        Returns:
        The byte length of the key to derive.
      • resolve

        public static PRFParams resolve​(JWEAlgorithm alg,
                                        Provider macProvider)
                                 throws JOSEException
        Resolves the Pseudo-Random Function (PRF) parameters for the specified PBES2 JWE algorithm.
        Parameters:
        alg - The JWE algorithm. Must be supported and not null.
        macProvider - The specific MAC JCA provider, null to use the default one.
        Returns:
        The PRF parameters.
        Throws:
        JOSEException - If the JWE algorithm is not supported.