Class KDFSpi

java.lang.Object
javax.crypto.KDFSpi

public abstract class KDFSpi extends Object
This class defines the Service Provider Interface (SPI) for the Key Derivation Function (KDF) class.

All the abstract methods in this class must be implemented by each cryptographic service provider who wishes to supply the implementation of a particular key derivation function algorithm.

Implementations must provide a public constructor which accepts a KDFParameters object if they depend on the default implementation of Provider.Service.newInstance to construct KDFSpi instances. The constructor must call super(params) passing the parameters supplied. The constructor must also throw an InvalidAlgorithmParameterException if the supplied parameters are inappropriate. If a KDF object is instantiated with one of the getInstance methods that contains a KDFParameters parameter, the user-provided KDFParameters object will be passed to the constructor of the KDFSpi implementation. Otherwise, if it is instantiated with one of the getInstance methods without a KDFParameters parameter, a null value will be passed to the constructor.

Implementations which do not support KDFParameters must require null to be passed, otherwise an InvalidAlgorithmParameterException will be thrown. On the other hand, implementations which require KDFParameters should throw an InvalidAlgorithmParameterException upon receiving a null value if default parameters cannot be generated or upon receiving KDFParameters which are not supported by the implementation.

To aid the caller, implementations may return parameters with additional default values or supply random values as used by the underlying KDF algorithm. See engineGetParameters() for more details.

Since:
25
See Also:
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    KDFSpi(KDFParameters kdfParameters)
    The sole constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected abstract byte[]
    Derives a key, returns raw data as a byte array.
    protected abstract SecretKey
    Derives a key, returned as a SecretKey object.
    protected abstract KDFParameters
    Returns the KDFParameters used with this KDF object.

    Methods declared in class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    Modifier and Type
    Method
    Description
    protected Object
    Answers a new instance of the same class as the receiver, whose slots have been filled in with the values in the slots of the receiver.
    boolean
    Compares the argument to the receiver, and answers true if they represent the same object using a class specific comparison.
    protected void
    Deprecated, for removal: This API element is subject to removal in a future version.
    May cause performance issues, deadlocks and hangs.
    final Class<? extends Object>
    Answers the unique instance of java.lang.Class which represents the class of the receiver.
    int
    Answers an integer hash code for the receiver.
    final void
    Causes one thread which is waiting on the receiver to be made ready to run.
    final void
    Causes all threads which are waiting on the receiver to be made ready to run.
    Answers a string containing a concise, human-readable description of the receiver.
    final void
    Causes the thread which sent this message to be made not ready to run pending some change in the receiver (as indicated by notify or notifyAll).
    final void
    wait(long time)
    Causes the thread which sent this message to be made not ready to run either pending some change in the receiver (as indicated by notify or notifyAll) or the expiration of the timeout.
    final void
    wait(long time, int frac)
    Causes the thread which sent this message to be made not ready to run either pending some change in the receiver (as indicated by notify or notifyAll) or the expiration of the timeout.