citrineos-core
citrineos-core copied to clipboard
Certificate Part 1: Integrate CA Server Client
Changes
- Add CA client interfaces
-
IV2GCertificateAuthorityClient
-
IChargingStationCertificateAuthorityClient
-
- Add 2 Implementations of ca clients: Hubject, ACME (Let's encrypt)
- Hubject: process V2G cert in A02
- ACME: process Charging Station cert in A02. Also allow sign cert using Let's encrypt root ca cert. This function is used in PR: https://github.com/citrineos/citrineos-core/pull/77
- Add new fields for ca clients in system config.
- Add a
CertificateAuthorityService
which instantiates CA clients. - refactor
_handleSignCertificate
.- verify request and then accept or reject the request. (Currently this logic is commented out partially due to a OCTT failed test case)
- sign csr and return a certificate chain (from leaf to sub ca cert except for root ca cert) to charger
Local Tests
Test case 1 sign v2g certificate by hubject and return a cert chain contain signed cert followed by 2 sub CAs.
Test case 2 sign charging station certificate by our sub CA and return a cert chain contain signed cert followed by the sub CA. (Change some code temperaly to only test the flow in A02 without testing a fully workable Profile 3 connection)
Test case 3 verify organization name in the csr