Skip to content

Commit 6a6e58e

Browse files
committed
Examples: rename GenerateCSR Sketch
1 parent 6465cec commit 6a6e58e

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

examples/GenerateCSR/GenerateCSR.ino renamed to examples/CertificateSigningRequest/CertificateSigningRequest.ino

+8-7
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
*/
2828

2929
#include <Arduino_SecureElement.h>
30+
#include <utility/SElementCSR.h>
3031

3132

3233
void setup() {
@@ -36,18 +37,18 @@ void setup() {
3637
SecureElement secureElement;
3738

3839
if (!secureElement.begin()) {
39-
Serial.println("No ECCX08 present!");
40+
Serial.println("No SecureElement present!");
4041
while (1);
4142
}
4243

4344
String serialNumber = secureElement.serialNumber();
4445

45-
Serial.print("ECCX08 Serial Number = ");
46+
Serial.print("SecureElement Serial Number = ");
4647
Serial.println(serialNumber);
4748
Serial.println();
4849

4950
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");
5152
lock.toLowerCase();
5253

5354
if (!lock.startsWith("y")) {
@@ -56,16 +57,16 @@ void setup() {
5657
}
5758

5859
if (!secureElement.writeConfiguration()) {
59-
Serial.println("Writing ECCX08 configuration failed!");
60+
Serial.println("Writing SecureElement configuration failed!");
6061
while (1);
6162
}
6263

6364
if (!secureElement.lock()) {
64-
Serial.println("Locking ECCX08 configuration failed!");
65+
Serial.println("Locking SecureElement configuration failed!");
6566
while (1);
6667
}
6768

68-
Serial.println("ECCX08 locked successfully");
69+
Serial.println("SecureElement locked successfully");
6970
Serial.println();
7071
}
7172

@@ -95,7 +96,7 @@ void setup() {
9596
CSR.setSubjectOrganizationalUnitName(organizationalUnit);
9697
CSR.setSubjectCommonName(common);
9798

98-
if (!secureElement.buildCSR(CSR, slot.toInt(), generateNewKey.startsWith("y"))) {
99+
if (!SElementCSR::build(secureElement, CSR, slot.toInt(), generateNewKey.startsWith("y"))) {
99100
Serial.println("Error starting CSR generation!");
100101
while (1);
101102
}

0 commit comments

Comments
 (0)