Module org.apache.santuario.xmlsec
Class HKDFParams
- java.lang.Object
-
- org.apache.xml.security.encryption.params.KeyDerivationParameters
-
- org.apache.xml.security.encryption.params.HKDFParams
-
public class HKDFParams extends KeyDerivationParameters
Class HKDFParams (HKDF parameter) is used to specify parameters for the HMAC-based Extract-and-Expand Key Derivation Function.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classHKDFParams.BuilderThis class is used to create HKDF configuration parametersHKDFParams.
-
Constructor Summary
Constructors Modifier Constructor Description protectedHKDFParams(int keyBitLength, String hmacHashAlgorithm)Constructor HKDFParams with specified digest algorithm.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static HKDFParams.BuildercreateBuilder(int keyBitLength, String hmacHashAlgorithm)Method create a new builder for the HKDFParams.StringgetHmacHashAlgorithm()Method return the digest algorithm URI.byte[]getInfo()Method return the info value which is used for the key derivation.byte[]getSalt()Method return the salt value which is used for the key derivation.voidsetHmacHashAlgorithm(String hmacHashAlgorithm)Method set the digest algorithm URI.voidsetInfo(byte[] info)Method set the info value which is used for the key derivation.voidsetSalt(byte[] salt)Method set the salt value which is used for the key derivation.-
Methods inherited from class org.apache.xml.security.encryption.params.KeyDerivationParameters
getAlgorithm, getKeyBitLength, getKeyLength
-
-
-
-
Constructor Detail
-
HKDFParams
protected HKDFParams(int keyBitLength, String hmacHashAlgorithm)Constructor HKDFParams with specified digest algorithm.- Parameters:
keyBitLength- the length of the derived key in bitshmacHashAlgorithm- the HMAC hash algorithm to use for the key derivation
-
-
Method Detail
-
getHmacHashAlgorithm
public String getHmacHashAlgorithm()
Method return the digest algorithm URI. In case of algorithm is not set, the "default" algorithm http://www.w3.org/2001/04/xmldsig-more#hmac-sha256 URI algorithm is returned.- Returns:
- the hmac algorithm
-
setHmacHashAlgorithm
public void setHmacHashAlgorithm(String hmacHashAlgorithm)
Method set the digest algorithm URI.- Parameters:
hmacHashAlgorithm- the hmac algorithm URI
-
getSalt
public byte[] getSalt()
Method return the salt value which is used for the key derivation.- Returns:
- the salt value
-
setSalt
public void setSalt(byte[] salt)
Method set the salt value which is used for the key derivation.- Parameters:
salt-
-
getInfo
public byte[] getInfo()
Method return the info value which is used for the key derivation.- Returns:
- the info value
-
setInfo
public void setInfo(byte[] info)
Method set the info value which is used for the key derivation.- Parameters:
info-
-
createBuilder
public static HKDFParams.Builder createBuilder(int keyBitLength, String hmacHashAlgorithm)
Method create a new builder for the HKDFParams.- Parameters:
keyBitLength- the length of the derived key in bitshmacHashAlgorithm- the HMAC hash algorithm URI to use for the key derivation- Returns:
- a new builder instance
-
-