harmony 鸿蒙crypto_signature.h

  • 2025-06-12
  • 浏览 (6)

crypto_signature.h

Overview

Provides APIs for signature verification.

Library: libohcrypto.so

System capability: SystemCapability.Security.CryptoFramework

Since: 12

Related module: CryptoSignatureApi

Summary

Types

Name Description
typedef struct OH_CryptoVerify OH_CryptoVerify Defines the data used for signature verification.

Enums

Name Description
CryptoSignature_ParamType {
CRYPTO_PSS_MD_NAME_STR = 100, CRYPTO_PSS_MGF_NAME_STR = 101,
CRYPTO_PSS_MGF1_NAME_STR = 102, CRYPTO_PSS_SALT_LEN_INT = 103,
CRYPTO_PSS_TRAILER_FIELD_INT = 104, CRYPTO_SM2_USER_ID_DATABLOB = 105
}
Enumerates the types of signature verification parameters.

Functions

Name Description
OH_Crypto_ErrCode OH_CryptoVerify_Create (const char *algoName, OH_CryptoVerify **verify) Creates a Verify instance for signature verification.
OH_Crypto_ErrCode OH_CryptoVerify_Init (OH_CryptoVerify *ctx, OH_CryptoPubKey *pubKey) Initializes a Verify instance by using the public key.
OH_Crypto_ErrCode OH_CryptoVerify_Update (OH_CryptoVerify *ctx, Crypto_DataBlob *in) Updates the data to be verified.
bool OH_CryptoVerify_Final (OH_CryptoVerify *ctx, Crypto_DataBlob *in, Crypto_DataBlob *signData) Verifies the signature of the data.
OH_Crypto_ErrCode OH_CryptoVerify_Recover (OH_CryptoVerify *ctx, Crypto_DataBlob *signData, Crypto_DataBlob *rawSignData) Restores the signature data.
const char * OH_CryptoVerify_GetAlgoName (OH_CryptoVerify *ctx) Obtains the signature verification algorithm.
OH_Crypto_ErrCode OH_CryptoVerify_SetParam (OH_CryptoVerify *ctx, CryptoSignature_ParamType type, Crypto_DataBlob *value) Sets signature verification parameters.
OH_Crypto_ErrCode OH_CryptoVerify_GetParam (OH_CryptoVerify *ctx, CryptoSignature_ParamType type, Crypto_DataBlob *value) Obtains signature verification parameters.
void OH_CryptoVerify_Destroy (OH_CryptoVerify *ctx) Destroys a Verify instance.

你可能感兴趣的鸿蒙文章

harmony 鸿蒙Crypto Architecture Kit (Crypto Architecture Service)

harmony 鸿蒙Crypto_DataBlob

harmony 鸿蒙CryptoAsymKeyApi

harmony 鸿蒙CryptoCommonApi

harmony 鸿蒙CryptoDigestApi

harmony 鸿蒙CryptoSignatureApi

harmony 鸿蒙CryptoSymCipherApi

harmony 鸿蒙CryptoSymKeyApi

harmony 鸿蒙crypto_asym_key.h

harmony 鸿蒙crypto_common.h

0  赞