A. Example header file

Each implementation of the Attestation API must provide a header file named psa/initial_attestation.h, in which the interface elements in this specification are defined.

This appendix provides a example of the psa/initial_attestation.h header file with all of the API elements. This can be used as a starting point or reference for an implementation.

Note

Not all of the API elements are fully defined. An implementation must provide the full definition.

The header will not compile without these missing definitions, and might require reordering to satisfy C compilation rules.

A.1. psa/inital_attestation.h

/* This file is a reference template for implementation of the
 * PSA Certified Attestation API v1.0.3
 */

#ifndef PSA_INITIAL_ATTESTATION_H
#define PSA_INITIAL_ATTESTATION_H

#include <stddef.h>
#include <stdint.h>

#ifdef __cplusplus
extern "C" {
#endif

#define PSA_INITIAL_ATTEST_API_VERSION_MAJOR 1
#define PSA_INITIAL_ATTEST_API_VERSION_MINOR 0
#define PSA_INITIAL_ATTEST_MAX_TOKEN_SIZE /* implementation-specific value */
#define PSA_INITIAL_ATTEST_CHALLENGE_SIZE_32 (32u)
#define PSA_INITIAL_ATTEST_CHALLENGE_SIZE_48 (48u)
#define PSA_INITIAL_ATTEST_CHALLENGE_SIZE_64 (64u)
psa_status_t psa_initial_attest_get_token(const uint8_t *auth_challenge,
                                          size_t challenge_size,
                                          uint8_t *token_buf,
                                          size_t token_buf_size,
                                          size_t *token_size);
psa_status_t psa_initial_attest_get_token_size(size_t challenge_size,
                                               size_t *token_size);

#ifdef __cplusplus
}
#endif

#endif // PSA_INITIAL_ATTESTATION_H