summaryrefslogtreecommitdiffstats
path: root/keystore/java/android/security/CryptoOperationException.java
diff options
context:
space:
mode:
authorAlex Klyubin <klyubin@google.com>2015-03-27 14:39:28 -0700
committerAlex Klyubin <klyubin@google.com>2015-03-27 15:57:53 -0700
commitd23a1f706f0c24fade1a1c2f604009a7c9e70002 (patch)
tree97a12bf99f2bf2c839554c609e5970bf30b1bd56 /keystore/java/android/security/CryptoOperationException.java
parentdbd9a4b651aed25a50976ca0a68a979cc3f299fa (diff)
downloadframeworks_base-d23a1f706f0c24fade1a1c2f604009a7c9e70002.zip
frameworks_base-d23a1f706f0c24fade1a1c2f604009a7c9e70002.tar.gz
frameworks_base-d23a1f706f0c24fade1a1c2f604009a7c9e70002.tar.bz2
Symmetric key generation for AndroidKeyStore.
This currently supports AES and HMAC with SHA-256. Bug: 18088752 Change-Id: Ife55438cf4129b895295681bb35091cd37eb73fb
Diffstat (limited to 'keystore/java/android/security/CryptoOperationException.java')
-rw-r--r--keystore/java/android/security/CryptoOperationException.java45
1 files changed, 45 insertions, 0 deletions
diff --git a/keystore/java/android/security/CryptoOperationException.java b/keystore/java/android/security/CryptoOperationException.java
new file mode 100644
index 0000000..ce64455
--- /dev/null
+++ b/keystore/java/android/security/CryptoOperationException.java
@@ -0,0 +1,45 @@
+package android.security;
+
+/**
+ * Base class for exceptions during cryptographic operations which cannot throw a suitable checked
+ * exception.
+ *
+ * <p>The contract of the majority of crypto primitives/operations (e.g. {@code Cipher} or
+ * {@code Signature}) is that they can throw a checked exception during initialization, but are not
+ * permitted to throw a checked exception during operation. Because crypto operations can fail
+ * for a variety of reasons after initialization, this base class provides type-safety for unchecked
+ * exceptions that may be thrown in those cases.
+ *
+ * @hide
+ */
+public class CryptoOperationException extends RuntimeException {
+
+ /**
+ * Constructs a new {@code CryptoOperationException} without detail message and cause.
+ */
+ public CryptoOperationException() {
+ super();
+ }
+
+ /**
+ * Constructs a new {@code CryptoOperationException} with the provided detail message and no
+ * cause.
+ */
+ public CryptoOperationException(String message) {
+ super(message);
+ }
+
+ /**
+ * Constructs a new {@code CryptoOperationException} with the provided detail message and cause.
+ */
+ public CryptoOperationException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ /**
+ * Constructs a new {@code CryptoOperationException} with the provided cause.
+ */
+ public CryptoOperationException(Throwable cause) {
+ super(cause);
+ }
+}