Tamas Ban | 28aeec3 | 2019-01-09 16:53:26 +0000 | [diff] [blame] | 1 | /* |
| 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 Angelis | 3a97d86 | 2019-04-25 10:46:05 +0100 | [diff] [blame^] | 12 | #include "psa_crypto.h" |
Tamas Ban | 28aeec3 | 2019-01-09 16:53:26 +0000 | [diff] [blame] | 13 | |
| 14 | #ifdef __cplusplus |
| 15 | extern "C" { |
| 16 | #endif |
| 17 | |
| 18 | /** |
Tamas Ban | 28aeec3 | 2019-01-09 16:53:26 +0000 | [diff] [blame] | 19 | * \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 Angelis | 3a97d86 | 2019-04-25 10:46:05 +0100 | [diff] [blame^] | 22 | * \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 Ban | 28aeec3 | 2019-01-09 16:53:26 +0000 | [diff] [blame] | 27 | * 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 Angelis | 3a97d86 | 2019-04-25 10:46:05 +0100 | [diff] [blame^] | 32 | enum 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 Ban | 28aeec3 | 2019-01-09 16:53:26 +0000 | [diff] [blame] | 35 | /** |
| 36 | * \brief Unregister the initial attestation key(s) from crypto service to do |
| 37 | * not occupy key slot(s). |
| 38 | * |
Antonio de Angelis | 3a97d86 | 2019-04-25 10:46:05 +0100 | [diff] [blame^] | 39 | * \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 Ban | 28aeec3 | 2019-01-09 16:53:26 +0000 | [diff] [blame] | 42 | * \retval PSA_ATTEST_ERR_SUCCESS Key(s) was unregistered. |
| 43 | * \retval PSA_ATTEST_ERR_GENERAL Key(s) could not be unregistered. |
| 44 | */ |
Antonio de Angelis | 3a97d86 | 2019-04-25 10:46:05 +0100 | [diff] [blame^] | 45 | enum 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 Ban | 28aeec3 | 2019-01-09 16:53:26 +0000 | [diff] [blame] | 48 | #ifdef __cplusplus |
| 49 | } |
| 50 | #endif |
| 51 | |
| 52 | #endif /* __ATTESTATION_KEY_H__ */ |