# GeneralSecurityException

public class **GeneralSecurityException** extends [Exception](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Exception.html)  

|---|---|---|
| Known Direct Subclasses [BadPaddingException](https://developers.google.com/j2objc/javadoc/jre/reference/javax/crypto/BadPaddingException.html), [CRLException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/CRLException.html), [CertPathBuilderException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/CertPathBuilderException.html), [CertPathValidatorException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/CertPathValidatorException.html), [CertStoreException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/CertStoreException.html), [CertificateException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/CertificateException.html), [DigestException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/DigestException.html), [ExemptionMechanismException](https://developers.google.com/j2objc/javadoc/jre/reference/javax/crypto/ExemptionMechanismException.html), [IllegalBlockSizeException](https://developers.google.com/j2objc/javadoc/jre/reference/javax/crypto/IllegalBlockSizeException.html), [InvalidAlgorithmParameterException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/InvalidAlgorithmParameterException.html), [InvalidKeySpecException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/spec/InvalidKeySpecException.html), [InvalidParameterSpecException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/spec/InvalidParameterSpecException.html), [KeyException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/KeyException.html), [KeyStoreException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/KeyStoreException.html), [NoSuchAlgorithmException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/NoSuchAlgorithmException.html), [NoSuchPaddingException](https://developers.google.com/j2objc/javadoc/jre/reference/javax/crypto/NoSuchPaddingException.html), [NoSuchProviderException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/NoSuchProviderException.html), [ShortBufferException](https://developers.google.com/j2objc/javadoc/jre/reference/javax/crypto/ShortBufferException.html), [SignatureException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/SignatureException.html), [UnrecoverableEntryException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/UnrecoverableEntryException.html) |---|---| | [BadPaddingException](https://developers.google.com/j2objc/javadoc/jre/reference/javax/crypto/BadPaddingException.html) | This exception is thrown when a particular padding mechanism is expected for the input data but the data is not padded properly. | | [CRLException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/CRLException.html) | CRL (Certificate Revocation List) Exception. | | [CertPathBuilderException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/CertPathBuilderException.html) | An exception indicating one of a variety of problems encountered when building a certification path with a `CertPathBuilder`. | | [CertPathValidatorException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/CertPathValidatorException.html) | An exception indicating one of a variety of problems encountered when validating a certification path. | | [CertStoreException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/CertStoreException.html) | An exception indicating one of a variety of problems retrieving certificates and CRLs from a `CertStore`. | | [CertificateException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/CertificateException.html) | This exception indicates one of a variety of certificate problems. | | [DigestException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/DigestException.html) | This is the generic Message Digest exception. | | [ExemptionMechanismException](https://developers.google.com/j2objc/javadoc/jre/reference/javax/crypto/ExemptionMechanismException.html) | This is the generic ExemptionMechanism exception. | | [IllegalBlockSizeException](https://developers.google.com/j2objc/javadoc/jre/reference/javax/crypto/IllegalBlockSizeException.html) | This exception is thrown when the length of data provided to a block cipher is incorrect, i.e., does not match the block size of the cipher. | | [InvalidAlgorithmParameterException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/InvalidAlgorithmParameterException.html) | This is the exception for invalid or inappropriate algorithm parameters. | | [InvalidKeySpecException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/spec/InvalidKeySpecException.html) | This is the exception for invalid key specifications. | | [InvalidParameterSpecException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/spec/InvalidParameterSpecException.html) | This is the exception for invalid parameter specifications. | | [KeyException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/KeyException.html) | This is the basic key exception. | | [KeyStoreException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/KeyStoreException.html) | This is the generic KeyStore exception. | | [NoSuchAlgorithmException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/NoSuchAlgorithmException.html) | This exception is thrown when a particular cryptographic algorithm is requested but is not available in the environment. | | [NoSuchPaddingException](https://developers.google.com/j2objc/javadoc/jre/reference/javax/crypto/NoSuchPaddingException.html) | This exception is thrown when a particular padding mechanism is requested but is not available in the environment. | | [NoSuchProviderException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/NoSuchProviderException.html) | This exception is thrown when a particular security provider is requested but is not available in the environment. | | [ShortBufferException](https://developers.google.com/j2objc/javadoc/jre/reference/javax/crypto/ShortBufferException.html) | This exception is thrown when an output buffer provided by the user is too short to hold the operation result. | | [SignatureException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/SignatureException.html) | This is the generic Signature exception. | | [UnrecoverableEntryException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/UnrecoverableEntryException.html) | This exception is thrown if an entry in the keystore cannot be recovered. | |||

|---|---|---|
| Known Indirect Subclasses [AEADBadTagException](https://developers.google.com/j2objc/javadoc/jre/reference/javax/crypto/AEADBadTagException.html), [CertificateEncodingException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/CertificateEncodingException.html), [CertificateExpiredException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/CertificateExpiredException.html), [CertificateNotYetValidException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/CertificateNotYetValidException.html), [CertificateParsingException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/CertificateParsingException.html), [CertificateRevokedException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/CertificateRevokedException.html), [InvalidKeyException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/InvalidKeyException.html), [KeyManagementException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/KeyManagementException.html), [UnrecoverableKeyException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/UnrecoverableKeyException.html) |---|---| | [AEADBadTagException](https://developers.google.com/j2objc/javadoc/jre/reference/javax/crypto/AEADBadTagException.html) | This exception is thrown when a `https://developers.google.com/j2objc/javadoc/jre/reference/javax/crypto/Cipher.html` operating in an AEAD mode (such as GCM/CCM) is unable to verify the supplied authentication tag. | | [CertificateEncodingException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/CertificateEncodingException.html) | Certificate Encoding Exception. | | [CertificateExpiredException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/CertificateExpiredException.html) | Certificate Expired Exception. | | [CertificateNotYetValidException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/CertificateNotYetValidException.html) | Certificate is not yet valid exception. | | [CertificateParsingException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/CertificateParsingException.html) | Certificate Parsing Exception. | | [CertificateRevokedException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/CertificateRevokedException.html) | An exception that indicates an X.509 certificate is revoked. | | [InvalidKeyException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/InvalidKeyException.html) | This is the exception for invalid Keys (invalid encoding, wrong length, uninitialized, etc). | | [KeyManagementException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/KeyManagementException.html) | This is the general key management exception for all operations dealing with key management. | | [UnrecoverableKeyException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/UnrecoverableKeyException.html) | This exception is thrown if a key in the keystore cannot be recovered. | |||

The `GeneralSecurityException` class is a generic
security exception class that provides type safety for all the
security-related exception classes that extend from it.

### Public Constructor Summary

|---|---|
|   | [GeneralSecurityException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/GeneralSecurityException.html#GeneralSecurityException())() Constructs a GeneralSecurityException with no detail message. |
|   | [GeneralSecurityException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/GeneralSecurityException.html#GeneralSecurityException(java.lang.String))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) msg) Constructs a GeneralSecurityException with the specified detail message. |
|   | [GeneralSecurityException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/GeneralSecurityException.html#GeneralSecurityException(java.lang.String,%20java.lang.Throwable))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) message, [Throwable](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html) cause) Creates a `GeneralSecurityException` with the specified detail message and cause. |
|   | [GeneralSecurityException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/GeneralSecurityException.html#GeneralSecurityException(java.lang.Throwable))([Throwable](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html) cause) Creates a `GeneralSecurityException` with the specified cause and a detail message of `(cause==null ? null : cause.toString())` (which typically contains the class and detail message of `cause`). |

### Inherited Method Summary

From class [java.lang.Throwable](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html)

|---|---|
| synchronized final void | [addSuppressed](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html#addSuppressed(java.lang.Throwable))([Throwable](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html) exception) Appends the specified exception to the exceptions that were suppressed in order to deliver this exception. |
| synchronized [Throwable](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html) | [fillInStackTrace](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html#fillInStackTrace())() Fills in the execution stack trace. |
| synchronized [Throwable](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html) | [getCause](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html#getCause())() Returns the cause of this throwable or `null` if the cause is nonexistent or unknown. |
| [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) | [getLocalizedMessage](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html#getLocalizedMessage())() Creates a localized description of this throwable. |
| [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) | [getMessage](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html#getMessage())() Returns the detail message string of this throwable. |
| StackTraceElement\[\] | [getStackTrace](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html#getStackTrace())() Provides programmatic access to the stack trace information printed by `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html#printStackTrace()`. |
| synchronized final [Throwable\[\]](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html) | [getSuppressed](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html#getSuppressed())() Returns an array containing all of the exceptions that were suppressed, typically by the `try`-with-resources statement, in order to deliver this exception. |
| synchronized [Throwable](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html) | [initCause](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html#initCause(java.lang.Throwable))([Throwable](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html) cause) Initializes the *cause* of this throwable to the specified value. |
| void | [printStackTrace](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html#printStackTrace())() Prints this throwable and its backtrace to the standard error stream. |
| void | [printStackTrace](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html#printStackTrace(java.io.PrintWriter))([PrintWriter](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/PrintWriter.html) s) Prints this throwable and its backtrace to the specified print writer. |
| void | [printStackTrace](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html#printStackTrace(java.io.PrintStream))([PrintStream](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/PrintStream.html) s) Prints this throwable and its backtrace to the specified print stream. |
| void | [setStackTrace](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html#setStackTrace(java.lang.StackTraceElement[]))(StackTraceElement\[\] stackTrace) Sets the stack trace elements that will be returned by `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html#getStackTrace()` and printed by `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html#printStackTrace()` and related methods. |
| [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) | [toString](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html#toString())() Returns a short description of this throwable. |

From class [java.lang.Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html)

|---|---|
| [Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) | [clone](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#clone())() Creates and returns a copy of this `Object`. |
| boolean | [equals](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#equals(java.lang.Object))([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) obj) Compares this instance with the specified object and indicates if they are equal. |
| void | [finalize](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#finalize())() Invoked when the garbage collector has detected that this instance is no longer reachable. |
| final [Class](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Class.html)\<?\> | [getClass](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#getClass())() Returns the unique instance of `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Class.html` that represents this object's class. |
| int | [hashCode](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#hashCode())() Returns an integer hash code for this object. |
| final void | [notify](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#notify())() Causes a thread which is waiting on this object's monitor (by means of calling one of the `wait()` methods) to be woken up. |
| final void | [notifyAll](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#notifyAll())() Causes all threads which are waiting on this object's monitor (by means of calling one of the `wait()` methods) to be woken up. |
| [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) | [toString](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#toString())() Returns a string containing a concise, human-readable description of this object. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait(long,%20int))(long timeout, int nanos) Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object or until the specified timeout expires. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait(long))(long timeout) Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object or until the specified timeout expires. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait())() Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object. |

## Public Constructors

#### public
**GeneralSecurityException**
()

Constructs a GeneralSecurityException with no detail message.

#### public
**GeneralSecurityException**
([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) msg)

Constructs a GeneralSecurityException with the specified detail
message.
A detail message is a String that describes this particular
exception.

##### Parameters

| msg | the detail message. |
|---|---|

#### public
**GeneralSecurityException**
([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) message, [Throwable](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html) cause)

Creates a `GeneralSecurityException` with the specified
detail message and cause.

##### Parameters

| message | the detail message (which is saved for later retrieval by the `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html#getMessage()` method). |
| cause | the cause (which is saved for later retrieval by the `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html#getCause()` method). (A `null` value is permitted, and indicates that the cause is nonexistent or unknown.) |
|---|---|

#### public
**GeneralSecurityException**
([Throwable](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html) cause)

Creates a `GeneralSecurityException` 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 (which is saved for later retrieval by the `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html#getCause()` method). (A `null` value is permitted, and indicates that the cause is nonexistent or unknown.) |
|---|---|