27
27
*/
28
28
29
29
#include < Arduino_SecureElement.h>
30
+ #include < utility/SElementCSR.h>
30
31
31
32
32
33
void setup () {
@@ -36,18 +37,18 @@ void setup() {
36
37
SecureElement secureElement;
37
38
38
39
if (!secureElement.begin ()) {
39
- Serial.println (" No ECCX08 present!" );
40
+ Serial.println (" No SecureElement present!" );
40
41
while (1 );
41
42
}
42
43
43
44
String serialNumber = secureElement.serialNumber ();
44
45
45
- Serial.print (" ECCX08 Serial Number = " );
46
+ Serial.print (" SecureElement Serial Number = " );
46
47
Serial.println (serialNumber);
47
48
Serial.println ();
48
49
49
50
if (!secureElement.locked ()) {
50
- String lock = promptAndReadLine (" The ECCX08 on your board is not locked, would you like to PERMANENTLY configure and lock it now? (y/N)" , " N" );
51
+ String lock = promptAndReadLine (" The SecureElement on your board is not locked, would you like to PERMANENTLY configure and lock it now? (y/N)" , " N" );
51
52
lock.toLowerCase ();
52
53
53
54
if (!lock.startsWith (" y" )) {
@@ -56,16 +57,16 @@ void setup() {
56
57
}
57
58
58
59
if (!secureElement.writeConfiguration ()) {
59
- Serial.println (" Writing ECCX08 configuration failed!" );
60
+ Serial.println (" Writing SecureElement configuration failed!" );
60
61
while (1 );
61
62
}
62
63
63
64
if (!secureElement.lock ()) {
64
- Serial.println (" Locking ECCX08 configuration failed!" );
65
+ Serial.println (" Locking SecureElement configuration failed!" );
65
66
while (1 );
66
67
}
67
68
68
- Serial.println (" ECCX08 locked successfully" );
69
+ Serial.println (" SecureElement locked successfully" );
69
70
Serial.println ();
70
71
}
71
72
@@ -95,7 +96,7 @@ void setup() {
95
96
CSR.setSubjectOrganizationalUnitName (organizationalUnit);
96
97
CSR.setSubjectCommonName (common);
97
98
98
- if (!secureElement. buildCSR ( CSR, slot.toInt (), generateNewKey.startsWith (" y" ))) {
99
+ if (!SElementCSR::build (secureElement, CSR, slot.toInt (), generateNewKey.startsWith (" y" ))) {
99
100
Serial.println (" Error starting CSR generation!" );
100
101
while (1 );
101
102
}
0 commit comments