openharmony 鸿蒙 capi-crypto-common-h

2026-08-25 浏览 (1)

crypto_common.h

Overview

Defines common APIs for cryptographic operations.

Header file: <CryptoArchitectureKit/crypto_common.h>

Library: libohcrypto.so

System capability: SystemCapability.Security.CryptoFramework

Since: 12

Related module: CryptoCommonApi

Summary

Structs

Nametypedef KeywordDescription
Crypto_DataBlobCrypto_DataBlobDefines the data used for encryption and decryption.

Enums

Nametypedef KeywordDescription
OH_Crypto_ErrCodeOH_Crypto_ErrCodeEnumerates the encryption and decryption error codes.
Crypto_CipherModeCrypto_CipherModeEnumerates the cryptographic operation types.

Functions

NameDescription
void OH_Crypto_FreeDataBlob(Crypto_DataBlob *dataBlob)Releases a dataBlob instance.

Enum Description

OH_Crypto_ErrCode

enum OH_Crypto_ErrCode

Description

Enumerates the encryption and decryption error codes.

Since: 12

Enum ItemDescription
CRYPTO_SUCCESS = 0The operation is successful.
CRYPTO_INVALID_PARAMS = 401The input parameter is invalid.
CRYPTO_NOT_SUPPORTED = 801The function or algorithm is not supported.
CRYPTO_MEMORY_ERROR = 17620001Memory error.
CRYPTO_PARAMETER_CHECK_FAILED = 17620003Parameter check failed.
Since: 20
CRYPTO_INVALID_CALL = 17620004Invalid function call.
Since: 26.0.0
CRYPTO_OPERTION_ERROR = 17630001The encryption or decryption operation fails.

Crypto_CipherMode

enum Crypto_CipherMode

Description

Enumerates the cryptographic operation types.

Since: 12

Enum ItemDescription
CRYPTO_ENCRYPT_MODE = 0Encryption.
CRYPTO_DECRYPT_MODE = 1Decryption.

Function Description

OH_Crypto_FreeDataBlob()

void OH_Crypto_FreeDataBlob(Crypto_DataBlob *dataBlob)

Description

Releases a dataBlob instance.

Since: 12

Parameters

NameDescription
Crypto_DataBlob *dataBlobPointer to the dataBlob instance to release.

你可能感兴趣的鸿蒙文章

openharmony 鸿蒙 capi-cryptosymkeyapi-oh-cryptosymkey

openharmony 鸿蒙 capi-cryptoasymkeyapi-oh-cryptoasymkeygeneratorwithspec

openharmony 鸿蒙 capi-cryptoasymcipherapi-oh-cryptoasymcipher

openharmony 鸿蒙 capi-cryptokdfapi-oh-cryptokdfparams

openharmony 鸿蒙 capi-cryptomacapi

openharmony 鸿蒙 capi-cryptodigestapi-oh-cryptodigest

openharmony 鸿蒙 capi-cryptomacapi-oh-cryptomac

openharmony 鸿蒙 capi-cryptosignatureapi-oh-cryptoeccsignaturespec

openharmony 鸿蒙 capi-cryptocommonapi-crypto-datablob

openharmony 鸿蒙 capi-cryptoasymcipherapi-oh-cryptosm2ciphertextspec

  • 所属分类: 后端技术
  • 本文标签: 鸿蒙 软件
  • 版权声明: 本文链接 https://seaxiang.com/blog/YWeq64jP