Class PRFParams


  • @Immutable
    public final class PRFParams
    extends java.lang.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 Summary

      Constructors 
      Constructor Description
      PRFParams​(java.lang.String jcaMacAlg, java.security.Provider macProvider, int dkLen)
      Creates a new pseudo-random function parameters instance.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getDerivedKeyByteLength()
      Returns the byte length of the key to derive.
      java.lang.String getMACAlgorithm()
      Returns the JCA MAC algorithm name.
      java.security.Provider getMacProvider()
      Returns the JCA MAC provider.
      static PRFParams resolve​(JWEAlgorithm alg, java.security.Provider macProvider)
      Resolves the Pseudo-Random Function (PRF) parameters for the specified PBES2 JWE algorithm.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PRFParams

        public PRFParams​(java.lang.String jcaMacAlg,
                         java.security.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 java.lang.String getMACAlgorithm()
        Returns the JCA MAC algorithm name.
        Returns:
        The JCA MAC algorithm name.
      • getMacProvider

        public java.security.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,
                                        java.security.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.