Home
last modified time | relevance | path

Searched refs:HcfKey (Results 1 – 25 of 70) sorted by relevance

123

/ohos5.0/base/security/crypto_framework/test/unittest/src/
H A Dcrypto_rsa_asy_key_pem_test.cpp812 res = pubkey->base.getEncodedPem((HcfKey *)pubkey, "X509", &retStr); in RsaAsyKeyPemTest3()
840 res = pubkey->base.getEncodedPem((HcfKey *)pubkey, "X509", &retStr); in RsaAsyKeyPemTest4()
869 res = pubkey->base.getEncodedPem((HcfKey *)pubkey, "X509", &retStr); in RsaAsyKeyPemTest5()
910 res = pubkey->base.getEncodedPem((HcfKey *)pubkey, "X509", &retStr); in RsaAsyKeyPemTest6()
951 res = pubkey->base.getEncodedPem((HcfKey *)pubkey, "X509", &retStr); in RsaAsyKeyPemTest7()
992 res = pubkey->base.getEncodedPem((HcfKey *)pubkey, "X509", &retStr); in RsaAsyKeyPemTest8()
1247 res = pubkey->base.getEncodedPem((HcfKey *)pubkey, "test", &retStr);
1255 res = pubkey->base.getEncodedPem((HcfKey *)pubkey, "x509", &retStr);
1259 res = prikey->base.getEncodedPem((HcfKey *)prikey, "X509", &retStr);
1263 res = prikey->base.getEncodedPem((HcfKey *)prikey, "test", &retStr);
[all …]
H A Dcrypto_rsa_asy_key_generator_test.cpp407 EXPECT_NE(pubkey->base.getFormat((HcfKey *)pubkey), nullptr);
413 EXPECT_NE(prikey->base.getFormat((HcfKey *)prikey), nullptr);
439 EXPECT_NE(pubkey->base.getFormat((HcfKey *)pubkey), nullptr);
445 EXPECT_NE(prikey->base.getFormat((HcfKey *)prikey), nullptr);
467 res = pubKey->base.getEncoded((HcfKey *)priKey, &pubKeyBlob);
469 res = priKey->base.getEncoded((HcfKey *)pubKey, &priKeyBlob);
488 res = pubKey->base.getEncoded((HcfKey *)priKey, nullptr);
490 res = priKey->base.getEncoded((HcfKey *)pubKey, nullptr);
519 EXPECT_NE(pubkey->base.getFormat((HcfKey *)pubkey), nullptr);
525 EXPECT_NE(prikey->base.getFormat((HcfKey *)prikey), nullptr);
[all …]
H A Dcrypto_sm2_cipher_test.cpp151 res = cipher->init(cipher, ENCRYPT_MODE, (HcfKey *)keyPair->pubKey, nullptr);
193 res = cipher->init(cipher, DECRYPT_MODE, (HcfKey *)keyPair->priKey, nullptr);
215 res = cipher->init(cipher, ENCRYPT_MODE, (HcfKey *)keyPair->priKey, nullptr);
236 res = cipher->init(cipher, DECRYPT_MODE, (HcfKey *)keyPair->pubKey, nullptr);
257 res = cipher->init(nullptr, DECRYPT_MODE, (HcfKey *)keyPair->priKey, nullptr);
320 res = cipher->init(cipher, ENCRYPT_MODE, (HcfKey *)keyPair->pubKey, nullptr);
352 res = cipher->init(cipher, ENCRYPT_MODE, (HcfKey *)keyPair->pubKey, nullptr);
362 res = cipher->init(cipher, DECRYPT_MODE, (HcfKey *)keyPair->priKey, nullptr);
472 res = cipher->init(cipher, ENCRYPT_MODE, (HcfKey *)keyPair->pubKey, nullptr);
502 res = cipher->init(cipher, ENCRYPT_MODE, (HcfKey *)keyPair->pubKey, nullptr);
[all …]
H A Dcrypto_rsa_cipher_test.cpp613 res = cipher->init(cipher, ENCRYPT_MODE, (HcfKey *)keyPair->pubKey, nullptr);
655 res = cipher->init(cipher, DECRYPT_MODE, (HcfKey *)keyPair->priKey, nullptr);
677 res = cipher->init(cipher, ENCRYPT_MODE, (HcfKey *)keyPair->priKey, nullptr);
698 res = cipher->init(cipher, DECRYPT_MODE, (HcfKey *)keyPair->pubKey, nullptr);
782 res = cipher->init(cipher, ENCRYPT_MODE, (HcfKey *)keyPair->pubKey, nullptr);
814 res = cipher->init(cipher, ENCRYPT_MODE, (HcfKey *)keyPair->pubKey, nullptr);
824 res = cipher->init(cipher, DECRYPT_MODE, (HcfKey *)keyPair->priKey, nullptr);
858 res = cipher->init(cipher, ENCRYPT_MODE, (HcfKey *)keyPair->pubKey, nullptr);
868 res = cipher->init(cipher, DECRYPT_MODE, (HcfKey *)keyPair->priKey, nullptr);
902 res = cipher->init(cipher, ENCRYPT_MODE, (HcfKey *)keyPair->pubKey, nullptr);
[all …]
H A Dsm4_common.cpp149 int32_t ret = cipher->init(cipher, ENCRYPT_MODE, reinterpret_cast<HcfKey *>(key), params); in Sm4Encrypt()
192 int32_t ret = cipher->init(cipher, DECRYPT_MODE, reinterpret_cast<HcfKey *>(key), params); in Sm4Decrypt()
239 int32_t ret = cipher->init(cipher, ENCRYPT_MODE, reinterpret_cast<HcfKey *>(key), params); in Sm4NoUpdateEncrypt()
269 int32_t ret = cipher->init(cipher, DECRYPT_MODE, reinterpret_cast<HcfKey *>(key), params); in Sm4NoUpdateDecrypt()
H A Dcrypto_dsa_exception_test.cpp218 GetDsaPriKeyAlgorithm((HcfKey *)&g_obj);
223 ret = GetDsaPriKeyEncoded((HcfKey *)&g_obj, nullptr);
227 ret = GetDsaPriKeyEncoded((HcfKey *)&g_obj, &blob);
230 (void)GetDsaPubKeyFormat((HcfKey *)&g_obj);
232 (void)GetDsaPriKeyFormat((HcfKey *)&g_obj);
/ohos5.0/base/security/crypto_framework/interfaces/innerkits/key/
H A Dkey.h60 typedef struct HcfKey HcfKey; typedef
62 struct HcfKey { struct
65 const char *(*getAlgorithm)(HcfKey *self); argument
67 HcfResult (*getEncoded)(HcfKey *self, HcfBlob *returnBlob); argument
69 HcfResult (*getEncodedPem)(HcfKey *self, const char *format, char **returnString); argument
71 const char *(*getFormat)(HcfKey *self); argument
/ohos5.0/base/security/certificate_framework/frameworks/js/napi/certificate/src/
H A Dnapi_key.cpp29 NapiKey::NapiKey(HcfKey *hcfKey) in NapiKey()
36 HcfKey *NapiKey::GetHcfKey() const in GetHcfKey()
48 HcfKey *key = napiKey->GetHcfKey(); in JsGetAlgorithm()
63 HcfKey *key = napiKey->GetHcfKey(); in JsGetFormat()
78 HcfKey *key = napiKey->GetHcfKey(); in JsGetEncoded()
/ohos5.0/base/security/crypto_framework/frameworks/cj/include/
H A Dkey_impl.h28 explicit KeyImpl(HcfKey *hcfKey);
30 HcfKey *GetHcfKey() const;
36 HcfKey *hcfKey_;
/ohos5.0/base/security/certificate_framework/frameworks/js/napi/certificate/inc/
H A Dnapi_key.h28 explicit NapiKey(HcfKey *hcfKey);
30 HcfKey *GetHcfKey() const;
41 HcfKey *hcfKey_;
/ohos5.0/base/security/crypto_framework/frameworks/js/napi/crypto/inc/
H A Dnapi_key.h29 explicit NapiKey(HcfKey *hcfKey);
31 HcfKey *GetHcfKey() const;
42 HcfKey *hcfKey_;
/ohos5.0/base/security/crypto_framework/frameworks/js/napi/crypto/src/
H A Dnapi_key.cpp27 NapiKey::NapiKey(HcfKey *hcfKey) in NapiKey()
34 HcfKey *NapiKey::GetHcfKey() const in GetHcfKey()
51 HcfKey *key = napiKey->GetHcfKey(); in JsGetAlgorithm()
76 HcfKey *key = napiKey->GetHcfKey(); in JsGetFormat()
101 HcfKey *key = napiKey->GetHcfKey(); in JsGetEncoded()
/ohos5.0/base/security/crypto_framework/plugin/openssl_plugin/key/asy_key_generator/src/
H A Dsm2_asy_key_generator_openssl.c395 static const char *GetSm2PubKeyAlgorithm(HcfKey *self) in GetSm2PubKeyAlgorithm()
408 static const char *GetSm2PriKeyAlgorithm(HcfKey *self) in GetSm2PriKeyAlgorithm()
421 static const char *GetSm2PubKeyFormat(HcfKey *self) in GetSm2PubKeyFormat()
434 static const char *GetSm2PriKeyFormat(HcfKey *self) in GetSm2PriKeyFormat()
447 static HcfResult GetSm2PubKeyEncoded(HcfKey *self, HcfBlob *returnBlob) in GetSm2PubKeyEncoded()
486 static HcfResult GetSm2PriKeyEncoded(HcfKey *self, HcfBlob *returnBlob) in GetSm2PriKeyEncoded()
572 static HcfResult CheckSm2KeySelf(const HcfKey *self, bool *isPrivate) in CheckSm2KeySelf()
717 return GetSm2KeySpecString((HcfKey *)self, item, returnString); in GetSm2PubKeySpecString()
722 return GetSm2KeySpecString((HcfKey *)self, item, returnString); in GetSm2PriKeySpecString()
727 return GetSm2KeySpecInt((HcfKey *)self, item, returnInt); in GetSm2PubKeySpecInt()
[all …]
H A Ddsa_asy_key_generator_openssl.c142 static const char *GetDsaPubKeyAlgorithm(HcfKey *self) in GetDsaPubKeyAlgorithm()
154 static const char *GetDsaPriKeyAlgorithm(HcfKey *self) in GetDsaPriKeyAlgorithm()
166 static HcfResult GetDsaPubKeyEncoded(HcfKey *self, HcfBlob *returnBlob) in GetDsaPubKeyEncoded()
188 static HcfResult GetDsaPubKeyEncodedPem(HcfKey *self, const char *format, char **returnString) in GetDsaPubKeyEncodedPem()
196 static HcfResult GetDsaPriKeyEncoded(HcfKey *self, HcfBlob *returnBlob) in GetDsaPriKeyEncoded()
218 static HcfResult GetDsaPriKeyEncodedPem(HcfKey *self, const char *format, char **returnString) in GetDsaPriKeyEncodedPem()
226 static const char *GetDsaPubKeyFormat(HcfKey *self) in GetDsaPubKeyFormat()
238 static const char *GetDsaPriKeyFormat(HcfKey *self) in GetDsaPriKeyFormat()
H A Decc_asy_key_generator_openssl.c931 static const char *GetEccPubKeyAlgorithm(HcfKey *self) in GetEccPubKeyAlgorithm()
943 static const char *GetEccPriKeyAlgorithm(HcfKey *self) in GetEccPriKeyAlgorithm()
955 static const char *GetEccPubKeyFormat(HcfKey *self) in GetEccPubKeyFormat()
967 static const char *GetEccPriKeyFormat(HcfKey *self) in GetEccPriKeyFormat()
1192 static HcfResult GetEccPubKeyEncoded(HcfKey *self, HcfBlob *returnBlob) in GetEccPubKeyEncoded()
1226 static HcfResult GetEccPriKeyEncoded(HcfKey *self, HcfBlob *returnBlob) in GetEccPriKeyEncoded()
1407 static HcfResult CheckEcKeySelf(const HcfKey *self, bool *isPrivate) in CheckEcKeySelf()
1538 return GetEcKeySpecString((HcfKey *)self, item, returnString); in GetECPubKeySpecString()
1543 return GetEcKeySpecInt((HcfKey *)self, item, returnInt); in GetECPubKeySpecInt()
1554 return GetEcKeySpecString((HcfKey *)self, item, returnString); in GetECPriKeySpecString()
[all …]
H A Dalg_25519_asy_key_generator_openssl.c137 static const char *GetAlg25519PubKeyAlgorithm(HcfKey *self) in GetAlg25519PubKeyAlgorithm()
156 static const char *GetAlg25519PriKeyAlgorithm(HcfKey *self) in GetAlg25519PriKeyAlgorithm()
175 static HcfResult GetAlg25519PubKeyEncoded(HcfKey *self, HcfBlob *returnBlob) in GetAlg25519PubKeyEncoded()
202 static HcfResult GetAlg25519PubKeyEncodedPem(HcfKey *self, const char *format, char **returnString) in GetAlg25519PubKeyEncodedPem()
210 static HcfResult GetAlg25519PriKeyEncoded(HcfKey *self, HcfBlob *returnBlob) in GetAlg25519PriKeyEncoded()
237 static HcfResult GetAlg25519PriKeyEncodedPem(HcfKey *self, const char *format, char **returnString) in GetAlg25519PriKeyEncodedPem()
245 static const char *GetAlg25519PubKeyFormat(HcfKey *self) in GetAlg25519PubKeyFormat()
258 static const char *GetAlg25519PriKeyFormat(HcfKey *self) in GetAlg25519PriKeyFormat()
/ohos5.0/base/security/crypto_framework/frameworks/native/src/
H A Dsym_key.c40 HcfKey key;
94 return keyCtx->key.getAlgorithm((HcfKey *)keyCtx); in OH_CryptoSymKey_GetAlgoName()
102 HcfResult ret = keyCtx->key.getEncoded((HcfKey *)keyCtx, (HcfBlob *)out); in OH_CryptoSymKey_GetKeyData()
H A Dsym_cipher.c31 HcfKey *key, HcfParamsSpec *params);
54 HcfKey key;
119 …HcfResult ret = ctx->init((HcfCipher *)ctx, (enum HcfCryptoMode)mod, (HcfKey *)key, (HcfParamsSpec… in OH_CryptoSymCipher_Init()
H A Dasym_key.c54 HcfKey base;
154 ret = key->base.getEncodedPem((HcfKey *)key, encodingStandard, &pemStr); in OH_CryptoPubKey_Encode()
168 … : key->base.getEncoded((HcfKey *)key, (HcfBlob *)out); in OH_CryptoPubKey_Encode()
/ohos5.0/base/security/crypto_framework/frameworks/cj/src/
H A Dkey_impl.cpp19 KeyImpl::KeyImpl(HcfKey *hcfKey) in KeyImpl()
26 HcfKey *KeyImpl::GetHcfKey() const in GetHcfKey()
/ohos5.0/base/security/crypto_framework/plugin/openssl_plugin/common/inc/
H A Decc_openssl_common.h35 HcfResult GetFieldType(const HcfKey *self, const bool isPrivate, char **returnString);
36 HcfResult GetPkSkBigInteger(const HcfKey *self, bool isPrivate,
/ohos5.0/base/security/crypto_framework/test/unittest/src/aes_cipher/
H A Daes_common.cpp162 int32_t ret = cipher->init(cipher, ENCRYPT_MODE, reinterpret_cast<HcfKey *>(key), params); in AesMultiBlockEncrypt()
216 int32_t ret = cipher->init(cipher, DECRYPT_MODE, reinterpret_cast<HcfKey *>(key), params); in AesMultiBlockDecrypt()
307 int32_t ret = cipher->init(cipher, ENCRYPT_MODE, reinterpret_cast<HcfKey *>(key), params); in AesEncrypt()
352 int32_t ret = cipher->init(cipher, DECRYPT_MODE, reinterpret_cast<HcfKey *>(key), params); in AesDecrypt()
456 int32_t ret = cipher->init(cipher, ENCRYPT_MODE, reinterpret_cast<HcfKey *>(key), params); in AesNoUpdateEncrypt()
488 int32_t ret = cipher->init(cipher, DECRYPT_MODE, reinterpret_cast<HcfKey *>(key), params); in AesNoUpdateDecrypt()
/ohos5.0/base/security/crypto_framework/plugin/openssl_plugin/crypto_operation/signature/src/
H A Dsignature_rsa_openssl.c129 static HcfResult CheckInitKeyType(HcfKey *key, bool signing) in CheckInitKeyType()
145 static EVP_PKEY *InitRsaEvpKey(const HcfKey *key, bool signing) in InitRsaEvpKey()
199 EVP_PKEY *dupKey = InitRsaEvpKey((HcfKey *)privateKey, true); in SetOnlySignParams()
241 EVP_PKEY *dupKey = InitRsaEvpKey((HcfKey *)privateKey, true); in SetSignParams()
290 if (CheckInitKeyType((HcfKey *)privateKey, true) != HCF_SUCCESS) { in EngineSignInit()
310 EVP_PKEY *dupKey = InitRsaEvpKey((HcfKey *)publicKey, false); in SetVerifyParams()
345 EVP_PKEY *dupKey = InitRsaEvpKey((HcfKey *)publicKey, false); in SetVerifyRecoverParams()
407 if (CheckInitKeyType((HcfKey *)publicKey, false) != HCF_SUCCESS) { in EngineVerifyInit()
/ohos5.0/base/security/crypto_framework/plugin/openssl_plugin/crypto_operation/cipher/src/
H A Dcipher_sm2_openssl.c44 static HcfResult CheckCipherInitParams(enum HcfCryptoMode opMode, HcfKey *key) in CheckCipherInitParams()
67 static HcfResult InitSm2Key(HcfCipherSm2GeneratorSpiImpl *impl, HcfKey *key, enum HcfCryptoMode opM… in InitSm2Key()
120 HcfKey *key, HcfParamsSpec *params) in EngineInit()
/ohos5.0/base/security/crypto_framework/test/fuzztest/crypto_operation/hcfciphercreate_fuzzer/
H A Dhcfciphercreate_fuzzer.cpp118 int32_t ret = cipher->init(cipher, ENCRYPT_MODE, reinterpret_cast<HcfKey *>(key), nullptr); in Sm4Encrypt()
159 int32_t ret = cipher->init(cipher, DECRYPT_MODE, reinterpret_cast<HcfKey *>(key), nullptr); in Sm4Decrypt()
328 … (void)cipher->init(cipher, ENCRYPT_MODE, reinterpret_cast<HcfKey *>(keyPair->pubKey), nullptr); in TestRsaCipher()
340 … (void)cipher->init(cipher, DECRYPT_MODE, reinterpret_cast<HcfKey *>(keyPair->priKey), nullptr); in TestRsaCipher()

123