Package org.opensaml.xmlsec.derivation
Interface KeyDerivation
-
- All Superinterfaces:
KeyAgreementParameter
public interface KeyDerivation extends KeyAgreementParameter
Component which represents a specific key derivation algorithm, and supports deriving a newSecretKeyvia that algorithm.Sub-types will usually contain additional configurable property inputs to the derivation operation.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description SecretKeyderive(byte[] secret, String keyAlgorithm, Integer keyLength)Derive aSecretKeyfrom the specified secret.StringgetAlgorithm()The key derivation algorithm URI.
-
-
-
Method Detail
-
getAlgorithm
@Nonnull String getAlgorithm()
The key derivation algorithm URI.- Returns:
- the algorithm
-
derive
@Nonnull SecretKey derive(@Nonnull byte[] secret, @Nonnull String keyAlgorithm, @Nullable Integer keyLength) throws KeyDerivationException
Derive aSecretKeyfrom the specified secret.- Parameters:
secret- the input secret from which to derive the key.keyAlgorithm- the algorithm URI for which the derived key will be usedkeyLength- the length of the derived key. This may be null if the keyAlgorithm URI implies a key length, for example if the URI represents aKeyLengthSpecifiedAlgorithm. However if the URI implies a key length and this parameter value does not match that length, that is an error and and exception will be thrown- Returns:
- the derived key
- Throws:
KeyDerivationException- if the key derivation operation is not completed successfully
-
-