Interface KeyDerivation

  • All Superinterfaces:
    KeyAgreementParameter

    public interface KeyDerivation
    extends 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 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 a SecretKey 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 used
        keyLength - the length of the derived key. This may be null if the keyAlgorithm URI implies a key length, for example if the URI represents a KeyLengthSpecifiedAlgorithm. 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