# Class CryptoException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.codename1.security.CryptoException

public class CryptoException extends RuntimeException
Thrown by classes in this package when a cryptographic operation fails. This is a runtime exception so callers are not forced to handle every operation, but it can be caught explicitly when needed (e.g. a malformed key, an authentication-tag mismatch, an algorithm that is not available on the current platform, etc.).

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `CryptoException(String message)`
  Creates a new instance with the given message.
  `CryptoException(String message, Throwable cause)`
  Creates a new instance wrapping an underlying cause.

- ## Method Summary

  ### Methods inherited from class Throwable

  `addSuppressed, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, setStackTrace, toString`

  ### Methods inherited from class Object

  `clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### CryptoException

    public CryptoException(String message)

    Creates a new instance with the given message.

    ###### Parameters

    - `message`: human readable description of the failure

  - ### CryptoException

    public CryptoException(String message, Throwable cause)

    Creates a new instance wrapping an underlying cause.

    ###### Parameters

    - `message`: human readable description of the failure

    - `cause`: underlying exception that triggered the failure