Skip to content

Commit 916049c

Browse files
committed
Remove dependency from ArduinoECCX08
1 parent 71e5887 commit 916049c

File tree

4 files changed

+8
-13
lines changed

4 files changed

+8
-13
lines changed

.github/workflows/compile-examples.yml

-6
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,6 @@ jobs:
102102
platforms: |
103103
# Install Arduino mbed_nano Boards via Boards Manager
104104
- name: arduino:mbed_nicla
105-
libraries: |
106-
- name: ArduinoECCX08
107105
- board:
108106
platform-name: arduino:mbed_opta
109107
platforms: |
@@ -123,15 +121,11 @@ jobs:
123121
platforms: |
124122
# Install Arduino renesas_portenta Boards via Boards Manager
125123
- name: arduino:renesas_portenta
126-
libraries: |
127-
- name: ArduinoECCX08
128124
- board:
129125
platform-name: arduino:renesas_uno
130126
platforms: |
131127
# Install Arduino renesas_uno Boards via Boards Manager
132128
- name: arduino:renesas_uno
133-
libraries: |
134-
- name: ArduinoECCX08
135129
136130
steps:
137131
- name: Checkout

src/ECP256Certificate.h

+5-2
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,11 @@ class ECP256Certificate {
101101
/* Import DER buffer into CertClass*/
102102
int importCert(const byte certDER[], size_t derLen);
103103

104+
protected:
105+
106+
int publicKeyLength();
107+
int appendPublicKey(const byte publicKey[], byte out[]);
108+
104109
private:
105110

106111
struct CertInfo {
@@ -154,7 +159,6 @@ class ECP256Certificate {
154159
int versionLength();
155160
int issuerOrSubjectLength(const CertInfo& issuerOrSubjectData);
156161
int sequenceHeaderLength(int length);
157-
int publicKeyLength();
158162
int signatureLength(const byte signature[]);
159163
int serialNumberLength(const byte serialNumber[], int length);
160164
int authorityKeyIdLength(const byte authorityKeyId[], int length);
@@ -171,7 +175,6 @@ class ECP256Certificate {
171175
int appendVersion(int version, byte out[]);
172176
int appendName(const String& name, int type, byte out[]);
173177
int appendIssuerOrSubject(const CertInfo& issuerOrSubjectData, byte out[]);
174-
int appendPublicKey(const byte publicKey[], byte out[]);
175178
int appendSignature(const byte signature[], byte out[]);
176179
int appendSerialNumber(const byte serialNumber[], int length, byte out[]);
177180
int appendDate(int year, int month, int day, int hour, int minute, int second, byte out[]);

src/utility/SElementJWS.cpp

+2-4
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414

1515
#include <utility/SElementJWS.h>
1616
#include <utility/SElementBase64.h>
17-
#include <ArduinoECCX08.h>
18-
#include <utility/ASN1Utils.h>
1917

2018
String SElementJWS::publicKey(SecureElement & se, int slot, bool newPrivateKey)
2119
{
@@ -35,10 +33,10 @@ String SElementJWS::publicKey(SecureElement & se, int slot, bool newPrivateKey)
3533
}
3634
}
3735

38-
int length = ASN1Utils.publicKeyLength();
36+
int length = publicKeyLength();
3937
byte out[length];
4038

41-
ASN1Utils.appendPublicKey(publicKey, out);
39+
appendPublicKey(publicKey, out);
4240

4341
return b64::encode(out, length, "-----BEGIN PUBLIC KEY-----\n", "\n-----END PUBLIC KEY-----\n");
4442
}

src/utility/SElementJWS.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* CLASS DECLARATION
2222
******************************************************************************/
2323

24-
class SElementJWS
24+
class SElementJWS : public ECP256Certificate
2525
{
2626
public:
2727

0 commit comments

Comments
 (0)