Certificates

Certificates

GET /certificates/certs

Get All Certificates

curl
curl -X GET "https://appliance.example.com/api/v1/certificates/certs" \
  -H "Authorization: Bearer $TOKEN"
PHP
<?php

$url = 'https://appliance.example.com/api/v1/certificates/certs';
$headers = [
    'Authorization: Bearer ' . $token,
];

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_HTTPHEADER => $headers,
    CURLOPT_RETURNTRANSFER => true,
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);
Python
import requests

headers = {"Authorization": f"Bearer {token}"}

response = requests.get("https://appliance.example.com/api/v1/certificates/certs", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/certificates/certs', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${token}`,
  },
});

const data = await response.json();
Response
{
  "status": "success",
  "message": "Certificates",
  "data": [
    {
      "id": "e15-36c-3ce-8c5",
      "name": "Management",
      "certInfo": {
        "commonName": "loadbalancer.localdomain",
        "organisation": "loadbalancer.org",
        "country": "US",
        "subjectAlt": []
      },
      "validFrom": "2024-01-23T15:04:50+00:00",
      "validTo": "2026-01-22T15:04:50+00:00",
      "usage": [
        {
          "service": "userInterface",
          "serviceFullName": "User Interface",
          "serviceId": null,
          "serviceLabel": "mc-v9-node-1",
          "serviceNodeId": "c9d-3b5-463-df3"
        }
      ]
    }
  ]
}

POST /certificates/certs

Add a Certificate

This change is staged. Send PUT /services/apply to apply it.

Body parameters
name string Required
pem string Required
pfx string Required

(need to be base 64 encoded)

password string Required

This is the password for pfx cert

privateKey string Required
cert string Required
otherCerts array Required
force boolean Required

This will by pass the check for expire

curl
curl -X POST "https://appliance.example.com/api/v1/certificates/certs" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "<name>",
  "pem": "<pem>",
  "pfx": "<pfx>",
  "password": "<password>",
  "privateKey": "<privateKey>",
  "cert": "<cert>",
  "otherCerts": [
    "<otherCerts>"
  ],
  "force": true
}'
PHP
<?php

$url = 'https://appliance.example.com/api/v1/certificates/certs';
$headers = [
    'Authorization: Bearer ' . $token,
    'Content-Type: application/json',
];

$payload = [
    'name' => '<name>',
    'pem' => '<pem>',
    'pfx' => '<pfx>',
    'password' => '<password>',
    'privateKey' => '<privateKey>',
    'cert' => '<cert>',
    'otherCerts' => [
        '<otherCerts>',
    ],
    'force' => true,
];

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_HTTPHEADER => $headers,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POSTFIELDS => json_encode($payload),
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);
Python
import requests

headers = {"Authorization": f"Bearer {token}"}
payload = {
    "name": "<name>",
    "pem": "<pem>",
    "pfx": "<pfx>",
    "password": "<password>",
    "privateKey": "<privateKey>",
    "cert": "<cert>",
    "otherCerts": [
        "<otherCerts>"
    ],
    "force": true
}

response = requests.post("https://appliance.example.com/api/v1/certificates/certs", headers=headers, json=payload)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/certificates/certs', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${token}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
  "name": "<name>",
  "pem": "<pem>",
  "pfx": "<pfx>",
  "password": "<password>",
  "privateKey": "<privateKey>",
  "cert": "<cert>",
  "otherCerts": [
    "<otherCerts>"
  ],
  "force": true
}),
});

const data = await response.json();
Response
{
  "status": "success",
  "message": "New certificate: {name} successfully added",
  "data": {
    "id": "5e1c83a662ab5"
  }
}

By ID

GET /certificates/certs/{id}

Get Certificate by ID

Path parameters
id string Required
curl
curl -X GET "https://appliance.example.com/api/v1/certificates/certs/{id}" \
  -H "Authorization: Bearer $TOKEN"
PHP
<?php

$url = 'https://appliance.example.com/api/v1/certificates/certs/{id}';
$headers = [
    'Authorization: Bearer ' . $token,
];

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_HTTPHEADER => $headers,
    CURLOPT_RETURNTRANSFER => true,
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);
Python
import requests

headers = {"Authorization": f"Bearer {token}"}

response = requests.get("https://appliance.example.com/api/v1/certificates/certs/{id}", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/certificates/certs/{id}', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${token}`,
  },
});

const data = await response.json();
Response
{
  "status": "success",
  "message": "Certificate",
  "data": {
    "id": "e15-36c-3ce-8c5",
    "name": "Management",
    "privateKey": "-----BEGIN PRIVATE KEY-----\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDKUPQ3owm+/knk\nPkIZVCB1f0zSUeRgoP1/hhX/BBzBdK304ftbjV4v5X0cBfUPJPjBCCrSjNQRGd/p\nHjGYR60rpfvLLHpOS7xpfIBMk+gvjtUfVfiCO7urf1m1vrzUc3Qoc67qTNwmgZz9\nZkbWrsFKiusCRlJXdOEOMbDZcxGnVQqQrdXyuZEQVtkEBT3MMV/IH…",
    "cert": "-----BEGIN CERTIFICATE-----\nMIIDljCCAn4CCQCffk5QylMcijANBgkqhkiG9w0BAQsFADCBjDELMAkGA1UEBhMC\nVUsxEDAOBgNVBAgMB0V4YW1wbGUxEDAOBgNVBAcMB0V4YW1wbGUxFDASBgNVBAoM\nC0V4YW1wbGUgT3JnMQwwCgYDVQQLDANEZXYxFDASBgNVBAMMC2V4YW1wbGUuY29t\nMR8wHQYJKoZIhvcNAQkBFhB0ZXN0QGV4YW1wbGUuY29tMB4XDTE4M…",
    "otherCerts": [],
    "certInfo": {
      "commonName": "loadbalancer.localdomain",
      "organisation": "loadbalancer.org",
      "country": "US",
      "subjectAlt": []
    },
    "validFrom": "2024-01-23T15:04:50+00:00",
    "validTo": "2026-01-22T15:04:50+00:00",
    "usage": [
      {
        "service": "userInterface",
        "serviceFullName": "User Interface",
        "serviceId": null,
        "serviceLabel": "mc-v9-node-1",
        "serviceNodeId": "c9d-3b5-463-df3"
      }
    ]
  }
}

PUT /certificates/certs/{id}

Edit a Certificate

This change is staged. Send PUT /services/apply to apply it.

Path parameters
id string Required

.Body parameters

name string Required
pem string Required
pfx string Required
password string Required

This is the password for pfx cert

privateKey string Required
cert string Required
otherCerts array Required
force boolean Required

This will by pass the check for expire

curl
curl -X PUT "https://appliance.example.com/api/v1/certificates/certs/{id}" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "<name>",
  "pem": "<pem>",
  "pfx": "<pfx>",
  "password": "<password>",
  "privateKey": "<privateKey>",
  "cert": "<cert>",
  "otherCerts": [
    "<otherCerts>"
  ],
  "force": true
}'
PHP
<?php

$url = 'https://appliance.example.com/api/v1/certificates/certs/{id}';
$headers = [
    'Authorization: Bearer ' . $token,
    'Content-Type: application/json',
];

$payload = [
    'name' => '<name>',
    'pem' => '<pem>',
    'pfx' => '<pfx>',
    'password' => '<password>',
    'privateKey' => '<privateKey>',
    'cert' => '<cert>',
    'otherCerts' => [
        '<otherCerts>',
    ],
    'force' => true,
];

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'PUT',
    CURLOPT_HTTPHEADER => $headers,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POSTFIELDS => json_encode($payload),
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);
Python
import requests

headers = {"Authorization": f"Bearer {token}"}
payload = {
    "name": "<name>",
    "pem": "<pem>",
    "pfx": "<pfx>",
    "password": "<password>",
    "privateKey": "<privateKey>",
    "cert": "<cert>",
    "otherCerts": [
        "<otherCerts>"
    ],
    "force": true
}

response = requests.put("https://appliance.example.com/api/v1/certificates/certs/{id}", headers=headers, json=payload)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/certificates/certs/{id}', {
  method: 'PUT',
  headers: {
    Authorization: `Bearer ${token}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
  "name": "<name>",
  "pem": "<pem>",
  "pfx": "<pfx>",
  "password": "<password>",
  "privateKey": "<privateKey>",
  "cert": "<cert>",
  "otherCerts": [
    "<otherCerts>"
  ],
  "force": true
}),
});

const data = await response.json();
Response
{
  "status": "success",
  "message": "Certificate has been updated successfully"
}

DELETE /certificates/certs/{id}

Delete Certificate by ID

This change is staged. Send PUT /services/apply to apply it.

Path parameters
id string Required
curl
curl -X DELETE "https://appliance.example.com/api/v1/certificates/certs/{id}" \
  -H "Authorization: Bearer $TOKEN"
PHP
<?php

$url = 'https://appliance.example.com/api/v1/certificates/certs/{id}';
$headers = [
    'Authorization: Bearer ' . $token,
];

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'DELETE',
    CURLOPT_HTTPHEADER => $headers,
    CURLOPT_RETURNTRANSFER => true,
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);
Python
import requests

headers = {"Authorization": f"Bearer {token}"}

response = requests.delete("https://appliance.example.com/api/v1/certificates/certs/{id}", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/certificates/certs/{id}', {
  method: 'DELETE',
  headers: {
    Authorization: `Bearer ${token}`,
  },
});

const data = await response.json();
Response
{
  "status": "success",
  "message": "Certificate has been deleted"
}

List the supported signature algorithms

GET /certificates/signature-algorithm

The signature algorithms this appliance can sign a certificate request with.

curl
curl -X GET "https://appliance.example.com/api/v1/certificates/signature-algorithm" \
  -H "Authorization: Bearer $TOKEN"
PHP
<?php

$url = 'https://appliance.example.com/api/v1/certificates/signature-algorithm';
$headers = [
    'Authorization: Bearer ' . $token,
];

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_HTTPHEADER => $headers,
    CURLOPT_RETURNTRANSFER => true,
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);
Python
import requests

headers = {"Authorization": f"Bearer {token}"}

response = requests.get("https://appliance.example.com/api/v1/certificates/signature-algorithm", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/certificates/signature-algorithm', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${token}`,
  },
});

const data = await response.json();
Response
{
  "status": "success",
  "message": "Supported Signature Algorithm",
  "data": [
    "blake2b512",
    "blake2s256",
    "md4",
    "sha512-256",
    "shake128",
    "shake256",
    "whirlpool"
  ]
}