Home
last modified time | relevance | path

Searched refs:pk (Results 1 – 25 of 40) sorted by relevance

12

/base/security/crypto_framework/frameworks/key/
Dasy_key_generator.c117 if ((paramsSpec->pk.data == NULL) || (paramsSpec->pk.len == 0)) { in IsDsaPubKeySpecValid()
129 if ((paramsSpec->pk.data == NULL) || (paramsSpec->pk.len == 0)) { in IsDsaKeyPairSpecValid()
212 if ((paramsSpec->pk.x.data == NULL) || (paramsSpec->pk.x.len == 0) || in IsEccPubKeySpecValid()
213 (paramsSpec->pk.y.data == NULL) || (paramsSpec->pk.y.len == 0)) { in IsEccPubKeySpecValid()
225 if ((paramsSpec->pk.x.data == NULL) || (paramsSpec->pk.x.len == 0) || in IsEccKeyPairSpecValid()
226 (paramsSpec->pk.y.data == NULL) || (paramsSpec->pk.y.len == 0)) { in IsEccKeyPairSpecValid()
274 if ((paramsSpec->pk.data == NULL) || (paramsSpec->pk.len == 0)) { in IsRsaPubKeySpecValid()
286 if ((paramsSpec->pk.data == NULL) || (paramsSpec->pk.len == 0)) { in IsRsaKeyPairSpecValid()
480 spec->pk.data = (unsigned char *)HcfMalloc(srcSpec->pk.len, 0); in CreateDsaPubKeySpecImpl()
481 if (spec->pk.data == NULL) { in CreateDsaPubKeySpecImpl()
[all …]
/base/security/huks/frameworks/crypto_lite/cipher/src/
Dcipher_rsa.c127 static int32_t RsaLoadPrivateKey(mbedtls_pk_context *pk, const unsigned char *key, size_t keyLen) in RsaLoadPrivateKey() argument
143 ret = mbedtls_pk_parse_key(pk, (const unsigned char *)finalKey, finalKeyLen, NULL, 0, in RsaLoadPrivateKey()
150 rsa = mbedtls_pk_rsa(*pk); in RsaLoadPrivateKey()
175 static int32_t RsaLoadPublicKey(mbedtls_pk_context *pk, const unsigned char *key, size_t keyLen) in RsaLoadPublicKey() argument
187 ret = mbedtls_pk_parse_public_key(pk, (const unsigned char *)finalKey, finalKeyLen); in RsaLoadPublicKey()
193 rsa = mbedtls_pk_rsa(*pk); in RsaLoadPublicKey()
326 mbedtls_pk_context pk; in RsaEncrypt() local
327 mbedtls_pk_init(&pk); in RsaEncrypt()
328 if (RsaLoadPublicKey(&pk, (const unsigned char *)key->key, key->keyLen) != 0) { in RsaEncrypt()
329 mbedtls_pk_free(&pk); in RsaEncrypt()
[all …]
/base/security/crypto_framework/test/unittest/src/
Dcrypto_dsa_asy_key_generator_by_spec_test.cpp254 .pk = pk_BN
263 .pk = pk_BN,
395 HcfPubKey *pk = nullptr; variable
396 ret = generator->generatePubKey(generator, &pk);
399 ASSERT_NE(pk, nullptr);
401 HcfObjDestroy(pk);
412 HcfPubKey *pk = nullptr; variable
413 ret = generator->generatePubKey(generator, &pk);
416 ASSERT_NE(pk, nullptr);
418 HcfObjDestroy(pk);
[all …]
Dcrypto_asy_key_generator_cov_test.cpp314 .pk = g_dsaCorrectPkBn
323 .pk = g_dsaNullPkBn
332 .pk = g_dsaNoLenPkBn
342 .pk = g_dsaCorrectPkBn,
352 .pk = g_dsaCorrectPkBn,
362 .pk = g_dsaNullPkBn,
372 .pk = g_dsaNoLenPkBn,
382 .pk = g_dsaCorrectPkBn,
392 .pk = g_dsaCorrectPkBn,
487 returnPubSpec->pk.data = dataE; in GenerateRsa2048CorrectPubKeySpec()
[all …]
Dcrypto_ecc_key_agreement_by_spec_test.cpp92 eccKeyPairSpec->pk.x.data = (IS_BIG_ENDIAN ? g_ecc224CorrectBigPkX : g_ecc224CorrectLittlePkX); in ConstructEcc224KeyPairParamsSpec()
93 eccKeyPairSpec->pk.x.len = NID_secp224r1_len; in ConstructEcc224KeyPairParamsSpec()
94 eccKeyPairSpec->pk.y.data = (IS_BIG_ENDIAN ? g_ecc224CorrectBigPkY : g_ecc224CorrectLittlePkY); in ConstructEcc224KeyPairParamsSpec()
95 eccKeyPairSpec->pk.y.len = NID_secp224r1_len; in ConstructEcc224KeyPairParamsSpec()
126 eccKeyPairSpec->pk.x.data = (IS_BIG_ENDIAN ? g_ecc256CorrectBigPkX : g_ecc256CorrectLittlePkX); in ConstructEcc256KeyPairParamsSpec()
127 eccKeyPairSpec->pk.x.len = NID_X9_62_prime256v1_len; in ConstructEcc256KeyPairParamsSpec()
128 eccKeyPairSpec->pk.y.data = (IS_BIG_ENDIAN ? g_ecc256CorrectBigPkY : g_ecc256CorrectLittlePkY); in ConstructEcc256KeyPairParamsSpec()
129 eccKeyPairSpec->pk.y.len = NID_X9_62_prime256v1_len; in ConstructEcc256KeyPairParamsSpec()
160 eccKeyPairSpec->pk.x.data = (IS_BIG_ENDIAN ? g_ecc384CorrectBigPkX : g_ecc384CorrectLittlePkX); in ConstructEcc384KeyPairParamsSpec()
161 eccKeyPairSpec->pk.x.len = NID_secp384r1_len; in ConstructEcc384KeyPairParamsSpec()
[all …]
Dcrypto_signature_exception_test.cpp65 HcfPubKey pk; variable
66 HcfResult ret = EngineVerifyInit((HcfVerifySpi *)&g_obj, nullptr, &pk);
69 ret = EngineVerifyInit((HcfVerifySpi *)&g_obj, nullptr, &pk);
Dcrypto_dsa_exception_test.cpp352 HcfPubKey *pk = nullptr; variable
353 ret = EngineGenerateDsaPubKeyBySpec((const HcfAsyKeyGeneratorSpi *)&g_obj, &asySpecPk, &pk);
409 HcfPubKey *pk = nullptr; variable
410 ret = IsVerifyInitInputValid((HcfVerifySpi *)&g_obj, pk);
Dcrypto_dsa_asy_key_generator_test.cpp450 HcfBigInteger pk = { .data = nullptr, .len = 0 }; variable
451 …lt ret = dsa2048KeyPair_->pubKey->getAsyKeySpecBigInteger(dsa2048KeyPair_->pubKey, DSA_PK_BN, &pk);
454 ASSERT_NE(pk.data, nullptr);
455 ASSERT_NE(pk.len, 0);
456 HcfFree(pk.data);
919 HcfBigInteger pk = { .data = nullptr, .len = 0 }; variable
920 ret = convertKeyPair->pubKey->getAsyKeySpecBigInteger(convertKeyPair->pubKey, DSA_PK_BN, &pk);
925 ASSERT_NE(pk.data, nullptr);
926 ASSERT_NE(pk.len, 0);
927 HcfFree(pk.data);
/base/security/crypto_framework/common/src/
Dasy_key_params.c60 HcfFree(spec->pk.data); in DestroyDsaPubKeySpec()
61 spec->pk.data = NULL; in DestroyDsaPubKeySpec()
71 HcfFree(spec->pk.data); in DestroyDsaKeyPairSpec()
72 spec->pk.data = NULL; in DestroyDsaKeyPairSpec()
127 FreeEcPointMem(&(spec->pk)); in DestroyEccPubKeySpec()
149 FreeEcPointMem(&(spec->pk)); in DestroyEccKeyPairSpec()
179 HcfFree(spec->pk.data); in DestroyRsaPubKeySpec()
180 spec->pk.data = NULL; in DestroyRsaPubKeySpec()
190 HcfFree(spec->pk.data); in DestroyRsaKeyPairSpec()
191 spec->pk.data = NULL; in DestroyRsaKeyPairSpec()
/base/security/appverify/interfaces/innerkits/appverify_lite/src/
Dapp_verify.c550 static unsigned char *GetRsaPk(const mbedtls_pk_context *pk, int32_t *len) in GetRsaPk() argument
564 int32_t pkLen = mbedtls_pk_write_pubkey(&c, buf, pk); in GetRsaPk()
593 static unsigned char *GetEcPk(const mbedtls_pk_context *pk, int32_t *len) in GetEcPk() argument
595 mbedtls_ecp_keypair *ecCtx = mbedtls_pk_ec(*pk); in GetEcPk()
643 static unsigned char *GetPkBuf(const mbedtls_pk_context *pk, int32_t *len) in GetPkBuf() argument
646 …if (mbedtls_pk_get_type(pk) == MBEDTLS_PK_RSA || mbedtls_pk_get_type(pk) == MBEDTLS_PK_RSASSA_PSS)… in GetPkBuf()
647 bufA = GetRsaPk(pk, len); in GetPkBuf()
648 …} else if (mbedtls_pk_get_type(pk) == MBEDTLS_PK_ECDSA || mbedtls_pk_get_type(pk) == MBEDTLS_PK_EC… in GetPkBuf()
649 bufA = GetEcPk(pk, len); in GetPkBuf()
654 static int32_t ParseCertGetPk(const char *certEncoded, AppSignPk *pk) in ParseCertGetPk() argument
[all …]
Dmbedtls_pkcs7.c851 static int32_t GetSignerPubKeyOfSignature(const SignerInfo *signer, mbedtls_pk_context **pk) in GetSignerPubKeyOfSignature() argument
854 if (signer == NULL || pk == NULL) { in GetSignerPubKeyOfSignature()
858 *pk = &signer->certPath.crt->pk; in GetSignerPubKeyOfSignature()
880 mbedtls_pk_context *pk = NULL; in PKCS7_VerifySignerSignature() local
881 rc = GetSignerPubKeyOfSignature(signer, &pk); in PKCS7_VerifySignerSignature()
900 … mbedtls_rsa_set_padding(pk->MBEDTLS_PRIVATE(pk_ctx), MBEDTLS_RSA_PKCS_V21, (mbedtls_md_type_t)0); in PKCS7_VerifySignerSignature()
902 rc = mbedtls_pk_verify(pk, digAlg, hash, hashLen, sig, sigLen); in PKCS7_VerifySignerSignature()
/base/security/crypto_framework/interfaces/innerkits/algorithm_parameter/
Ddetailed_rsa_key_params.h33 HcfBigInteger pk; member
40 HcfBigInteger pk; member
Ddetailed_dsa_key_params.h35 HcfBigInteger pk; member
42 HcfBigInteger pk; member
Ddetailed_ecc_key_params.h52 HcfPoint pk; member
63 HcfPoint pk; member
/base/security/crypto_framework/plugin/openssl_plugin/key/asy_key_generator/src/
Ddsa_asy_key_generator_openssl.c107 Openssl_DSA_free(impl->pk); in DestroyDsaPubKey()
108 impl->pk = NULL; in DestroyDsaPubKey()
177 int len = Openssl_i2d_DSA_PUBKEY(impl->pk, &returnData); in GetDsaPubKeyEncoded()
247 DSA *dsaPk = impl->pk; in GetBigIntegerSpecFromDsaPubKey()
400 static void FillOpensslDsaPubKeyFunc(HcfOpensslDsaPubKey *pk) in FillOpensslDsaPubKeyFunc() argument
402 pk->base.base.base.destroy = DestroyDsaPubKey; in FillOpensslDsaPubKeyFunc()
403 pk->base.base.base.getClass = GetDsaPubKeyClass; in FillOpensslDsaPubKeyFunc()
404 pk->base.base.getAlgorithm = GetDsaPubKeyAlgorithm; in FillOpensslDsaPubKeyFunc()
405 pk->base.base.getEncoded = GetDsaPubKeyEncoded; in FillOpensslDsaPubKeyFunc()
406 pk->base.base.getFormat = GetDsaPubKeyFormat; in FillOpensslDsaPubKeyFunc()
[all …]
Drsa_asy_key_generator_openssl.c213 const BIGNUM *n = Openssl_RSA_get0_n(impl->pk); in GetRsaPubKeySpecBigInteger()
224 const BIGNUM *e = Openssl_RSA_get0_e(impl->pk); in GetRsaPubKeySpecBigInteger()
252 Openssl_RSA_free(impl->pk); in DestroyPubKey()
253 impl->pk = NULL; in DestroyPubKey()
416 return EncodePubKeyToX509(impl->pk, returnBlob); in GetPubKeyEncoded()
515 (*retPubKey)->pk = rsaPubKey; in PackPubKey()
804 if (BigIntegerToBigNum(&((HcfRsaKeyPairParamsSpec *)paramsSpec)->pk, e) != HCF_SUCCESS) { in ParseRsaBnFromBin()
820 if (BigIntegerToBigNum(&((HcfRsaPubKeyParamsSpec *)paramsSpec)->pk, e) != HCF_SUCCESS) { in ParseRsaBnFromBin()
/base/security/appverify/interfaces/innerkits/appverify_lite/include/
Dapp_verify_pub.h114 char *pk; member
119 typedef int32_t (*GetSignPk)(struct VfyRst *verifyRst, AppSignPk *pk);
120 typedef void (*FreeSignPK)(AppSignPk *pk);
/base/security/crypto_framework/plugin/openssl_plugin/common/inc/
Dopenssl_class.h61 RSA *pk; member
82 DSA *pk; member
/base/security/crypto_framework/test/fuzztest/key/asykeygenerator_fuzzer/
Dasykeygenerator_fuzzer.cpp269 .pk = pk_BN
278 .pk = pk_BN,
380 returnPubSpec->pk.data = dataE; in GenerateRsa2048CorrectPubKeySpec()
381 returnPubSpec->pk.len = RSA_2048_E_BYTE_SIZE; in GenerateRsa2048CorrectPubKeySpec()
398 returnPairSpec->pk.data = dataE; in GenerateRsa2048CorrectKeyPairSpec()
399 returnPairSpec->pk.len = RSA_2048_E_BYTE_SIZE; in GenerateRsa2048CorrectKeyPairSpec()
457 … eccPubKeySpec->pk.x.data = (IsBigEndian() ? g_ecc224CorrectBigPkX : g_ecc224CorrectLittlePkX); in ConstructEcc224PubKeyParamsSpec()
458 eccPubKeySpec->pk.x.len = NID_secp224r1_len; in ConstructEcc224PubKeyParamsSpec()
459 … eccPubKeySpec->pk.y.data = (IsBigEndian() ? g_ecc224CorrectBigPkY : g_ecc224CorrectLittlePkY); in ConstructEcc224PubKeyParamsSpec()
460 eccPubKeySpec->pk.y.len = NID_secp224r1_len; in ConstructEcc224PubKeyParamsSpec()
[all …]
/base/update/packaging_tools/
DREADME_zh.md77 -pk PRIVATE_KEY, --private_key PRIVATE_KEY Private key file path.
83 python build_update.py ./target/ ./target/package -pk ./target/updater_config/rsa_private_key2048.p…
89 python build_update.py -s source.zip ./target/ ./target/package -pk./target/updater_config/rsa_priv…
DREADME.md65 -pk PRIVATE_KEY, --private_key PRIVATE_KEY Private key file path.
71 python build_update.py ./target/ ./target/package -pk ./target/updater_config/rsa_private_key2048.p…
77 python build_update.py -s source.zip ./target/ ./target/package -pk./target/updater_config/rsa_priv…
/base/security/crypto_framework/frameworks/js/napi/crypto/src/
Dnapi_utils.cpp583 napi_value pk = GetDetailAsyKeySpecValue(env, arg, "pk"); in GetDsaPubKeySpec() local
584 bool ret = GetBigIntFromNapiValue(env, pk, &spec->pk); in GetDsaPubKeySpec()
615 napi_value pk = GetDetailAsyKeySpecValue(env, arg, "pk"); in GetDsaKeyPairAsyKeySpec() local
616 bool ret = GetBigIntFromNapiValue(env, pk, &spec->pk); in GetDsaKeyPairAsyKeySpec()
626 HcfFree(spec->pk.data); in GetDsaKeyPairAsyKeySpec()
868 napi_value pk = GetDetailAsyKeySpecValue(env, arg, "pk"); in GetEccPubKeySpec() local
869 bool ret = GetPointFromNapiValue(env, pk, &spec->pk); in GetEccPubKeySpec()
901 napi_value pk = GetDetailAsyKeySpecValue(env, arg, "pk"); in GetEccKeyPairAsyKeySpec() local
902 bool ret = GetPointFromNapiValue(env, pk, &spec->pk); in GetEccKeyPairAsyKeySpec()
912 HcfFree(spec->pk.x.data); in GetEccKeyPairAsyKeySpec()
[all …]
/base/security/certificate_framework/frameworks/adapter/v1.0/inc/
Dcertificate_openssl_class.h37 RSA *pk; member
/base/security/huks/test/unittest/huks_standard_test/three_stage_test/src/
Dhks_chipset_platform_encrypt_test.cpp625 HksBlob pk = { .size = static_cast<uint32_t>(pubKey.size()), .data = pubKey.data() }; variable
626 …t ret = HksExportChipsetPlatformPublicKey(&salt, HKS_CHIPSET_PLATFORM_DECRYPT_SCENE_TA_TO_TA, &pk);
657 HksBlob pk = { .size = static_cast<uint32_t>(pubKey.size()), .data = pubKey.data() }; variable
658 …t ret = HksExportChipsetPlatformPublicKey(&salt, HKS_CHIPSET_PLATFORM_DECRYPT_SCENE_TA_TO_TA, &pk);
674 HksBlob pk = { .size = static_cast<uint32_t>(pubKey.size()), .data = pubKey.data() }; variable
675 …t ret = HksExportChipsetPlatformPublicKey(&salt, HKS_CHIPSET_PLATFORM_DECRYPT_SCENE_TA_TO_TA, &pk);
/base/useriam/user_auth_framework/frameworks/native/executors/src/framework/
Dframework_executor_callback.cpp50 auto pk(publicKey); in OnBeginExecute() local
52 return OnBeginExecuteInner(scheduleId, pk, commandAttrs); in OnBeginExecute()

12