harmony 鸿蒙CryptoDigestApi
CryptoDigestApi
Overview
Provides APIs for message digest (MD) algorithms.
Since: 12
Summary
Files
Name | Description |
---|---|
crypto_digest.h | Defines APIs for MD algorithms. |
Types
Name | Description |
---|---|
typedef struct OH_CryptoDigest OH_CryptoDigest | Defines an MD. |
Functions
Name | Description |
---|---|
OH_Crypto_ErrCode OH_CryptoDigest_Create (const char *algoName, OH_CryptoDigest **ctx) | Creates an MD instance based on the given algorithm name. |
OH_Crypto_ErrCode OH_CryptoDigest_Update (OH_CryptoDigest *ctx, Crypto_DataBlob *in) | Updates the data used for generating an MD. |
OH_Crypto_ErrCode OH_CryptoDigest_Final (OH_CryptoDigest *ctx, Crypto_DataBlob *out) | Generates an MD. |
uint32_t OH_CryptoDigest_GetLength (OH_CryptoDigest *ctx) | Obtains the length of an MD. |
const char * OH_CryptoDigest_GetAlgoName (OH_CryptoDigest *ctx) | Obtains the digest algorithm. |
void OH_DigestCrypto_Destroy (OH_CryptoDigest *ctx) | Destroys an MD instance. |
Type Description
OH_CryptoDigest
typedef struct OH_CryptoDigestOH_CryptoDigest
Description
Defines an MD.
Since: 12
Function Description
OH_CryptoDigest_Create()
OH_Crypto_ErrCode OH_CryptoDigest_Create (const char *algoName, OH_CryptoDigest **ctx )
Description
Creates an MD instance based on the given algorithm name.
Since: 12
Parameters
Name | Description |
---|---|
algoName | Pointer to the algorithm used to generate the MD instance. For example, ‘SHA256’. |
ctx | Pointer to the MD instance created. |
Returns
0: The operation is successful.
401: Invalid parameters are detected.
801: The operation is not supported.
17620001: A memory error occurred.
17630001: Failed to call an API of a third-party algorithm library.
OH_CryptoDigest_Final()
OH_Crypto_ErrCode OH_CryptoDigest_Final (OH_CryptoDigest *ctx, Crypto_DataBlob *out )
Description
Generates an MD.
Since: 12
Parameters
Name | Description |
---|---|
ctx | Pointer to the MD instance. |
out | Pointer to the MD generated. |
Returns
0: The operation is successful.
401: Invalid parameters are detected.
801: The operation is not supported.
17620001: A memory error occurred.
17630001: Failed to call an API of a third-party algorithm library.
See
OH_CryptoDigest_GetAlgoName()
const char* OH_CryptoDigest_GetAlgoName (OH_CryptoDigest *ctx)
Description
Obtains the digest algorithm.
Since: 12
Parameters
Name | Description |
---|---|
ctx | Pointer to the MD instance. |
Returns
MD algorithm obtained.
OH_CryptoDigest_GetLength()
uint32_t OH_CryptoDigest_GetLength (OH_CryptoDigest *ctx)
Description
Obtains the length of an MD.
Since: 12
Parameters
Name | Description |
---|---|
ctx | Pointer to the MD instance. |
Returns
0: The operation is successful.
401: Invalid parameters are detected.
801: The operation is not supported.
17620001: A memory error occurred.
17630001: Failed to call an API of a third-party algorithm library.
OH_CryptoDigest_Update()
OH_Crypto_ErrCode OH_CryptoDigest_Update (OH_CryptoDigest *ctx, Crypto_DataBlob *in )
Description
Updates the data used for generating an MD.
Since: 12
Parameters
Name | Description |
---|---|
ctx | Pointer to the MD instance. |
in | Pointer to the data to pass in. |
Returns
0: The operation is successful.
401: Invalid parameters are detected.
801: The operation is not supported.
17620001: A memory error occurred.
17630001: Failed to call an API of a third-party algorithm library.
See
OH_DigestCrypto_Destroy()
void OH_DigestCrypto_Destroy (OH_CryptoDigest *ctx)
Description
Destroys an MD instance.
Since: 12
Parameters
Name | Description |
---|---|
ctx | Pointer to the MD instance. |
Returns
0: The operation is successful.
401: Invalid parameters are detected.
801: The operation is not supported.
17620001: A memory error occurred.
17630001: Failed to call an API of a third-party algorithm library.
你可能感兴趣的鸿蒙文章
harmony 鸿蒙Crypto Architecture Kit (Crypto Architecture Service)
- 所属分类: 后端技术
- 本文标签:
热门推荐
-
2、 - 优质文章
-
3、 gate.io
-
8、 golang
-
9、 openharmony
-
10、 Vue中input框自动聚焦