FreeNAS/freenas 2ef147fsrc/middlewared/middlewared/plugins crypto.py

Introduce CryptoKey Service

This commit introduces a new service in crypto plugin which will enable us to move in the following direction:

1) Use cryptography library for our crypto plugin's backend which is more well maintained
2) Introduce ec based keys creation
3) Consolidate x509 certificates and public/private keys logic which will include generation, parsing and validation

The Service takes care of the following tasks:

1) Creating CA's/Cert's/CSR's
2) Loading meaningful attributes from CA's/Cert's/Csr's
3) Create EC/RSA based keys
4) Sign CSR's
5) Validation for certificates/private keys
6) Fix a bug which was copied from legacy code where we signed a CSR, we did not set the SAN extension which meant that the CSR's SAN value was lost

This commit also refactors certificate/certifiaceauthority services to use cryptokey to create certs/csr/ca.

Ticket: #64581
DeltaFile
+682-410src/middlewared/middlewared/plugins/crypto.py
+682-4101 files

UnifiedSplitRaw