citrineos-core
citrineos-core copied to clipboard
Certificate Part 3: Add Generate Certificate Endpoint
Changes
This PR adds 2 new endpoints:
- generate root certificate
- either create a self signed root certificate and a sub CA
- or only create a sub CA and sign it by an external ca root certificate (use acme client and Let'e encrypt root cert)
- install root certificate to charger.
- if fileId is set in the request body, this endpoint will install the given file to charger
- if not, the endpoint will get the external root CA according to the certificate type, e.g., if
certificateType
isV2GRootCertificate
, it get root CA from hubject and install it.
Local Test
Test case 1: create self signed root CA and sub CA
- call endpoint and get the generated certificate entities in the response body.
- generated certs and keys are stores in directus files
Test case 2: install root certificate to charger
- install self signed CSMSRootCertificate:
- install external CSMSRootCertificate from Lets encrypt
- install external V2GRootCertificate from hubject
Test case 3: create sub CA signed by external CA server TBD
Test case 4: Everest connect to Citrine using self signed root CA without no matched ciphers error TBD