Home
last modified time | relevance | path

Searched refs:KeyBlob (Results 1 – 17 of 17) sorted by relevance

/ohos5.0/foundation/filemanagement/storage_service/services/storage_daemon/include/crypto/
H A Dkey_blob.h60 class KeyBlob {
63 KeyBlob(KeyBlob const &blob) in KeyBlob() function
71 ~KeyBlob() in ~KeyBlob()
80 KeyBlob(KeyBlob &&right) in KeyBlob() function
94 KeyBlob& operator=(KeyBlob &&right)
146 KeyBlob key;
150 KeyBlob keyId;
157 KeyBlob shield;
161 KeyBlob nonce;
162 KeyBlob aad;
[all …]
H A Dbase_key.h64 …bool EncryptKeyBlob(const UserAuth &auth, const std::string &keyPath, KeyBlob &planKey, KeyBlob &e…
65 …bool DecryptKeyBlob(const UserAuth &auth, const std::string &keyPath, KeyBlob &planKey, KeyBlob &d…
83 static bool SaveKeyBlob(const KeyBlob &blob, const std::string &path);
101 static bool GenerateAndSaveKeyBlob(KeyBlob &blob, const std::string &path, const uint32_t size);
102 static bool GenerateKeyBlob(KeyBlob &blob, const uint32_t size);
103 static bool LoadKeyBlob(KeyBlob &blob, const std::string &path, const uint32_t size);
109 … bool CombKeyCtx(const KeyBlob &nonce, const KeyBlob &rndEnc, const KeyBlob &aad, KeyBlob &keyOut);
110 bool SplitKeyCtx(const KeyBlob &keyIn, KeyBlob &nonce, KeyBlob &rndEnc, KeyBlob &aad);
111 void CombKeyBlob(const KeyBlob &encAad, const KeyBlob &end, KeyBlob &keyOut);
112 void SplitKeyBlob(const KeyBlob &keyIn, KeyBlob &encAad, KeyBlob &nonce, uint32_t start);
H A Dopenssl_crypto.h28 static bool AESDecrypt(const KeyBlob &preKey, KeyContext &keyContext_, KeyBlob &plainText);
29 … static bool AESEncrypt(const KeyBlob &preKey, const KeyBlob &plainText, KeyContext &keyContext_);
30 static KeyBlob HashWithPrefix(const KeyBlob &prefix, const KeyBlob &payload, uint32_t length);
H A Dhuks_master.h38 static KeyBlob GenerateRandomKey(uint32_t keyLen);
39 bool GenerateKey(const UserAuth &auth, KeyBlob &keyOut);
41 bool EncryptKeyEx(const UserAuth &auth, const KeyBlob &rnd, KeyContext &ctx);
43 bool DecryptKeyEx(KeyContext &ctx, const UserAuth &auth, KeyBlob &rnd);
64 const KeyBlob &keyIn, KeyBlob &keyOut);
H A Dfscrypt_key_v1.h56 bool InstallKeyForAppKeyToKeyring(KeyBlob &appKey);
58 bool GenerateAppKeyDesc(KeyBlob appKey);
59 bool DoDecryptClassE(const UserAuth &auth, KeyBlob &eSecretFBE, KeyBlob &decryptedKey,
H A Dkey_backup.h49 KeyBlob &planKey,
50 KeyBlob &decryptedKey);
/ohos5.0/foundation/filemanagement/storage_service/services/storage_daemon/include/mock/
H A Dbase_key_mock.h36 virtual bool DecryptKeyBlob(const UserAuth &, const std::string &, KeyBlob &, KeyBlob &) = 0;
37 virtual bool EncryptKeyBlob(const UserAuth &, const std::string &, KeyBlob &, KeyBlob &) = 0;
39 virtual bool SaveKeyBlob(const KeyBlob &blob, const std::string &path) = 0;
56 MOCK_METHOD4(DecryptKeyBlob, bool(const UserAuth &, const std::string &, KeyBlob &, KeyBlob &));
57 MOCK_METHOD4(EncryptKeyBlob, bool(const UserAuth &, const std::string &, KeyBlob &, KeyBlob &));
59 MOCK_METHOD2(SaveKeyBlob, bool(const KeyBlob &blob, const std::string &path));
/ohos5.0/foundation/filemanagement/storage_service/services/storage_daemon/crypto/src/
H A Dopenssl_crypto.cpp28 bool OpensslCrypto::AESDecrypt(const KeyBlob &preKey, KeyContext &keyContext_, KeyBlob &plainText) in AESDecrypt()
31 KeyBlob shield = HashWithPrefix(preKey, keyContext_.secDiscard, AES_256_HASH_RANDOM_SIZE); in AESDecrypt()
48 plainText = KeyBlob(keyContext_.rndEnc.size - GCM_NONCE_BYTES - GCM_MAC_BYTES); in AESDecrypt()
80 bool OpensslCrypto::AESEncrypt(const KeyBlob &preKey, const KeyBlob &plainText, KeyContext &keyCont… in AESEncrypt()
83 KeyBlob shield = HashWithPrefix(preKey, keyContext_.secDiscard, AES_256_HASH_RANDOM_SIZE); in AESEncrypt()
129 KeyBlob OpensslCrypto::HashWithPrefix(const KeyBlob &prefix, const KeyBlob &payload, uint32_t lengt… in HashWithPrefix()
131 KeyBlob res(SHA512_DIGEST_LENGTH); in HashWithPrefix()
H A Dbase_key.cpp74 KeyBlob tempAad(sourceCtx.aad); in DoTempStore()
75 KeyBlob tempNonce(sourceCtx.nonce); in DoTempStore()
76 KeyBlob tempRndEnc(sourceCtx.rndEnc); in DoTempStore()
77 KeyBlob tempShield(sourceCtx.shield); in DoTempStore()
468 KeyBlob rndEnc(keyCtx.rndEnc); in StoreKey()
532 KeyBlob tempEnc(keyContext_.rndEnc.size); in StoreKey()
736 KeyBlob rndEnc(keyCtx.rndEnc); in StoreKey()
972 void BaseKey::CombKeyBlob(const KeyBlob &encAad, const KeyBlob &end, KeyBlob &keyOut) in StoreKey()
982 void BaseKey::SplitKeyBlob(const KeyBlob &keyIn, KeyBlob &encAad, KeyBlob &nonce, uint32_t start) in StoreKey()
1014 bool BaseKey::CombKeyCtx(const KeyBlob &nonce, const KeyBlob &rndEnc, const KeyBlob &aad, KeyBlob &… in StoreKey()
[all …]
H A Dfscrypt_key_v1.cpp74 KeyBlob appKey(FBEX_KEYID_SIZE); in GenerateAppkey()
100 bool FscryptKeyV1::InstallKeyForAppKeyToKeyring(KeyBlob &appKey) in InstallKeyForAppKeyToKeyring()
227 bool FscryptKeyV1::DoDecryptClassE(const UserAuth &auth, KeyBlob &eSecretFBE, KeyBlob &decryptedKey, in DoDecryptClassE()
271 KeyBlob eSecretFBE(AES_256_HASH_RANDOM_SIZE + GCM_MAC_BYTES + GCM_NONCE_BYTES); in DecryptClassE()
289 KeyBlob decryptedKey(AES_256_HASH_RANDOM_SIZE); in DecryptClassE()
309 KeyBlob eSecretFBE(AES_256_HASH_RANDOM_SIZE); in EncryptClassE()
320 KeyBlob encryptedKey(AES_256_HASH_RANDOM_SIZE + GCM_MAC_BYTES + GCM_NONCE_BYTES); in EncryptClassE()
535 bool FscryptKeyV1::GenerateAppKeyDesc(KeyBlob appKey) in GenerateAppKeyDesc()
H A Dhuks_master.cpp338 KeyBlob HuksMaster::GenerateRandomKey(uint32_t keyLen) in GenerateRandomKey()
341 KeyBlob out(keyLen); in GenerateRandomKey()
389 bool HuksMaster::GenerateKey(const UserAuth &auth, KeyBlob &keyOut) in GenerateKey()
416 KeyBlob alias = GenerateRandomKey(CRYPTO_KEY_ALIAS_SIZE); in GenerateKey()
433 static KeyBlob HashWithPrefix(const std::string &prefix, const KeyBlob &payload, uint32_t length) in HashWithPrefix()
435 KeyBlob res(SHA512_DIGEST_LENGTH); in HashWithPrefix()
458 static int AppendAeTag(KeyBlob &cipherText, HksParamSet *paramSet) in AppendAeTag()
666 const KeyBlob &keyIn, KeyBlob &keyOut) in HuksHalTripleStage()
799 bool HuksMaster::DecryptKeyEx(KeyContext &ctx, const UserAuth &auth, KeyBlob &rnd) in DecryptKeyEx()
833 static bool CheckNeedUpgrade(KeyBlob &inData) in CheckNeedUpgrade()
[all …]
H A Dkey_backup.cpp136 KeyBlob &planKey, in TryRestoreUeceKey()
137 KeyBlob &decryptedKey) in TryRestoreUeceKey()
H A Dkey_manager.cpp901 KeyBlob token(userTokenSecret.token); in UpdateCeEceSeceUserAuth()
909 KeyBlob token(userTokenSecret.token); in UpdateCeEceSeceUserAuth()
910 KeyBlob newSecret(userTokenSecret.newSecret); in UpdateCeEceSeceUserAuth()
/ohos5.0/foundation/filemanagement/storage_service/services/storage_daemon/mock/
H A Dbase_key_mock.cpp88 bool BaseKey::DecryptKeyBlob(const UserAuth &auth, const std::string &keyPath, KeyBlob &planKey, in DecryptKeyBlob()
89 KeyBlob &decryptedKey) in DecryptKeyBlob()
97 bool BaseKey::EncryptKeyBlob(const UserAuth &auth, const std::string &keyPath, KeyBlob &planKey, in EncryptKeyBlob()
98 KeyBlob &encryptedKey) in EncryptKeyBlob()
127 bool BaseKey::SaveKeyBlob(const KeyBlob &blob, const std::string &path) in SaveKeyBlob()
/ohos5.0/docs/zh-cn/device-dev/subsystems/
H A Dsubsys-security-huks-guide.md75 - **KeyBlob格式**
76 接口返回的密钥必须按照密钥存储态组装成KeyBlob,哪些接口需要遵循该限制请见[接口说明](#接口说明)。
78 ![KeyBlob格式图](figures/HUKS-KeyBlob.png)
94 … | 根据密码算法参数,生成密钥,并返回密文材料。 | 出参要遵循KeyBlob格式 |gener…
95 … | 导入明文密钥,并返回密文材料。 | 出参要遵循KeyBlob格式 | imp…
201 出参,密钥密文材料,将密钥属性paramset和生成的密钥密文存放在这里,格式参考KeyBlob
211 2. keyOut请参照KeyBlob的结构。
258 出参,密钥密文材料,将密钥属性paramset和生成的密钥密文存放在这里,格式参考KeyBlob
268 2. encKeyOut请参照KeyBlob的结构。
322 导入密钥的密文材料,参考KeyBlob格式
[all …]
/ohos5.0/docs/en/device-dev/subsystems/
H A Dsubsys-security-huks-guide.md79 - KeyBlob
80 The key returned by the APIs must be assembled into a **KeyBlob** based on the key storage status. …
82 ![KeyBlob format](figures/HUKS-KeyBlob.png)
99 … plaintext. | The key output must be in the **KeyBlob** format. …
100 …ted) key. | The key output must be in the **KeyBlob** format. …
203 …ey generated in ciphertext. It holds the **paramSet** and the key ciphertext in the KeyBlob format.
213 2. **keyOut** must be in the **KeyBlob** format.
260 …key in ciphertext. It holds the **paramSet** and the imported key ciphertext in the KeyBlob format.
270 2. Check that **encKeyOut** is in the KeyBlob format.
324 Pointer to the imported key material (ciphertext) in the KeyBlob format.
[all …]
/ohos5.0/foundation/filemanagement/storage_service/services/storage_daemon/crypto/test/fbex_test/
H A Dfbex_test.cpp361 KeyBlob eBuffer(VALID_SIZE);