Package javax.crypto

Class ExemptionMechanism

java.lang.Object
javax.crypto.ExemptionMechanism

public class ExemptionMechanism
extends Object
This class implements the functionality of an exemption mechanism such as key recovery, key weakening, or key escrow.
  • Constructor Summary

    Constructors
    Modifier Constructor Description
    protected ExemptionMechanism​(ExemptionMechanismSpi exmechSpi, Provider provider, String mechanism)
    Creates a ExemptionMechanism instance.
  • Method Summary

    Modifier and Type Method Description
    protected void finalize()
    Override to clear any key state in the instance.
    byte[] genExemptionBlob()
    Generates the result key blob for this exemption mechanism.
    int genExemptionBlob​(byte[] output)
    Generates the result key blob for this exemption mechanism and stores it into the output buffer.
    int genExemptionBlob​(byte[] output, int outputOffset)
    Generates the result key blob for this exemption mechanism and stores it into the output buffer at offset outputOffset.
    static ExemptionMechanism getInstance​(String algorithm)
    Returns a new ExemptionMechanism instance that provides the specified exemption mechanism algorithm.
    static ExemptionMechanism getInstance​(String algorithm, String provider)
    Returns a new ExemptionMechansm instance that provides the specified exemption mechanism algorithm from the specified provider.
    static ExemptionMechanism getInstance​(String algorithm, Provider provider)
    Returns a new ExemptionMechanism instance that provides the specified exemption mechanism algorithm from the specified provider.
    String getName()
    Returns the name of this ExemptionMechanism.
    int getOutputSize​(int inputLen)
    Returns the size in bytes for the output buffer needed to hold the output of the next genExemptionBlob() call, given the specified inputLen (in bytes).
    Provider getProvider()
    Returns the provider of this ExemptionMechanism instance.
    void init​(Key key)
    Initializes this ExemptionMechanism instance with the specified key.
    void init​(Key key, AlgorithmParameters param)
    Initializes this ExemptionMechanism instance with the specified key and algorithm parameters.
    void init​(Key key, AlgorithmParameterSpec param)
    Initializes this ExemptionMechanism instance with the specified key and algorithm parameters.
    boolean isCryptoAllowed​(Key key)
    Returns whether the result blob for this ExemptionMechanism instance has been generated successfully and that the specified key is the same as the one that was used to initialize and generate.

    Methods inherited from class java.lang.Object

    clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ExemptionMechanism

      protected ExemptionMechanism​(ExemptionMechanismSpi exmechSpi, Provider provider, String mechanism)
      Creates a ExemptionMechanism instance.
      Parameters:
      exmechSpi - the implementation delegate.
      provider - the associated provider.
      mechanism - the name of the mechanism.
  • Method Details