Class CryptoException

All Implemented Interfaces:
Serializable

public final class CryptoException extends RuntimeException
CryptoException is a preview API of the Java platform.
Programs can only use CryptoException when preview features are enabled.
Preview features may be removed in a future release, or upgraded to permanent features of the Java platform.
Thrown to indicate a cryptographic failure during processing.

This exception represents a general cryptographic error. It is typically used for unrecoverable failures related to GeneralSecurityException in contexts where checked exceptions are not desired.

This exception is not intended to represent internal provider errors, which should be reported using ProviderException.

Since:
27
See Also:
  • Constructor Details

    • CryptoException

      public CryptoException()
      Constructs a new CryptoException with null as its detail message. The cause is not initialized and may subsequently be initialized by a call to Throwable.initCause(Throwable).
    • CryptoException

      public CryptoException(String message)
      Constructs a new CryptoException with the specified detail message. The cause is not initialized and may subsequently be initialized by a call to Throwable.initCause(Throwable).
      Parameters:
      message - the detail message. The detail message is saved for later retrieval by the Throwable.getMessage() method.
    • CryptoException

      public CryptoException(String message, Throwable cause)
      Constructs a new CryptoException with the specified detail message and cause.

      Note that the detail message associated with cause is not automatically incorporated in this exception's detail message.

      Parameters:
      message - the detail message. The detail message is saved for later retrieval by the Throwable.getMessage() method.
      cause - the cause. The cause is saved for later retrieval by the Throwable.getCause() method. A null value is permitted and indicates that the cause is nonexistent or unknown.
    • CryptoException

      public CryptoException(Throwable cause)
      Constructs a new CryptoException with the specified cause and a detail message of (cause == null ? null : cause.toString()), which typically contains the class and detail message of cause.
      Parameters:
      cause - the cause. The cause is saved for later retrieval by the Throwable.getCause() method. A null value is permitted and indicates that the cause is nonexistent or unknown.