blob: e9f39160ed07341f3760edc491af5ce435ea0bff [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 Ban6c08f9d2019-05-09 08:43:29 +010019 * \brief Get the initial attestation private key from platform layer and
20 * register it to Crypto service to sign the token.
Tamas Ban28aeec32019-01-09 16:53:26 +000021 *
Tamas Ban6c08f9d2019-05-09 08:43:29 +010022 * \param[out] key_handle_private Pointer to the key handle allocated for the
23 * private key
Antonio de Angelis3a97d862019-04-25 10:46:05 +010024 *
Tamas Ban6c08f9d2019-05-09 08:43:29 +010025 * Private key MUST be present on the device, otherwise token cannot be signed.
Tamas Ban28aeec32019-01-09 16:53:26 +000026 *
27 * \retval PSA_ATTEST_ERR_SUCCESS Key(s) was registered.
28 * \retval PSA_ATTEST_ERR_GENERAL Key(s) could not be registered.
29 */
Tamas Ban6c08f9d2019-05-09 08:43:29 +010030enum psa_attest_err_t attest_register_initial_attestation_private_key(
31 psa_key_handle_t *key_handle_private);
32
Tamas Ban28aeec32019-01-09 16:53:26 +000033/**
Tamas Ban6c08f9d2019-05-09 08:43:29 +010034 * \brief Unregister the initial attestation private key from Crypto service
35 * to do not occupy key slot.
Tamas Ban28aeec32019-01-09 16:53:26 +000036 *
Tamas Ban6c08f9d2019-05-09 08:43:29 +010037 * \param[in] key_handle_private Key handle associated to the private key
Antonio de Angelis3a97d862019-04-25 10:46:05 +010038 *
Tamas Ban28aeec32019-01-09 16:53:26 +000039 * \retval PSA_ATTEST_ERR_SUCCESS Key(s) was unregistered.
40 * \retval PSA_ATTEST_ERR_GENERAL Key(s) could not be unregistered.
41 */
Tamas Ban6c08f9d2019-05-09 08:43:29 +010042enum psa_attest_err_t attest_unregister_initial_attestation_private_key(
43 psa_key_handle_t key_handle_private);
Tamas Ban28aeec32019-01-09 16:53:26 +000044#ifdef __cplusplus
45}
46#endif
47
48#endif /* __ATTESTATION_KEY_H__ */