Upload CA certificate
const url = 'http://localhost:3000/api/v1/ca-certificates';const options = { method: 'POST', headers: {'X-API-Key': '<X-API-Key>', 'Content-Type': 'application/json'}, body: '{"name":"Production Root CA","certificate":"-----BEGIN CERTIFICATE-----\nMIIBkTCC...\n-----END CERTIFICATE-----","privateKey":"-----BEGIN PRIVATE KEY-----\nMIIEvQIB...\n-----END PRIVATE KEY-----","passphrase":"my-secret-passphrase","isRoot":false,"isDefault":false}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://localhost:3000/api/v1/ca-certificates \ --header 'Content-Type: application/json' \ --header 'X-API-Key: <X-API-Key>' \ --data '{ "name": "Production Root CA", "certificate": "-----BEGIN CERTIFICATE-----\nMIIBkTCC...\n-----END CERTIFICATE-----", "privateKey": "-----BEGIN PRIVATE KEY-----\nMIIEvQIB...\n-----END PRIVATE KEY-----", "passphrase": "my-secret-passphrase", "isRoot": false, "isDefault": false }'Upload a new CA certificate and private key. The private key will be encrypted at rest.
Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ”object
Human-readable name for the CA certificate
Example
Production Root CAPEM-encoded CA certificate
Example
-----BEGIN CERTIFICATE-----MIIBkTCC...-----END CERTIFICATE-----PEM-encoded private key (will be encrypted at rest)
Example
-----BEGIN PRIVATE KEY-----MIIEvQIB...-----END PRIVATE KEY-----Passphrase for encrypted private keys (PKCS#8 or legacy PEM encryption)
Example
my-secret-passphraseWhether this is a root CA certificate
Example
trueSet as the default signing CA for new device certificates
Example
falseResponses
Section titled “ Responses ”CA certificate uploaded successfully
object
Unique CA certificate identifier (UUID)
Human-readable name for the CA certificate
SHA-256 fingerprint of the certificate
Whether this is a root CA certificate
Whether this is the default signing CA
Certificate validity start date
Certificate validity end date (expiration)
Date when the CA certificate was retired
Timestamp when the CA certificate was created
Full subject distinguished name
Full issuer distinguished name
Certificate serial number (hex)
Public key algorithm and size
Signature algorithm
Subject Alternative Names
PEM-encoded public certificate (safe to share)
Example
{ "id": "550e8400-e29b-41d4-a716-446655440000", "name": "Production Root CA", "fingerprint": "A1:B2:C3:D4:E5:F6:A1:B2:C3:D4:E5:F6:A1:B2:C3:D4:E5:F6:A1:B2:C3:D4:E5:F6:A1:B2:C3:D4:E5:F6:A1:B2", "isRoot": true, "isDefault": true, "notBefore": "2024-01-01T00:00:00Z", "notAfter": "2034-01-01T00:00:00Z", "retiredAt": "2024-06-01T00:00:00Z", "createdAt": "2024-01-01T00:00:00Z", "subject": "CN=Root CA, O=logiccloud, C=US", "issuer": "CN=Root CA, O=logiccloud, C=US", "serialNumber": "01:AB:CD:EF", "keyAlgorithm": "RSA-4096", "signatureAlgorithm": "SHA256withRSA", "subjectAltNames": [ "DNS:example.com", "IP:192.168.1.1" ], "certificate": "-----BEGIN CERTIFICATE-----\n...\n-----END CERTIFICATE-----"}Bad Request - Invalid certificate or private key format
Unauthorized - Invalid or missing authentication
Forbidden - Insufficient permissions (admin only)
Conflict - CA certificate with same fingerprint already exists