11 #ifndef __ATTEST_TOKEN_H__ 12 #define __ATTEST_TOKEN_H__ 89 #define TOKEN_OPT_OMIT_CLAIMS 0x40000000 99 #define TOKEN_OPT_SHORT_CIRCUIT_SIGN 0x80000000
Bad CBOR type, for example an not a text string, when a text string is required.
enum attest_token_err_t attest_token_finish(struct attest_token_ctx *me, struct useful_buf_c *completed_token)
Finish the token, complete the signing and get the result.
void attest_token_add_tstr(struct attest_token_ctx *me, int32_t label, const struct useful_buf_c *value)
Add a text string claim.
QCBOREncodeContext * attest_token_borrow_cbor_cntxt(struct attest_token_ctx *me)
Get a copy of the CBOR encoding context.
Tampering detected in cryptographic function.
Bad CBOR structure, for example not a map when was is required.
void attest_token_add_encoded(struct attest_token_ctx *me, int32_t label, const struct useful_buf_c *encoded)
Add some already-encoded CBOR to payload.
Integer too large, for example an int32_t is required, but value only fits in int64_t.
Q C B O R E n c o d e / D e c o d e.
attest_token_err_t
Error codes returned from attestation token creation.
The non-const UsefulBuf typically used for some allocated memory that is to be filled in...
CBOR Syntax not well-formed – a CBOR syntax error.
Verification key is not found or of wrong type.
UsefulBufC and UsefulBuf are simple data structures to hold a pointer and length for a binary data...
Create a COSE_Sign1, usually for EAT or CWT Token.
A general, unspecific error when creating or decoding the token.
Something went wrong formatting the CBOR, most likely the payload has maps or arrays that are not clo...
The signing algorithm is not supported.
The buffer passed in to receive the output is too small.
void attest_token_add_integer(struct attest_token_ctx *me, int32_t label, int64_t value)
Add a 64-bit signed integer claim.
This is the context for creating a COSE_Sign1 structure.
Something is wrong with the COSE signing structure, missing headers or such.
void attest_token_add_bstr(struct attest_token_ctx *me, int32_t label, const struct useful_buf_c *value)
Add a binary string claim.
COSE signature is invalid, data is corrupted.
A hash function that is needed to make the token is not available.
The context for creating an attestation token.
enum attest_token_err_t attest_token_start(struct attest_token_ctx *me, uint32_t opt_flags, int32_t key_select, int32_t cose_alg_id, const struct useful_buf *out_buffer)
Initialize a token creation context.