From 2fa6afe916e8ecbb0854f24d248fc29e73cd3912 Mon Sep 17 00:00:00 2001 From: Fabrice Fontaine Date: Thu, 17 Sep 2020 10:15:57 +0200 Subject: [PATCH] Allow the user to set his own client certificate This will allow the user to use ArduinoBearSSL without the ECCX08 (for example with an (e)SIM applet compliant to the new GSMA IoT SAFE standard) Signed-off-by: Fabrice Fontaine --- src/BearSSLClient.cpp | 5 +++++ src/BearSSLClient.h | 2 ++ 2 files changed, 7 insertions(+) diff --git a/src/BearSSLClient.cpp b/src/BearSSLClient.cpp index 67d00ee..16f18ab 100644 --- a/src/BearSSLClient.cpp +++ b/src/BearSSLClient.cpp @@ -205,6 +205,11 @@ void BearSSLClient::setEccSign(br_ecdsa_sign sign) _ecSign = sign; } +void BearSSLClient::setEccCert(br_x509_certificate cert) +{ + _ecCert = cert; +} + void BearSSLClient::setEccSlot(int ecc508KeySlot, const byte cert[], int certLength) { // HACK: put the key slot info. in the br_ec_private_key structure diff --git a/src/BearSSLClient.h b/src/BearSSLClient.h index 8296cd9..125f41e 100644 --- a/src/BearSSLClient.h +++ b/src/BearSSLClient.h @@ -74,6 +74,8 @@ class BearSSLClient : public Client { void setEccVrfy(br_ecdsa_vrfy vrfy); void setEccSign(br_ecdsa_sign sign); + void setEccCert(br_x509_certificate cert); + void setEccSlot(int ecc508KeySlot, const byte cert[], int certLength); void setEccSlot(int ecc508KeySlot, const char cert[]);