Certificate Resource

Certificate resources are used to provide a ssl secured connection to your containers.

List Certificates

Returns a list of all certificate resources associated with the private key.

GET /rest/privatekeys/<ID>/certificates

Response

[
   {
       "id": "1",
       "name": "MyCertificate",
       "common_name": "demo.d9tready.com",
       "valid_from": "2014-09-02T12:17:55Z",
       "valid_thru": "2024-08-30T12:17:55Z",
       "_links":
       [
           {
               "href": "https://d9tready.com/rest/privatekeys/1/certificates/1",
               "rel": "self"
           }
       ]
   },
   ...
]

Attributes

  • id - Unique identifier of resource.
  • name - Name of resource.
  • common_name - Common name of resource.
  • valid_from - Valid from date.
  • valid_thru - Valid thru date.
  • _links - Link relations.

HTTP Status Codes

Status Code Description
200 OK No error, operation successful
403 FORBIDDEN Authentication failure
404 NOT FOUND Resource not found

Retrieve certificate

Retrieve a single certificate resource.

GET /rest/privatekeys/<PRIVATEKEY_ID>/certificates/<CERTIFICATE_ID>

Response

{
   "name": "MyCert",
   "common_name": "demo.d9tready.com",
   "organization_name": "D9T GmbH",
   "organization_unit": "IT",
   "locality": "Ulm",
   "state_province": "BW",
   "country_code": "DE",
   "email": "oliver.roch@d9t.de",
   "ssl_certificate": "-----BEGIN CERTIFICATE-----...",
   "valid_from": "2014-09-02T12:17:55Z",
   "valid_thru": "2024-08-30T12:17:55Z",
   "_links":
   [
       {
           "href": "https://d9tready.com/rest/privatekeys/1/certificates/1",
           "rel": "self"
       },
       {
           "href": "https://d9tready.com/rest/privatekeys/1/certificates/1/csr",
           "rel": "certificate-signing-request"
       }
   ]
}

Attributes

  • name - Name of resource.
  • common_name - Common name of resource.
  • organization_name - Organization name.
  • organization_unit - Organization unit.
  • locality - Locality.
  • state_province - State or province.
  • country_code - Country code.
  • email - E-Mail
  • ssl_certificate - SSL Certificate.
  • valid_from - Valid from date.
  • valid_thru - Valid thru date.
  • _links - Link relations.

Link relations

HTTP Status Codes

Status Code Description
200 OK No error, operation successful
403 FORBIDDEN Authentication failure
404 NOT FOUND Resource not found

Create Certificate

Creat a new certificate resource. For convenience a self signed certificate is generated automatically if no ssl_certificate is provided.

POST /rest/privatekeys/<ID>/certificates

Payload

{
   "name": "<NAME>",
   "common_name": "<COMMON_NAME>",
   "organization_name": "<ORGANIZATION_NAME>",
   "organization_unit": "<ORGANIZATION_UNIT>",
   "locality": "<LOCALITY>",
   "state_province": "<STATE_PROVINCE>",
   "country_code": "<COUNTRY_CODE>",
   "email": "<EMAIL>",
   "ssl_certificate": "<SSL_CERTIFICATE>",
}
  • name - Unique key identifier.
  • common_name - Common name.
  • organization_name - Organization name.
  • organization_unit - Organization unit.
  • locality - Locality.
  • state_province - State or province.
  • country_code - Country code.
  • email - E-Mail
  • ssl_certificate - SSL Certificate. Optional. If not provided, a self signed certificate will be generated.

Response

On successful creation the URL to the new certificate resource is set in the Location-Header.

HTTP/1.0 201 CREATED
Location: https://d9tready.com/rest/privatekeys/<PRIVATEKEY_ID>/certificates/<CERTIFICATE_ID>

HTTP State Codes

Status Code Description
201 CREATED Successful creation of resource
400 BAD REQUEST Malformed syntax or bad query
403 FORBIDDEN Authentication failure

Update Certificate

Update the ssl_certificate of an existing certificate resource.

PUT /rest/privatekeys/<PRIVATEKEY_ID>/certificates/<CERTIFICATE_ID>

Payload

{
   "ssl_certificate": "<SSL_CERTIFICATE>",
}
  • ssl_certificate - SSL Certificate. Optional. If not provided, a self signed certificate will be generated.

HTTP State Codes

Status Code Description
200 OK No error, operation successful
400 BAD REQUEST Malformed syntax or bad query
403 FORBIDDEN Authentication failure

Delete Certificate

Permanently delete a certificate resource.

DELETE /rest/privatekeys/<PRIVATEKEY_ID>/certificates/<CERTIFICATE_ID>

HTTP Status Codes

Status Code Description
204 NO CONTENT Successful deletion of resource
400 BAD REQUEST Malformed syntax or bad query
404 NOT FOUND Resource not found