Package org.opensaml.xmlsec.derivation
Class KeyDerivationSupport
- java.lang.Object
-
- org.opensaml.xmlsec.derivation.KeyDerivationSupport
-
public final class KeyDerivationSupport extends Object
Support key derivation operations.
-
-
Constructor Summary
Constructors Modifier Constructor Description privateKeyDerivationSupport()Constructor.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static IntegergetEffectiveKeyLength(String algorithmURI, Integer specifiedKeyLength)Get the effective key length based on the specified algorithm URI and the specified key length, if present.static StringgetJCAKeyAlgorithm(String algorithmURI)Get the JCA key algorithm which corresponds to the specified algorithm URI.
-
-
-
Method Detail
-
getJCAKeyAlgorithm
@Nonnull public static String getJCAKeyAlgorithm(@Nonnull String algorithmURI) throws KeyDerivationException
Get the JCA key algorithm which corresponds to the specified algorithm URI.- Parameters:
algorithmURI- the algorithm URI with which the derived key will be user- Returns:
- the JCA key algorithm
- Throws:
KeyDerivationException- if key algorithm could not be determined
-
getEffectiveKeyLength
@Nonnull public static Integer getEffectiveKeyLength(@Nonnull String algorithmURI, @Nullable Integer specifiedKeyLength) throws KeyDerivationException
Get the effective key length based on the specified algorithm URI and the specified key length, if present.If the algorithm URI implies a key length and the specified key length is non-null, the lengths must match or an exception will be thrown. If the algorithm URI does not imply a key length and the specified length is null, and exception will be thrown.
- Parameters:
algorithmURI- the algorithm URI with which the derived key will be usedspecifiedKeyLength- an explicitly specified key length- Returns:
- the effective key length
- Throws:
KeyDerivationException- if algorithm and specified key lengths are not consistent
-
-