blob: ce64455cc9a53365688be327b26b0dd7f2b77810 [file] [log] [blame]
Alex Klyubind23a1f72015-03-27 14:39:28 -07001package android.security;
2
3/**
4 * Base class for exceptions during cryptographic operations which cannot throw a suitable checked
5 * exception.
6 *
7 * <p>The contract of the majority of crypto primitives/operations (e.g. {@code Cipher} or
8 * {@code Signature}) is that they can throw a checked exception during initialization, but are not
9 * permitted to throw a checked exception during operation. Because crypto operations can fail
10 * for a variety of reasons after initialization, this base class provides type-safety for unchecked
11 * exceptions that may be thrown in those cases.
12 *
13 * @hide
14 */
15public class CryptoOperationException extends RuntimeException {
16
17 /**
18 * Constructs a new {@code CryptoOperationException} without detail message and cause.
19 */
20 public CryptoOperationException() {
21 super();
22 }
23
24 /**
25 * Constructs a new {@code CryptoOperationException} with the provided detail message and no
26 * cause.
27 */
28 public CryptoOperationException(String message) {
29 super(message);
30 }
31
32 /**
33 * Constructs a new {@code CryptoOperationException} with the provided detail message and cause.
34 */
35 public CryptoOperationException(String message, Throwable cause) {
36 super(message, cause);
37 }
38
39 /**
40 * Constructs a new {@code CryptoOperationException} with the provided cause.
41 */
42 public CryptoOperationException(Throwable cause) {
43 super(cause);
44 }
45}