Package org.opensaml.xmlsec.derivation
Interface KeyDerivation
- All Superinterfaces:
KeyAgreementParameter
Component which represents a specific key derivation algorithm, and supports deriving a new
SecretKey
via that algorithm.
Sub-types will usually contain additional configurable property inputs to the derivation operation.
-
Method Summary
-
Method Details
-
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 aSecretKey
from 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
-