| Alex Klyubin | 708fc940 | 2015-04-28 18:58:47 -0700 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright (C) 2015 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | package android.security; |
| 18 | |
| 19 | import java.security.InvalidKeyException; |
| 20 | |
| 21 | /** |
| 22 | * Indicates that the key can no longer be used because it has been permanently invalidated. |
| 23 | * |
| 24 | * <p>This can currently occur only for keys that require user authentication. Such keys are |
| 25 | * permanently invalidated once the secure lock screen is disabled (i.e., reconfigured to None, |
| 26 | * Swipe or other mode which does not authenticate the user) or when the secure lock screen is |
| 27 | * forcibly reset (e.g., by Device Admin). Additionally, keys configured to require user |
| 28 | * authentication for every use of the key are also permanently invalidated once a new fingerprint |
| 29 | * is enrolled or once no more fingerprints are enrolled. |
| 30 | */ |
| 31 | public class KeyPermanentlyInvalidatedException extends InvalidKeyException { |
| 32 | |
| 33 | /** |
| 34 | * Constructs a new {@code KeyPermanentlyInvalidatedException} without detail message and cause. |
| 35 | */ |
| 36 | public KeyPermanentlyInvalidatedException() { |
| 37 | super("Key permanently invalidated"); |
| 38 | } |
| 39 | |
| 40 | /** |
| 41 | * Constructs a new {@code KeyPermanentlyInvalidatedException} with the provided detail message |
| 42 | * and no cause. |
| 43 | */ |
| 44 | public KeyPermanentlyInvalidatedException(String message) { |
| 45 | super(message); |
| 46 | } |
| 47 | |
| 48 | /** |
| 49 | * Constructs a new {@code KeyPermanentlyInvalidatedException} with the provided detail message |
| 50 | * and cause. |
| 51 | */ |
| 52 | public KeyPermanentlyInvalidatedException(String message, Throwable cause) { |
| 53 | super(message, cause); |
| 54 | } |
| 55 | } |