Interface DerivationAlgorithm

  • All Known Implementing Classes:
    ConcatKDF

    public interface DerivationAlgorithm
    Interface is supported by classes to implement key derivation algorithms.
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      byte[] deriveKey​(byte[] secret, byte[] otherInfo, int offset, long keyLength)
      Derives a key from the given secret and other info.
      default byte[] deriveKey​(byte[] secret, byte[] otherInfo, long keyLength)
      Derives a key from the given secret and other info.
    • Method Detail

      • deriveKey

        byte[] deriveKey​(byte[] secret,
                         byte[] otherInfo,
                         int offset,
                         long keyLength)
                  throws XMLSecurityException
        Derives a key from the given secret and other info. The initial derived key is size of offset + keyLength.
        Parameters:
        secret - The "shared" secret to use for key derivation (e.g. the secret key)
        otherInfo - as specified in [SP800-56A] the optional attributes: AlgorithmID, PartyUInfo, PartyVInfo, SuppPubInfo and SuppPrivInfo attributes are concatenated to form a bit string “OtherInfo” that is used with the key derivation function.
        offset - the starting position in derived keying material of size: offset + keyLength
        keyLength - The length of the key to derive
        Returns:
        The derived key
        Throws:
        XMLSecurityException - if something goes wrong during the key derivation
      • deriveKey

        default byte[] deriveKey​(byte[] secret,
                                 byte[] otherInfo,
                                 long keyLength)
                          throws XMLSecurityException
        Derives a key from the given secret and other info.
        Parameters:
        secret - The "shared" secret to use for key derivation (e.g. the secret key)
        otherInfo - as specified in [SP800-56A] the optional attributes: AlgorithmID, PartyUInfo, PartyVInfo, SuppPubInfo and SuppPrivInfo attributes are concatenated to form a bit string “OtherInfo” that is used with the key derivation function.
        keyLength - The length of the key to derive
        Returns:
        The derived key
        Throws:
        XMLSecurityException - if something goes wrong during the key derivation