12 #ifndef __ATTEST_TOKEN_H__
13 #define __ATTEST_TOKEN_H__
17 #ifdef SYMMETRIC_INITIAL_ATTESTATION
18 #include "t_cose_mac0_sign.h"
20 #include "t_cose_sign1_sign.h"
107 #define TOKEN_OPT_OMIT_CLAIMS 0x40000000
117 #define TOKEN_OPT_SHORT_CIRCUIT_SIGN 0x80000000
136 #ifdef SYMMETRIC_INITIAL_ATTESTATION
137 struct t_cose_mac0_sign_ctx mac_ctx;
178 const struct q_useful_buf *out_buffer);
219 const struct q_useful_buf_c *value);
230 const struct q_useful_buf_c *value);
245 const struct q_useful_buf_c *encoded);
262 struct q_useful_buf_c *completed_token);
enum attest_token_err_t attest_token_encode_finish(struct attest_token_encode_ctx *me, struct q_useful_buf_c *completed_token)
Finish the token, complete the signing and get the result.
QCBOREncodeContext cbor_enc_ctx
void attest_token_encode_add_bstr(struct attest_token_encode_ctx *me, int32_t label, const struct q_useful_buf_c *value)
Add a binary string claim.
enum attest_token_err_t attest_token_encode_start(struct attest_token_encode_ctx *me, uint32_t opt_flags, int32_t key_select, int32_t cose_alg_id, const struct q_useful_buf *out_buffer)
Initialize a token creation context.
void attest_token_encode_add_integer(struct attest_token_encode_ctx *me, int32_t label, int64_t value)
Add a 64-bit signed integer claim.
void attest_token_encode_add_tstr(struct attest_token_encode_ctx *me, int32_t label, const struct q_useful_buf_c *value)
Add a text string claim.
QCBOREncodeContext * attest_token_encode_borrow_cbor_cntxt(struct attest_token_encode_ctx *me)
Get a copy of the CBOR encoding context.
void attest_token_encode_add_cbor(struct attest_token_encode_ctx *me, int32_t label, const struct q_useful_buf_c *encoded)
Add some already-encoded CBOR to payload.
struct t_cose_sign1_sign_ctx signer_ctx