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" |
| 12 | |
| 13 | #ifdef __cplusplus |
| 14 | extern "C" { |
| 15 | #endif |
| 16 | |
| 17 | /** |
| 18 | * \def ATTEST_PRIVATE_KEY_SLOT |
| 19 | * |
| 20 | * \brief Key slot number to store the initial attestation private key. |
| 21 | * |
| 22 | * Private key is used by initial attestation service to sign the |
| 23 | * initial attestation token (IAT). |
| 24 | */ |
| 25 | #define ATTEST_PRIVATE_KEY_SLOT (1u) |
| 26 | |
| 27 | /** |
| 28 | * \def ATTEST_PUBLIC_KEY_SLOT |
| 29 | * |
| 30 | * \brief Key slot number to store the initial attestation public key. |
| 31 | * |
| 32 | * Public key is used by initial attestation test suit to verify the signature |
| 33 | * of the initial attestation token (IAT). |
| 34 | */ |
| 35 | #define ATTEST_PUBLIC_KEY_SLOT (2u) |
| 36 | |
| 37 | /** |
| 38 | * \brief Get the initial attestation key from platform layer and register it |
| 39 | * to crypto service for further usage (signing or verification). |
| 40 | * |
| 41 | * Private key MUST be present on the device, public key is optional. |
| 42 | * |
| 43 | * \retval PSA_ATTEST_ERR_SUCCESS Key(s) was registered. |
| 44 | * \retval PSA_ATTEST_ERR_GENERAL Key(s) could not be registered. |
| 45 | */ |
| 46 | enum psa_attest_err_t attest_register_initial_attestation_key(void); |
| 47 | |
| 48 | /** |
| 49 | * \brief Unregister the initial attestation key(s) from crypto service to do |
| 50 | * not occupy key slot(s). |
| 51 | * |
| 52 | * \retval PSA_ATTEST_ERR_SUCCESS Key(s) was unregistered. |
| 53 | * \retval PSA_ATTEST_ERR_GENERAL Key(s) could not be unregistered. |
| 54 | */ |
| 55 | enum psa_attest_err_t attest_unregister_initial_attestation_key(void); |
| 56 | |
| 57 | #ifdef __cplusplus |
| 58 | } |
| 59 | #endif |
| 60 | |
| 61 | #endif /* __ATTESTATION_KEY_H__ */ |