blob: 5ae3d24acee0bb1eb7373e8d33558c0d28633ee5 [file] [log] [blame]
Kenny Roota91203b2012-02-15 15:00:46 -08001/*
2 * Copyright (C) 2009 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#ifndef __KEYSTORE_H__
18#define __KEYSTORE_H__
19
20// note state values overlap with ResponseCode for the purposes of the state() API
21enum State {
22 STATE_NO_ERROR = 1,
23 STATE_LOCKED = 2,
24 STATE_UNINITIALIZED = 3,
25};
26
27enum ResponseCode {
28 NO_ERROR = STATE_NO_ERROR, // 1
29 LOCKED = STATE_LOCKED, // 2
30 UNINITIALIZED = STATE_UNINITIALIZED, // 3
31 SYSTEM_ERROR = 4,
32 PROTOCOL_ERROR = 5,
33 PERMISSION_DENIED = 6,
34 KEY_NOT_FOUND = 7,
35 VALUE_CORRUPTED = 8,
36 UNDEFINED_ACTION = 9,
37 WRONG_PASSWORD_0 = 10,
38 WRONG_PASSWORD_1 = 11,
39 WRONG_PASSWORD_2 = 12,
40 WRONG_PASSWORD_3 = 13, // MAX_RETRY = 4
41};
42
43#endif