openHiTLS API openHiTLS 0.1.0-Alpha1
结构体 | 类型定义 | 函数
Crypt_eal_pkey

the asym key module 更多...

Crypt_eal_pkey 的协作图:

结构体

struct  CRYPT_EAL_PkeyPub
 
struct  CRYPT_EAL_PkeyPrv
 
struct  CRYPT_EAL_PkeyPara
 

类型定义

typedef struct EAL_PkeyCtx CRYPT_EAL_PkeyCtx
 
typedef bool(* CRYPT_EAL_Pct) (CRYPT_EAL_PkeyCtx *pkey)
 Key pairing consistency test
 

函数

bool CRYPT_EAL_PkeyIsValidAlgId (CRYPT_PKEY_AlgId id)
 Check whether the id is valid asymmetric algorithm ID.
 
CRYPT_EAL_PkeyCtxCRYPT_EAL_PkeyNewCtx (CRYPT_PKEY_AlgId id)
 Create an asymmetric key pair structure.
 
int32_t CRYPT_EAL_PkeyCopyCtx (CRYPT_EAL_PkeyCtx *to, const CRYPT_EAL_PkeyCtx *from)
 Copy the pkey context.
 
CRYPT_EAL_PkeyCtxCRYPT_EAL_PkeyDupCtx (const CRYPT_EAL_PkeyCtx *pkey)
 Copy the Pkey context. After the duplication is complete, call the CRYPT_EAL_PkeyFreeCtx interface to release the memory.
 
void CRYPT_EAL_PkeyFreeCtx (CRYPT_EAL_PkeyCtx *pkey)
 Release the asymmetric key pair structure.
 
int32_t CRYPT_EAL_PkeySetPara (CRYPT_EAL_PkeyCtx *pkey, const CRYPT_EAL_PkeyPara *para)
 Set the key parameters, the key parameter marked as "para" is applied for and released by the caller.
 
int32_t CRYPT_EAL_PkeyGetPara (const CRYPT_EAL_PkeyCtx *pkey, CRYPT_EAL_PkeyPara *para)
 Obtain the key parameter, the key parameter marked as "para" is applied for and released by the caller.
 
int32_t CRYPT_EAL_PkeySetParaById (CRYPT_EAL_PkeyCtx *pkey, CRYPT_PKEY_ParaId id)
 Set key parameters.
 
int32_t CRYPT_EAL_PkeyGen (CRYPT_EAL_PkeyCtx *pkey)
 Generate the key data.
 
int32_t CRYPT_EAL_PkeySetPub (CRYPT_EAL_PkeyCtx *pkey, const CRYPT_EAL_PkeyPub *key)
 Set the public key. The caller applies for and releases memory for the public key marked as "key".
 
int32_t CRYPT_EAL_PkeySetPrv (CRYPT_EAL_PkeyCtx *pkey, const CRYPT_EAL_PkeyPrv *key)
 Set the private key. The caller applies for and releases memory for the private key marked as "key".
 
int32_t CRYPT_EAL_PkeyGetPub (const CRYPT_EAL_PkeyCtx *pkey, CRYPT_EAL_PkeyPub *key)
 Obtain the public key. The caller applies for and releases memory for the public key marked as "key".
 
int32_t CRYPT_EAL_PkeyGetPrv (const CRYPT_EAL_PkeyCtx *pkey, CRYPT_EAL_PkeyPrv *key)
 Obtain the private key. The caller applies for and releases memory for the private key marked as "key".
 
int32_t CRYPT_EAL_PkeySign (const CRYPT_EAL_PkeyCtx *pkey, CRYPT_MD_AlgId id, const uint8_t *data, uint32_t dataLen, uint8_t *sign, uint32_t *signLen)
 Signature interface
 
int32_t CRYPT_EAL_PkeyVerify (const CRYPT_EAL_PkeyCtx *pkey, CRYPT_MD_AlgId id, const uint8_t *data, uint32_t dataLen, const uint8_t *sign, uint32_t signLen)
 Signature verification interface
 
int32_t CRYPT_EAL_PkeySignData (const CRYPT_EAL_PkeyCtx *pkey, const uint8_t *hash, uint32_t hashLen, uint8_t *sign, uint32_t *signLen)
 Sign hash data
 
int32_t CRYPT_EAL_PkeyVerifyData (const CRYPT_EAL_PkeyCtx *pkey, const uint8_t *hash, uint32_t hashLen, const uint8_t *sign, uint32_t signLen)
 Verify the signature of the hash data
 
int32_t CRYPT_EAL_PkeyEncrypt (const CRYPT_EAL_PkeyCtx *pkey, const uint8_t *data, uint32_t dataLen, uint8_t *out, uint32_t *outLen)
 Encrypt data.
 
int32_t CRYPT_EAL_PkeyDecrypt (const CRYPT_EAL_PkeyCtx *pkey, const uint8_t *data, uint32_t dataLen, uint8_t *out, uint32_t *outLen)
 Decrypt the data.
 
int32_t CRYPT_EAL_PkeyPairCheck (CRYPT_EAL_PkeyCtx *pubKey, CRYPT_EAL_PkeyCtx *prvKey)
 Check whether the public and private keys match.
 
int32_t CRYPT_EAL_PkeyComputeShareKey (const CRYPT_EAL_PkeyCtx *pkey, const CRYPT_EAL_PkeyCtx *pubKey, uint8_t *share, uint32_t *shareLen)
 Compute the shared key.
 
uint32_t CRYPT_EAL_PkeyGetKeyLen (const CRYPT_EAL_PkeyCtx *pkey)
 Obtain the number of bytes in the key length.
 
uint32_t CRYPT_EAL_PkeyGetSecurityBits (const CRYPT_EAL_PkeyCtx *pkey)
 Obtain the key security strength. Only supports CRYPT_PKEY_RSA and CRYPT_PKEY_ECDSA.
 
uint32_t CRYPT_EAL_PkeyGetKeyBits (const CRYPT_EAL_PkeyCtx *pkey)
 Obtain the number of bits in the key length.
 
uint32_t CRYPT_EAL_PkeyGetSignLen (const CRYPT_EAL_PkeyCtx *pkey)
 Obtains the signature length of the key for signature, only support algorithm that can be signed.
 
int32_t CRYPT_EAL_PkeyCtrl (CRYPT_EAL_PkeyCtx *pkey, int32_t opt, void *val, uint32_t len)
 Make specific option for setting/obtain, supported option can see the structure of CRYPT_PkeyCtrl.
 
CRYPT_PKEY_AlgId CRYPT_EAL_PkeyGetId (const CRYPT_EAL_PkeyCtx *pkey)
 Obtain the key algorithm type.
 
CRYPT_PKEY_ParaId CRYPT_EAL_PkeyGetParaId (const CRYPT_EAL_PkeyCtx *pkey)
 Obtain the key algorithm parameter ID.
 
int32_t CRYPT_EAL_PkeyCheck (const CRYPT_EAL_PkeyCtx *pkey)
 Check the key pair consistency. only supports CRYPT_PKEY_DH.
 
int32_t CRYPT_EAL_PkeyCmp (const CRYPT_EAL_PkeyCtx *a, const CRYPT_EAL_PkeyCtx *b)
 Compare keys or parameters
 
int32_t CRYPT_EAL_PkeySetExtData (CRYPT_EAL_PkeyCtx *pkey, void *data)
 Set the user's personal data.
 
void * CRYPT_EAL_PkeyGetExtData (const CRYPT_EAL_PkeyCtx *pkey)
 Obtain the user's personal data.
 
int32_t CRYPT_EAL_PkeyUpRef (CRYPT_EAL_PkeyCtx *pkey)
 EAL layer reference counting auto-increment
 

详细描述

the asym key module