1 // Copyright 2021, The Android Open Source Project 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 package android.security.authorization; 16 17 /** 18 * Used as exception codes by IKeystoreAuthorization. 19 * @hide 20 */ 21 @Backing(type="int") 22 enum ResponseCode { 23 /** 24 * A matching auth token is not found. 25 */ 26 NO_AUTH_TOKEN_FOUND = 1, 27 /** 28 * The matching auth token is expired. 29 */ 30 AUTH_TOKEN_EXPIRED = 2, 31 /** 32 * Same as in keystore2/ResponseCode.aidl. 33 * Any unexpected Error such as IO or communication errors. 34 */ 35 SYSTEM_ERROR = 4, 36 /** 37 * Same as in keystore2/ResponseCode.aidl. 38 * Indicates that the caller does not have the permissions for the attempted request. 39 */ 40 PERMISSION_DENIED = 6, 41 /** 42 * Same as in keystore2/ResponseCode.aidl. 43 * Indicates that the requested key does not exist. 44 */ 45 KEY_NOT_FOUND = 7, 46 /** 47 * Same as in keystore2/ResponseCode.aidl. 48 * Indicates that a value being processed is corrupted. 49 */ 50 VALUE_CORRUPTED = 8, 51 /** 52 * Same as in keystore2/ResponseCode.aidl. 53 * Indicates that an invalid argument was passed to an API call. 54 */ 55 INVALID_ARGUMENT = 20, 56 57 }