blob: 08cb40adb4bdae3d4e947d7bc617016f5a7d30a2 [file] [log] [blame]
Tamas Ban28aeec32019-01-09 16:53:26 +00001/*
2 * Copyright (c) 2019, Arm Limited. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 *
6 */
7
8#ifndef __ATTESTATION_KEY_H__
9#define __ATTESTATION_KEY_H__
10
11#include "psa_initial_attestation_api.h"
Antonio de Angelis3a97d862019-04-25 10:46:05 +010012#include "psa_crypto.h"
Tamas Ban28aeec32019-01-09 16:53:26 +000013
14#ifdef __cplusplus
15extern "C" {
16#endif
17
18/**
Tamas Ban28aeec32019-01-09 16:53:26 +000019 * \brief Get the initial attestation key from platform layer and register it
20 * to crypto service for further usage (signing or verification).
21 *
Antonio de Angelis3a97d862019-04-25 10:46:05 +010022 * \param[out] key_handle_private Pointer to the key handle allocated for the
23 * private key
24 * \param[out] key_handle_public Pointer to the key handle allocated for the
25 * public key
26 *
Tamas Ban28aeec32019-01-09 16:53:26 +000027 * Private key MUST be present on the device, public key is optional.
28 *
29 * \retval PSA_ATTEST_ERR_SUCCESS Key(s) was registered.
30 * \retval PSA_ATTEST_ERR_GENERAL Key(s) could not be registered.
31 */
Antonio de Angelis3a97d862019-04-25 10:46:05 +010032enum psa_attest_err_t attest_register_initial_attestation_key(
33 psa_key_handle_t *key_handle_private,
34 psa_key_handle_t *key_handle_public);
Tamas Ban28aeec32019-01-09 16:53:26 +000035/**
36 * \brief Unregister the initial attestation key(s) from crypto service to do
37 * not occupy key slot(s).
38 *
Antonio de Angelis3a97d862019-04-25 10:46:05 +010039 * \param[in] key_handle_private Key handle associated to the private key
40 * \param[in] key_handle_public Key handle associated to the public key
41 *
Tamas Ban28aeec32019-01-09 16:53:26 +000042 * \retval PSA_ATTEST_ERR_SUCCESS Key(s) was unregistered.
43 * \retval PSA_ATTEST_ERR_GENERAL Key(s) could not be unregistered.
44 */
Antonio de Angelis3a97d862019-04-25 10:46:05 +010045enum psa_attest_err_t attest_unregister_initial_attestation_key(
46 psa_key_handle_t key_handle_private,
47 psa_key_handle_t key_handle_public);
Tamas Ban28aeec32019-01-09 16:53:26 +000048#ifdef __cplusplus
49}
50#endif
51
52#endif /* __ATTESTATION_KEY_H__ */