aboutsummaryrefslogtreecommitdiffstats
path: root/libraries/spongycastle/core/src/main/java/org/spongycastle/crypto/io/InvalidCipherTextIOException.java
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/spongycastle/core/src/main/java/org/spongycastle/crypto/io/InvalidCipherTextIOException.java')
-rw-r--r--libraries/spongycastle/core/src/main/java/org/spongycastle/crypto/io/InvalidCipherTextIOException.java28
1 files changed, 28 insertions, 0 deletions
diff --git a/libraries/spongycastle/core/src/main/java/org/spongycastle/crypto/io/InvalidCipherTextIOException.java b/libraries/spongycastle/core/src/main/java/org/spongycastle/crypto/io/InvalidCipherTextIOException.java
new file mode 100644
index 000000000..60f218347
--- /dev/null
+++ b/libraries/spongycastle/core/src/main/java/org/spongycastle/crypto/io/InvalidCipherTextIOException.java
@@ -0,0 +1,28 @@
+package org.spongycastle.crypto.io;
+
+import java.io.IOException;
+
+/**
+ * {@link IOException} wrapper around an exception indicating an invalid ciphertext, such as in
+ * authentication failure during finalisation of an AEAD cipher. For use in streams that need to
+ * expose invalid ciphertext errors.
+ */
+public class InvalidCipherTextIOException
+ extends IOException
+{
+ private static final long serialVersionUID = 1L;
+
+ private final Throwable cause;
+
+ public InvalidCipherTextIOException(String message, Throwable cause)
+ {
+ super(message);
+
+ this.cause = cause;
+ }
+
+ public Throwable getCause()
+ {
+ return cause;
+ }
+} \ No newline at end of file