forked from arduino-libraries/Arduino_SecureElement
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSElementArduinoCloudCertificate.h
46 lines (34 loc) · 1.98 KB
/
SElementArduinoCloudCertificate.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*
This file is part of the Arduino_SecureElement library.
Copyright (c) 2024 Arduino SA
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#ifndef SECURE_ELEMENT_ARDUINO_CLOUD_CERTIFICATE_H_
#define SECURE_ELEMENT_ARDUINO_CLOUD_CERTIFICATE_H_
/******************************************************************************
* INCLUDE
******************************************************************************/
#include <utility/SElementCertificate.h>
#include <utility/SElementArduinoCloud.h>
/******************************************************************************
* CLASS DECLARATION
******************************************************************************/
class SElementArduinoCloudCertificate : public SElementCertificate
{
public:
static int write(SecureElement & se, ECP256Certificate & cert, const SElementArduinoCloudSlot certSlot);
static int read(SecureElement & se, ECP256Certificate & cert, const SElementArduinoCloudSlot certSlot, const SElementArduinoCloudSlot keySlot = SElementArduinoCloudSlot::Key);
static int signatureCompare(const byte * signatureA, const String & signatureB);
static int rebuild(SecureElement & se, ECP256Certificate & cert, const String & deviceId,
const String & notBefore, const String & notAfter, const String & serialNumber,
const String & authorityKeyIdentifier, const String & signature,
const SElementArduinoCloudSlot keySlot = SElementArduinoCloudSlot::Key);
private:
static const char constexpr SEACC_ISSUER_COUNTRY_NAME[] = "US";
static const char constexpr SEACC_ISSUER_ORGANIZATION_NAME[] = "Arduino LLC US";
static const char constexpr SEACC_ISSUER_ORGANIZATIONAL_UNIT_NAME[] = "IT";
static const char constexpr SEACC_ISSUER_COMMON_NAME[] = "Arduino";
};
#endif /* SECURE_ELEMENT_ARDUINO_CLOUD_CERTIFICATE_H_ */