16#ifndef PRIVPASS_TOKEN_H
17#define PRIVPASS_TOKEN_H
21#include "bsl_params.h"
23#include "auth_privpass_token.h"
30#define PRIVPASS_PUBLIC_VERIFY_TOKENTYPE ((uint16_t)0x0002)
31#define PRIVPASS_TOKEN_NK 256
32#define PRIVPASS_TOKEN_SHA256_SIZE 32
33#define PRIVPASS_TOKEN_NONCE_LEN 32
34#define PRIVPASS_MAX_ISSUER_NAME_LEN 65535
35#define PRIVPASS_REDEMPTION_LEN 32
36#define PRIVPASS_MAX_ORIGIN_INFO_LEN 65535
39#define HITLS_AUTH_PRIVPASS_TOKEN_INPUT_LEN (2 + 32 + 32 + 32)
43 uint8_t *challengeReq;
44 uint32_t challengeReqLen;
57 uint8_t truncatedTokenKeyId;
67 HITLS_AUTH_PRIVPASS_TOKEN_RESPONSE_PUB = 1,
68} PrivPass_TokenResponseType;
79 uint8_t nonce[PRIVPASS_TOKEN_NONCE_LEN];
80 uint8_t challengeDigest[PRIVPASS_TOKEN_SHA256_SIZE];
81 uint8_t tokenKeyId[PRIVPASS_TOKEN_SHA256_SIZE];
114 uint8_t tokenKeyId[PRIVPASS_TOKEN_SHA256_SIZE];
115 uint8_t nonce[PRIVPASS_TOKEN_NONCE_LEN];
Parameter identifiers for authentication control-style APIs.
int32_t(* HITLS_AUTH_PrivPassCheckKeyPair)(void *pubKeyCtx, void *prvKeyCtx)
Verifies that a public/private key pair matches.
定义 auth_privpass_token.h:248
int32_t(* HITLS_AUTH_PrivPassDecodePrvKey)(void *libCtx, const char *attrName, void *param, uint8_t *prvKey, uint32_t prvKeyLen, void **pkeyCtx)
Decodes a private key and gen a key ctx. The default algorithm callback implementation is supported o...
定义 auth_privpass_token.h:235
void(* HITLS_AUTH_PrivPassFreePkeyCtx)(void *pkeyCtx)
Frees a previously allocated key context.
定义 auth_privpass_token.h:116
int32_t(* HITLS_AUTH_PrivPassBlind)(void *pkeyCtx, int32_t algId, const uint8_t *data, uint32_t dataLen, uint8_t *blindedData, uint32_t *blindedDataLen)
Blinds data using the key context and hash algorithm for blind signature protocol....
定义 auth_privpass_token.h:150
int32_t(* HITLS_AUTH_PrivPassVerify)(void *pkeyCtx, int32_t algId, const uint8_t *data, uint32_t dataLen, const uint8_t *sign, uint32_t signLen)
Verifies a signature using the public key context.
定义 auth_privpass_token.h:200
void *(* HITLS_AUTH_PrivPassNewPkeyCtx)(void *libCtx, const char *attrName, int32_t algId)
Creates a new public/private key context for the specified algorithm.
定义 auth_privpass_token.h:108
int32_t(* HITLS_AUTH_PrivPassDecodePubKey)(void *libCtx, const char *attrName, uint8_t *pubKey, uint32_t pubKeyLen, void **pkeyCtx)
Decodes a public key and gen a key ctx. The default algorithm callback implementation is supported on...
定义 auth_privpass_token.h:217
int32_t(* HITLS_AUTH_PrivPassRandom)(uint8_t *buffer, uint32_t bufferLen)
Generates random bytes.
定义 auth_privpass_token.h:260
int32_t(* HITLS_AUTH_PrivPassDigest)(void *libCtx, const char *attrName, int32_t algId, const uint8_t *input, uint32_t inputLen, uint8_t *digest, uint32_t *digestLen)
Computes a cryptographic digest of the input data.
定义 auth_privpass_token.h:132
int32_t(* HITLS_AUTH_PrivPassUnblind)(void *pkeyCtx, const uint8_t *blindedData, uint32_t blindedDataLen, uint8_t *data, uint32_t *dataLen)
Unblinds previously blinded data to reveal the actual signature. The default algorithm callback imple...
定义 auth_privpass_token.h:167
int32_t(* HITLS_AUTH_PrivPassSignData)(void *pkeyCtx, const uint8_t *data, uint32_t dataLen, uint8_t *sign, uint32_t *signLen)
Signs data using the private key context.
定义 auth_privpass_token.h:183