APIdia Launch Partner
Top Description Fields Constructors
javax.crypto

public final Class CryptoException

extends RuntimeException
Class Inheritance
Annotations
@PreviewFeature
feature:PEM_API
Imports
jdk.internal.javac.PreviewFeature

Preview

Third Preview of PEM Encodings of Cryptographic Objects (JEP 538).

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 java.security.GeneralSecurityException in contexts where checked exceptions are not desired.

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

Since
27

Field Summary

Modifier and TypeField and Description
private static final long

Constructor Summary

AccessConstructor and Description
public
CryptoException()

Constructs a new CryptoException with null as its detail message.

public
CryptoException(String
the detail message. The detail message is saved for later retrieval by the getMessage() method.
message
)

Constructs a new CryptoException with the specified detail message.

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

Constructs a new CryptoException with the specified detail message and cause.

public
CryptoException(Throwable
the cause. The cause is saved for later retrieval by the getCause() method. A null value is permitted and indicates that the cause is nonexistent or unknown.
cause
)

Constructs a new CryptoException with the specified cause and a detail message of (cause == null ?

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.lang.RuntimeException.serialVersionUID.

Annotations
@Serial

Constructor Detail

CryptoExceptionback to summary
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 initCause(Throwable).

CryptoExceptionback to summary
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 initCause(Throwable).

Parameters
message:String

the detail message. The detail message is saved for later retrieval by the getMessage() method.

CryptoExceptionback to summary
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:String

the detail message. The detail message is saved for later retrieval by the getMessage() method.

cause:Throwable

the cause. The cause is saved for later retrieval by the getCause() method. A null value is permitted and indicates that the cause is nonexistent or unknown.

CryptoExceptionback to summary
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:Throwable

the cause. The cause is saved for later retrieval by the getCause() method. A null value is permitted and indicates that the cause is nonexistent or unknown.