ProvisioningLibrary
Atmel Security Provisioning Library
atcaprov_request.h
Go to the documentation of this file.
1 
42 #ifndef ATCAPROV_REQUEST_H
43 #define ATCAPROV_REQUEST_H
44 
45 #include <stddef.h>
46 #include <stdint.h>
47 #include "atcaprov_return_codes.h"
48 
49 #define ATCAPROV_BSON_REQ_MAC_SIZE (32)
50 #define ATCAPROV_BSON_REQ_KEY_SIZE (32)
51 #define ATCAPROV_BSON_REQ_PUBKEY_SIZE (64)
52 #define ATCAPROV_BSON_REQ_CONFIG_SIZE (128)
53 
57 typedef struct atcaprov_request_s
58 {
59  uint8_t key_slot;
60  const uint8_t* signer_ca_public_key;
61  uint8_t chain_id;
62  const uint8_t* mac_secret;
63  const uint8_t* config;
64  const uint8_t* public_key;
66 
71 {
72  uint8_t data[8192];
73  size_t data_size;
76 
77 typedef enum atcaprov_zone_e
78 {
83 
85 {
90 
94 typedef struct atcaprov_cert_data_s
95 {
97  int slot;
98  int offset;
99  int data_size;
100  uint8_t data[416];
102 
103 #ifdef __cplusplus
104 extern "C" {
105 #endif
106 
119  const atcaprov_request_t* request,
120  int data_flags,
122  void* user_data);
123 
133 int atcaprov_get_next_cert_data(atcaprov_cert_data_t* cert_data, atcaprov_response_state_t* state, void* user_data);
134 
140 int atcaprov_get_request_id(void);
141 
144  uint8_t* signer_cert,
145  size_t* signer_cert_size,
146  uint8_t* device_cert,
147  size_t* device_cert_size);
148 
149 #ifdef __cplusplus
150 }
151 #endif
152 
153 #endif
int cert_data_idx
Definition: atcaprov_request.h:74
Return codes from the provisioning server.
Definition: atcaprov_request.h:94
Definition: atcaprov_request.h:81
const uint8_t * config
Device configuration zone (128 bytes)
Definition: atcaprov_request.h:63
const uint8_t * public_key
Device public key (64 bytes)
Definition: atcaprov_request.h:64
const uint8_t * mac_secret
MAC secret required to request certificates (32 bytes)
Definition: atcaprov_request.h:62
int atcaprov_get_request_id(void)
Gets a number identifying the request.
Definition: atcaprov_request.c:279
atcaprov_zone_t zone
What zone the data should be written to.
Definition: atcaprov_request.h:96
Definition: atcaprov_request.h:86
struct atcaprov_response_state_s atcaprov_response_state_t
Definition: atcaprov_request.h:87
atcaprov_zone_e
Definition: atcaprov_request.h:77
int slot
Slot to write the data to.
Definition: atcaprov_request.h:97
enum atcaprov_data_flag_e atcaprov_data_flag_t
enum atcaprov_zone_e atcaprov_zone_t
const uint8_t * signer_ca_public_key
Public key of the signer authority (64 bytes)
Definition: atcaprov_request.h:60
Definition: atcaprov_request.h:88
uint8_t data[8192]
Definition: atcaprov_request.h:72
size_t data_size
Definition: atcaprov_request.h:73
Definition: atcaprov_request.h:80
Definition: atcaprov_request.h:70
int offset
Byte offset within the slot to write the data to.
Definition: atcaprov_request.h:98
atcaprov_data_flag_e
Definition: atcaprov_request.h:84
int atcaprov_get_full_certs(atcaprov_response_state_t *state, uint8_t *signer_cert, size_t *signer_cert_size, uint8_t *device_cert, size_t *device_cert_size)
Definition: atcaprov_request.c:309
uint8_t key_slot
Slot the device public key was generated from.
Definition: atcaprov_request.h:59
struct atcaprov_cert_data_s atcaprov_cert_data_t
int data_size
Number of bytes of data to be written.
Definition: atcaprov_request.h:99
uint8_t chain_id
ID of the certificate chain to request.
Definition: atcaprov_request.h:61
Definition: atcaprov_request.h:79
int atcaprov_request_certificates(const atcaprov_request_t *request, int data_flags, atcaprov_response_state_t *state, void *user_data)
Request certificates from the provisioning server.
Definition: atcaprov_request.c:48
Definition: atcaprov_request.h:57
struct atcaprov_request_s atcaprov_request_t
int atcaprov_get_next_cert_data(atcaprov_cert_data_t *cert_data, atcaprov_response_state_t *state, void *user_data)
Gets the next certificate data chunk from the certificate request response.
Definition: atcaprov_request.c:222
uint8_t data[416]
Data to be written.
Definition: atcaprov_request.h:100