1 /* 2 * Copyright (C) 2025 Huawei Device Co., Ltd. 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 16 #ifndef IDENTITY_SERVICE_DEFINES_H 17 #define IDENTITY_SERVICE_DEFINES_H 18 19 #define FIELD_CRED_TYPE "credType" 20 #define FIELD_CREDENTIAL_FORMAT "credentialFormat" 21 #define FIELD_METHOD "method" 22 #define FIELD_ALGORITHM_TYPE "algorithmType" 23 #define FIELD_SUBJECT "subject" 24 #define FIELD_ISSUER "issuer" 25 #define FIELD_KEY_VALUE "keyValue" 26 #define FIELD_DEVICE_ID "deviceId" 27 #define FIELD_PEER_USER_SPACE_ID "peerUserSpaceId" 28 #define FIELD_AUTHORIZED_ACCOUNT_LIST "authorizedAccountList" 29 #define FIELD_AUTHORIZED_DEVICE_LIST "authorizedDeviceList" 30 #define FIELD_AUTHORIZED_APP_LIST "authorizedAppList" 31 #define FIELD_AUTHORIZED_SCOPE "authorizedScope" 32 #define FIELD_CRED_OWNER "credOwner" 33 #define FIELD_EXTEND_INFO "extendInfo" 34 #define FIELD_CRED_ID "credId" 35 #define FIELD_PROOF_TYPE "proofType" 36 #define FIELD_KEY_FORMAT "keyFormat" 37 #define FIELD_OS_ACCOUNT_ID "osAccountId" 38 #define FIELD_BASE_CRED_INFO "baseCredInfo" 39 #define FIELD_ADD_CRED_PARAM_LIST "addCredParamList" 40 #define FIELD_CRED_ID_LIST "credIdList" 41 #define FIELD_BASE_INFO "baseInfo" 42 #define FIELD_UPDATE_LISTS "updateLists" 43 #define DEFAULT_VAL 0 44 #define RAND_NUM_LENGTH 16 45 #define KEY_VALUE_MAX_LENGTH 128 46 #define PAKE_ED25519_KEY_PAIR_LEN 32 47 #define MAX_INT64_SIZE 20 48 #define MAX_CRED_SIZE 5000 49 #define ALGO_KEY_LEN 32 50 #define AES_128_KEY_LEN 16 51 #define PSK_LEN 32 52 #define DEFAULT_EX_INFO_VAL (-1) 53 #define UPDATE_MATCHED_NUM_ZERO 0 54 #define UPDATE_MATCHED_NUM_ONE 1 55 #define DEV_AUTH_UID 3333 56 57 #ifdef __cplusplus 58 extern "C" { 59 #endif 60 61 62 enum { 63 METHOD_GENERATE = 1, 64 METHOD_IMPORT = 2, 65 }; 66 67 enum { 68 ACCOUNT_RELATED = 1, 69 ACCOUNT_UNRELATED = 2, 70 ACCOUNT_SHARED = 3, 71 }; 72 73 enum { 74 SYMMETRIC_KEY = 1, 75 ASYMMETRIC_PUB_KEY = 2, 76 ASYMMETRIC_KEY = 3, 77 X509_CERT = 4, 78 }; 79 80 enum { 81 ALGO_TYPE_AES_256 = 1, 82 ALGO_TYPE_AES_128 = 2, 83 ALGO_TYPE_P256 = 3, 84 ALGO_TYPE_ED25519 = 4, 85 }; 86 87 enum { 88 SUBJECT_MASTER_CONTROLLER = 1, 89 SUBJECT_ACCESSORY_DEVICE = 2, 90 }; 91 92 enum { 93 SYSTEM_ACCOUNT = 1, 94 APP_ACCOUNT = 2, 95 DOMANIN_ACCOUNT = 3, 96 }; 97 98 enum { 99 PROOF_TYPE_PSK = 1, 100 PROOF_TYPE_PKI = 2, 101 }; 102 103 enum { 104 SCOPE_DEVICE = 1, 105 SCOPE_USER = 2, 106 SCOPE_APP = 3, 107 }; 108 109 #ifdef __cplusplus 110 } 111 #endif 112 113 #endif