/base/security/huks/utils/crypto_adapter/ |
D | hks_client_service_adapter_common.c | 33 int32_t CopyToInnerKey(const struct HksBlob *key, struct HksBlob *outKey) in CopyToInnerKey() argument 35 if ((key->size == 0) || (key->size > MAX_KEY_SIZE)) { in CopyToInnerKey() 36 HKS_LOG_E("invalid input key size: %" LOG_PUBLIC "u", key->size); in CopyToInnerKey() 40 uint8_t *outData = (uint8_t *)HksMalloc(key->size); in CopyToInnerKey() 43 (void)memcpy_s(outData, key->size, key->data, key->size); in CopyToInnerKey() 45 outKey->size = key->size; in CopyToInnerKey() 51 static int32_t TranslateToInnerCurve25519Format(const uint32_t alg, const struct HksBlob *key, in TranslateToInnerCurve25519Format() argument 54 if (key->size != HKS_KEY_BYTES(HKS_CURVE25519_KEY_SIZE_256)) { in TranslateToInnerCurve25519Format() 55 HKS_LOG_E("Invalid curve25519 public key size! key size = 0x%" LOG_PUBLIC "X", key->size); in TranslateToInnerCurve25519Format() 59 uint32_t totalSize = sizeof(struct HksPubKeyInfo) + key->size; in TranslateToInnerCurve25519Format() [all …]
|
/base/security/huks/test/unittest/huks_standard_test/three_stage_test/src/ |
D | hks_import_agree_test.cpp | 678 static int32_t CopyKey(const uint8_t *key, uint32_t size, struct HksBlob *outKey) in CopyKey() argument 685 (void)memcpy_s(outData, size, key, size); in CopyKey() 692 static int32_t CopyToInner(struct TestImportKeyData *key, uint32_t importType, struct HksBlob *outK… in CopyToInner() argument 695 return CopyKey(key->privateOrYData.data, key->privateOrYData.size, outKey); in CopyToInner() 697 return CopyKey(key->publicOrXData.data, key->publicOrXData.size, outKey); in CopyToInner() 701 static int32_t ConstructCurve25519Key(struct TestImportKeyData *key, in ConstructCurve25519Key() argument 705 return CopyToInner(key, importType, outKey); in ConstructCurve25519Key() 711 material.pubKeySize = key->publicOrXData.size; in ConstructCurve25519Key() 712 material.priKeySize = key->privateOrYData.size; in ConstructCurve25519Key() 729 …if (memcpy_s(data + offset, size - offset, key->publicOrXData.data, key->publicOrXData.size) != EO… in ConstructCurve25519Key() [all …]
|
/base/useriam/user_auth_framework/interfaces/inner_api/ |
D | attributes.h | 75 bool SetBoolValue(AttributeKey key, bool value); 76 bool SetUint64Value(AttributeKey key, uint64_t value); 77 bool SetUint32Value(AttributeKey key, uint32_t value); 78 bool SetUint16Value(AttributeKey key, uint16_t value); 79 bool SetUint8Value(AttributeKey key, uint8_t value); 80 bool SetInt32Value(AttributeKey key, int32_t value); 81 bool SetStringValue(AttributeKey key, const std::string &value); 82 bool SetAttributesValue(AttributeKey key, const Attributes &value); 83 bool SetUint64ArrayValue(AttributeKey key, const std::vector<uint64_t> &value); 84 bool SetUint32ArrayValue(AttributeKey key, const std::vector<uint32_t> &value); [all …]
|
/base/security/access_token/services/common/database/src/ |
D | generic_values.cpp | 21 void GenericValues::Put(const std::string& key, int32_t value) in Put() argument 23 map_.insert(std::make_pair(key, VariantValue(value))); in Put() 26 void GenericValues::Put(const std::string& key, int64_t value) in Put() argument 28 map_.insert(std::make_pair(key, VariantValue(value))); in Put() 31 void GenericValues::Put(const std::string& key, const std::string& value) in Put() argument 33 map_.insert(std::make_pair(key, VariantValue(value))); in Put() 36 void GenericValues::Put(const std::string& key, const VariantValue& value) in Put() argument 38 map_.insert(std::make_pair(key, value)); in Put() 41 VariantValue GenericValues::Get(const std::string& key) const in Get() 43 auto iter = map_.find(key); in Get() [all …]
|
/base/hiviewdfx/hiview/adapter/system_service/platform/ohos/ |
D | parameter_ex.cpp | 24 std::string GetString(const std::string& key, const std::string& defaultValue) in GetString() argument 26 return OHOS::system::GetParameter(key, defaultValue); in GetString() 29 int64_t GetInteger(const std::string& key, const int64_t defaultValue) in GetInteger() argument 31 return OHOS::system::GetIntParameter(key, defaultValue); in GetInteger() 34 uint64_t GetUnsignedInteger(const std::string& key, const uint64_t defaultValue) in GetUnsignedInteger() argument 36 return OHOS::system::GetUintParameter(key, defaultValue); in GetUnsignedInteger() 39 bool GetBoolean(const std::string& key, const bool defaultValue) in GetBoolean() argument 41 return OHOS::system::GetBoolParameter(key, defaultValue); in GetBoolean() 44 bool SetProperty(const std::string& key, const std::string& defaultValue) in SetProperty() argument 46 return OHOS::system::SetParameter(key, defaultValue); in SetProperty() [all …]
|
/base/security/huks/test/unittest/huks_standard_test/crypto_engine_test/src/ |
D | hks_crypto_hal_api_mbedtls.cpp | 91 HksBlob key = {}; variable 93 ret = HksCryptoHalGenerateKey(&spec, &key); 112 HksBlob key = {}; variable 114 ret = HksCryptoHalGenerateKey(&spec, &key); 127 HksBlob key = { .size = 0, .data = nullptr }; variable 134 ret = HksCryptoHalEncrypt(&key, nullptr, &message, &cipherText, &tagAead); 137 key = { .size = 1, .data = buff }; 138 ret = HksCryptoHalEncrypt(&key, nullptr, &message, &cipherText, &tagAead); 142 ret = HksCryptoHalEncrypt(&key, nullptr, &message, &cipherText, &tagAead); 146 ret = HksCryptoHalEncrypt(&key, nullptr, &message, &cipherText, &tagAead); [all …]
|
D | hks_crypto_hal_api_openssl.cpp | 89 HksBlob key = {}; variable 91 ret = HksCryptoHalGenerateKey(&spec, &key); 109 HksBlob key = {}; variable 111 ret = HksCryptoHalGenerateKey(&spec, &key); 115 ret = HksCryptoHalGenerateKey(&spec, &key); 119 ret = HksCryptoHalGenerateKey(&spec, &key); 123 ret = HksCryptoHalGenerateKey(&spec, &key); 127 ret = HksCryptoHalGenerateKey(&spec, &key); 132 ret = HksCryptoHalGenerateKey(&spec, &key); 146 HksBlob key = { .size = 0, .data = nullptr }; variable [all …]
|
/base/security/device_auth/common_lib/impl/src/ |
D | json_utils.c | 57 void DeleteItemFromJson(CJson *jsonObj, const char *key) in DeleteItemFromJson() argument 59 if (jsonObj == NULL || key == NULL) { in DeleteItemFromJson() 62 cJSON_DeleteItemFromObjectCaseSensitive(jsonObj, key); in DeleteItemFromJson() 65 void DeleteAllItemExceptOne(CJson *jsonObj, const char *key) in DeleteAllItemExceptOne() argument 67 if (jsonObj == NULL || key == NULL) { in DeleteAllItemExceptOne() 75 if (strcmp(key, curItem->string) != 0) { in DeleteAllItemExceptOne() 97 CJson *DetachItemFromJson(CJson *jsonObj, const char *key) in DetachItemFromJson() argument 99 if (jsonObj == NULL || key == NULL) { in DetachItemFromJson() 103 return cJSON_DetachItemFromObjectCaseSensitive(jsonObj, key); in DetachItemFromJson() 135 CJson *GetObjFromJson(const CJson *jsonObj, const char *key) in GetObjFromJson() argument [all …]
|
/base/security/device_auth/common_lib/interfaces/ |
D | json_utils.h | 41 void DeleteItemFromJson(CJson *jsonObj, const char *key); 42 void DeleteAllItemExceptOne(CJson *jsonObj, const char *key); 44 CJson *DetachItemFromJson(CJson *jsonObj, const char *key); 63 CJson *GetObjFromJson(const CJson *jsonObj, const char *key); 77 const char *GetStringFromJson(const CJson *jsonObj, const char *key); 83 int32_t GetByteFromJson(const CJson *jsonObj, const char *key, uint8_t *byte, uint32_t len); 84 int32_t GetIntFromJson(const CJson *jsonObj, const char *key, int32_t *value); 85 int32_t GetInt64FromJson(const CJson *jsonObj, const char *key, int64_t *value); 86 int32_t GetBoolFromJson(const CJson *jsonObj, const char *key, bool *value); 89 int32_t AddObjToJson(CJson *jsonObj, const char *key, const CJson *childObj); [all …]
|
/base/notification/distributed_notification_service/services/distributed/src/ |
D | distributed_preferences.cpp | 57 ANS_LOGE("key <%{public}s> is invalid.", entry.key.ToString().c_str()); in InitDistributedAllInfo() 64 void DistributedPreferences::GetDistributedMainKey(std::string &key) in GetDistributedMainKey() argument 66 key = DISTRIBUTED_LABEL + DELIMITER + MAIN_LABEL + DELIMITER; in GetDistributedMainKey() 70 const sptr<NotificationBundleOption> &bundleOption, std::string &key) in GetDistributedBundleKey() argument 73 …key = DISTRIBUTED_LABEL + DELIMITER + BUNDLE_LABEL + DELIMITER + bundleOption->GetBundleName() + D… in GetDistributedBundleKey() 80 std::string key = entry.key.ToString(); in ResolveDistributedKey() local 82 std::size_t distributedLabelEndPosition = key.find(DELIMITER, distributedLabelPosition); in ResolveDistributedKey() 87 std::size_t typeLabelEndPosition = key.find(DELIMITER, typeLabelPosition); in ResolveDistributedKey() 92 std::string sign = key.substr(typeLabelPosition, typeLabelEndPosition - typeLabelPosition); in ResolveDistributedKey() 97 return ResolveSyncWithoutAppEnable(key, typeLabelEndPosition, entry.value.ToString()); in ResolveDistributedKey() [all …]
|
D | distributed_notification_manager.cpp | 75 …g &deviceId, const std::string &bundleName, const std::string &label, int32_t id, std::string &key) in GenerateDistributedKey() argument 77 key = deviceId + DELIMITER + bundleName + DELIMITER + label + DELIMITER + ToString(id); in GenerateDistributedKey() 81 const std::string &bundleName, const std::string &label, int32_t id, std::string &key) in GenerateLocalDistributedKey() argument 88 GenerateDistributedKey(deviceId, bundleName, label, id, key); in GenerateLocalDistributedKey() 92 bool DistributedNotificationManager::ResolveDistributedKey(const std::string &key, ResolveKey &reso… in ResolveDistributedKey() argument 95 std::size_t deviceIdEndPosition = key.find(DELIMITER, deviceIdPosition); in ResolveDistributedKey() 100 std::size_t bundleNameEndPosition = key.find(DELIMITER, bundleNamePosition); in ResolveDistributedKey() 105 std::size_t labelEndPosition = key.find_last_of(DELIMITER) - DELIMITER.size() + 1; in ResolveDistributedKey() 109 std::size_t idPosition = key.find_last_of(DELIMITER) + DELIMITER.size(); in ResolveDistributedKey() 111 resolveKey.deviceId = key.substr(deviceIdPosition, deviceIdEndPosition - deviceIdPosition); in ResolveDistributedKey() [all …]
|
/base/startup/syspara_lite/interfaces/kits/js/ |
D | @ohos.systemparameter.d.ts | 35 function getSync(key: string, def?: string): string; 44 function get(key: string, callback: AsyncCallback<string>): void; 54 function get(key: string, def: string, callback: AsyncCallback<string>): void; 64 function get(key: string, def?: string): Promise<string>; 73 function setSync(key: string, value: string): void; 83 function set(key: string, value: string, callback: AsyncCallback<void>): void; 93 function set(key: string, value: string): Promise<void>; 106 … function wait(key: string, value: string, timeout: number, callback: AsyncCallback<void>): void; 119 function wait(key: string, value: string, timeout: number): Promise<void>; 138 (key: string, value: string): void;
|
/base/startup/init/interfaces/kits/jskits/ |
D | @ohos.systemparameter.d.ts | 35 function getSync(key: string, def?: string): string; 44 function get(key: string, callback: AsyncCallback<string>): void; 54 function get(key: string, def: string, callback: AsyncCallback<string>): void; 64 function get(key: string, def?: string): Promise<string>; 73 function setSync(key: string, value: string): void; 83 function set(key: string, value: string, callback: AsyncCallback<void>): void; 93 function set(key: string, value: string): Promise<void>; 106 … function wait(key: string, value: string, timeout: number, callback: AsyncCallback<void>): void; 119 function wait(key: string, value: string, timeout: number): Promise<void>; 138 (key: string, value: string): void;
|
/base/security/crypto_framework/test/unittest/src/ |
D | crypto_aes_cipher_test.cpp | 81 static int32_t GenerateSymKey(const char *algoName, HcfSymKey **key) in GenerateSymKey() argument 91 ret = generator->generateSymKey(generator, key); in GenerateSymKey() 99 static int32_t ConvertSymKey(const char *algoName, HcfSymKey **key) in ConvertSymKey() argument 114 ret = generator->convertSymKey(generator, &keyTmpBlob, key); in ConvertSymKey() 182 static int32_t AesMultiBlockEncrypt(HcfCipher *cipher, HcfSymKey *key, HcfParamsSpec *params) in AesMultiBlockEncrypt() argument 196 int32_t ret = cipher->init(cipher, ENCRYPT_MODE, (HcfKey *)key, params); in AesMultiBlockEncrypt() 236 static int32_t AesMultiBlockDecrypt(HcfCipher *cipher, HcfSymKey *key, HcfParamsSpec *params) in AesMultiBlockDecrypt() argument 250 int32_t ret = cipher->init(cipher, DECRYPT_MODE, (HcfKey *)key, params); in AesMultiBlockDecrypt() 290 static int32_t AesEncrypt(HcfCipher *cipher, HcfSymKey *key, HcfParamsSpec *params, in AesEncrypt() argument 297 int32_t ret = cipher->init(cipher, ENCRYPT_MODE, (HcfKey *)key, params); in AesEncrypt() [all …]
|
D | crypto_3des_cipher_test.cpp | 55 static int32_t GenerateDesSymKey(HcfSymKey **key) in GenerateDesSymKey() argument 65 ret = generator->generateSymKey(generator, key); in GenerateDesSymKey() 73 static int32_t DesEncrypt(HcfCipher *cipher, HcfSymKey *key, HcfParamsSpec *params, in DesEncrypt() argument 80 int32_t ret = cipher->init(cipher, ENCRYPT_MODE, (HcfKey *)key, params); in DesEncrypt() 116 static int32_t DesDecrypt(HcfCipher *cipher, HcfSymKey *key, HcfParamsSpec *params, in DesDecrypt() argument 123 int32_t ret = cipher->init(cipher, DECRYPT_MODE, (HcfKey *)key, params); in DesDecrypt() 163 static int32_t DesNoUpdateEncrypt(HcfCipher *cipher, HcfSymKey *key, HcfParamsSpec *params, in DesNoUpdateEncrypt() argument 170 int32_t ret = cipher->init(cipher, ENCRYPT_MODE, (HcfKey *)key, params); in DesNoUpdateEncrypt() 193 static int32_t DesNoUpdateDecrypt(HcfCipher *cipher, HcfSymKey *key, HcfParamsSpec *params, in DesNoUpdateDecrypt() argument 200 int32_t ret = cipher->init(cipher, DECRYPT_MODE, (HcfKey *)key, params); in DesNoUpdateDecrypt() [all …]
|
/base/powermgr/battery_manager/services/native/test/unittest/src/ |
D | battery_config_test.cpp | 75 std::string key = "soc.warning"; variable 76 if (!g_configTest.IsExist(key)) { 77 BATTERY_HILOGD(LABEL_TEST, "BatteryConfig003 %{public}s does not exist", key.c_str()); 81 int32_t warnCapacity = g_configTest.GetInt(key, invalid); 94 std::string key = "temperature.high"; variable 95 if (!g_configTest.IsExist(key)) { 96 BATTERY_HILOGD(LABEL_TEST, "BatteryConfig004 %{public}s does not exist", key.c_str()); 101 int32_t highTemperature = g_configTest.GetInt(key, maxTemp); 114 std::string key = "temperature.low"; variable 115 if (!g_configTest.IsExist(key)) { [all …]
|
/base/telephony/core_service/utils/preferences/include/ |
D | tel_profile_util.h | 33 int SaveString(const std::string &key, const std::string &value); 34 std::string ObtainString(const std::string &key, const std::string &defValue); 35 int SaveInt(const std::string &key, int value); 36 int ObtainInt(const std::string &key, int defValue); 37 int SaveBool(const std::string &key, bool value); 38 bool ObtainBool(const std::string &key, bool defValue); 39 int SaveLong(const std::string &key, int64_t value); 40 int64_t ObtainLong(const std::string &key, int64_t defValue); 41 int SaveFloat(const std::string &key, float value); 42 float ObtainFloat(const std::string &key, float defValue); [all …]
|
/base/security/appverify/interfaces/innerkits/appverify/src/init/ |
D | json_parser_utils.cpp | 51 bool JsonParserUtils::GetJsonString(const nlohmann::json& json, const std::string& key, std::string… in GetJsonString() argument 56 if (json.find(key) != json.end() && json.at(key).is_string()) { in GetJsonString() 57 value = json.at(key).get<std::string>(); in GetJsonString() 62 bool JsonParserUtils::GetJsonInt(const nlohmann::json& json, const std::string& key, int& value) in GetJsonInt() argument 67 if (json.find(key) != json.end() && json.at(key).is_number()) { in GetJsonInt() 68 value = json.at(key).get<int>(); in GetJsonInt() 73 bool JsonParserUtils::GetJsonStringVec(const nlohmann::json& json, const std::string& key, StringVe… in GetJsonStringVec() argument 78 if (json.find(key) != json.end() && json.at(key).is_array()) { in GetJsonStringVec() 79 value = json.at(key).get<StringVec>(); in GetJsonStringVec() 84 bool JsonParserUtils::ParseJsonToObjVec(const nlohmann::json& json, const std::string& key, JsonObj… in ParseJsonToObjVec() argument [all …]
|
/base/telephony/core_service/utils/preferences/src/ |
D | tel_profile_util.cpp | 34 int TelProfileUtil::SaveString(const std::string &key, const std::string &value) in SaveString() argument 40 return ptr->PutString(key, value); in SaveString() 43 std::string TelProfileUtil::ObtainString(const std::string &key, const std::string &defValue) in ObtainString() argument 49 return ptr->GetString(key, defValue); in ObtainString() 52 int TelProfileUtil::SaveInt(const std::string &key, int value) in SaveInt() argument 58 return ptr->PutInt(key, value); in SaveInt() 61 int TelProfileUtil::ObtainInt(const std::string &key, int defValue) in ObtainInt() argument 67 return ptr->GetInt(key, defValue); in ObtainInt() 70 int TelProfileUtil::SaveBool(const std::string &key, bool value) in SaveBool() argument 76 return ptr->PutBool(key, value); in SaveBool() [all …]
|
/base/security/device_auth/services/protocol/src/ |
D | protocol_common.c | 22 void FreeAndCleanKey(Uint8Buff *key) in FreeAndCleanKey() argument 24 if (key == NULL || key->val == NULL) { in FreeAndCleanKey() 27 (void)memset_s(key->val, key->length, 0, key->length); in FreeAndCleanKey() 28 HcFree(key->val); in FreeAndCleanKey() 29 key->val = NULL; in FreeAndCleanKey() 30 key->length = 0; in FreeAndCleanKey()
|
/base/security/huks/services/huks_standard/huks_service/main/os_dependency/ca/ |
D | hks_ca_access.c | 41 int32_t HksAccessSign(const struct HksBlob *key, const struct HksParamSet *paramSet, in HksAccessSign() argument 44 return HksTeeSign(key, paramSet, srcData, signature); in HksAccessSign() 47 int32_t HksAccessVerify(const struct HksBlob *key, const struct HksParamSet *paramSet, in HksAccessVerify() argument 50 return HksTeeVerify(key, paramSet, srcData, signature); in HksAccessVerify() 53 int32_t HksAccessEncrypt(const struct HksBlob *key, const struct HksParamSet *paramSet, in HksAccessEncrypt() argument 56 return HksTeeEncrypt(key, paramSet, plainText, cipherText); in HksAccessEncrypt() 59 int32_t HksAccessDecrypt(const struct HksBlob *key, const struct HksParamSet *paramSet, in HksAccessDecrypt() argument 62 return HksTeeDecrypt(key, paramSet, cipherText, plainText); in HksAccessDecrypt() 70 int32_t HksAccessImportKey(const struct HksBlob *keyAlias, const struct HksBlob *key, in HksAccessImportKey() argument 74 return HksTeeImportKey(key, paramSet, keyOut); in HksAccessImportKey() [all …]
|
/base/useriam/user_auth_framework/frameworks/native/common/attributes/src/ |
D | attributes.cpp | 42 bool SetBoolValue(AttributeKey key, bool value); 43 bool SetUint64Value(AttributeKey key, uint64_t value); 44 bool SetUint32Value(AttributeKey key, uint32_t value); 45 bool SetUint16Value(AttributeKey key, uint16_t value); 46 bool SetUint8Value(AttributeKey key, uint8_t value); 47 bool SetInt32Value(AttributeKey key, int32_t value); 48 bool SetStringValue(AttributeKey key, const std::string &value); 49 bool SetAttributesValue(AttributeKey key, const Impl &value); 50 bool SetUint64ArrayValue(AttributeKey key, const std::vector<uint64_t> &value); 51 bool SetUint32ArrayValue(AttributeKey key, const std::vector<uint32_t> &value); [all …]
|
/base/account/os_account/frameworks/common/database/include/ |
D | iaccount_info.h | 44 …const Json &jsonObject, const nlohmann::detail::iter_impl<const Json> &end, const std::string &key, in GetDataByType() argument 47 if (jsonObject.find(key) != end) { in GetDataByType() 50 if (!jsonObject.at(key).is_boolean()) { in GetDataByType() 53 data = jsonObject.at(key).get<T>(); in GetDataByType() 56 if (!jsonObject.at(key).is_number()) { in GetDataByType() 59 data = jsonObject.at(key).get<T>(); in GetDataByType() 62 if (!jsonObject.at(key).is_object()) { in GetDataByType() 65 data = jsonObject.at(key).get<T>(); in GetDataByType() 68 if (!jsonObject.at(key).is_array()) { in GetDataByType() 71 data = jsonObject.at(key).get<T>(); in GetDataByType() [all …]
|
/base/telephony/data_storage/common/include/ |
D | preferences_util.h | 37 int SaveString(const std::string &key, const std::string &value); 38 std::string ObtainString(const std::string &key, const std::string &defValue); 39 int SaveInt(const std::string &key, int value); 40 int ObtainInt(const std::string &key, int defValue); 41 int SaveBool(const std::string &key, bool value); 42 bool ObtainBool(const std::string &key, bool defValue); 43 int SaveLong(const std::string &key, int64_t value); 44 int64_t ObtainLong(const std::string &key, int64_t defValue); 45 int SaveFloat(const std::string &key, float value); 46 float ObtainFloat(const std::string &key, float defValue); [all …]
|
/base/startup/syspara_lite/frameworks/parameter/src/param_impl_hal/ |
D | param_impl_hal.c | 38 static boolean IsValidKey(const char* key) in IsValidKey() argument 40 if (!IsValidValue(key, MAX_KEY_LEN)) { in IsValidKey() 43 int keyLen = strlen(key); in IsValidKey() 45 if (!IsValidChar(key[i])) { in IsValidKey() 52 int GetSysParam(const char* key, char* value, unsigned int len) in GetSysParam() argument 54 if (!IsValidKey(key) || (value == NULL) || (len > MAX_GET_VALUE_LEN)) { in GetSysParam() 58 if (UtilsFileStat(key, &valueLen) != EC_SUCCESS) { in GetSysParam() 64 int fd = UtilsFileOpen(key, O_RDONLY_FS, 0); in GetSysParam() 79 int SetSysParam(const char* key, const char* value) in SetSysParam() argument 81 if (!IsValidKey(key) || !IsValidValue(value, MAX_VALUE_LEN)) { in SetSysParam() [all …]
|