1 /*
2  * Copyright (C) 2018 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 com.android.server.locksettings.recoverablekeystore.serialization;
18 
19 /**
20  * Describes the XML schema of the {@link android.security.keystore.recovery.KeyChainSnapshot} file.
21  */
22 class KeyChainSnapshotSchema {
23     static final String NAMESPACE = null;
24 
25     static final String CERTIFICATE_FACTORY_TYPE = "X.509";
26     static final String CERT_PATH_ENCODING = "PkiPath";
27 
28     static final String TAG_KEY_CHAIN_SNAPSHOT = "keyChainSnapshot";
29 
30     static final String TAG_SNAPSHOT_VERSION = "snapshotVersion";
31     static final String TAG_COUNTER_ID = "counterId";
32     static final String TAG_MAX_ATTEMPTS = "maxAttempts";
33     static final String TAG_RECOVERY_KEY_MATERIAL = "recoveryKeyMaterial";
34     static final String TAG_SERVER_PARAMS = "serverParams";
35     static final String TAG_TRUSTED_HARDWARE_CERT_PATH = "thmCertPath";
36     static final String TAG_BACKEND_PUBLIC_KEY = "backendPublicKey"; // Deprecated.
37 
38     static final String TAG_KEY_CHAIN_PROTECTION_PARAMS_LIST =
39             "keyChainProtectionParamsList";
40     static final String TAG_KEY_CHAIN_PROTECTION_PARAMS = "keyChainProtectionParams";
41     static final String TAG_USER_SECRET_TYPE = "userSecretType";
42     static final String TAG_LOCK_SCREEN_UI_TYPE = "lockScreenUiType";
43 
44     static final String TAG_KEY_DERIVATION_PARAMS = "keyDerivationParams";
45     static final String TAG_ALGORITHM = "algorithm";
46     static final String TAG_MEMORY_DIFFICULTY = "memoryDifficulty";
47     static final String TAG_SALT = "salt";
48 
49     static final String TAG_APPLICATION_KEYS = "applicationKeysList";
50     static final String TAG_APPLICATION_KEY = "applicationKey";
51     static final String TAG_ALIAS = "alias";
52     static final String TAG_KEY_MATERIAL = "keyMaterial";
53     static final String TAG_KEY_METADATA = "keyMetadata";
54 
55     // Statics only
KeyChainSnapshotSchema()56     private KeyChainSnapshotSchema() {}
57 }
58