PrivateKey Resource

Privatekeys are used for creation of certificates which could be assigned to domains in order to secure its traffic via ssl.

List PrivateKeys

Returns a list of all private key resources associated with the currently logged in user.

GET /rest/privatekeys

Response

[
   {
       "id": 1,
       "name": "MyPrivateKey",
       "_links":
       [
           {
               "href": "https://d9tready.com/rest/privatekeys/1",
               "rel": "self"
           }
       ]
   },
   ...
]

Attributes

  • id - Unique resources identifier.
  • name - Name of resource.
  • _links - Link relations.

HTTP Status Codes

Status Code Description
200 OK No error, operation successful
403 FORBIDDEN Authentication failure

Retrieve PrivateKey

Retrieve a single privatekey resource.

GET /rest/privatekeys/<PRIVATEKEY_ID>

Response

{
    "id": 1,
    "name": "MyPrivateKey",
    "key": "-----BEGIN PRIVATE KEY-----....",
    "_links":
    [
        {
            "href": "https://d9tready.com/rest/privatekeys/1",
            "rel": "self"
        },
        {
            "href": "https://d9tready.com/rest/privatekeys/1/certificates",
            "rel": "self"
        }
    ]
}

Attributes

  • id - Unique resources identifier.
  • name - Name of resource.
  • key - ASCII key text.
  • _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 PrivateKey

Create a new privatekey resource.

POST /rest/privatekeys

Payload

{
   "name": "<NAME>",
   "key": "<KEY>"
}
  • name - Private key identifier.
  • key - Private key. If not specified, a new one is generated.

Response

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

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

Delete PrivateKey

Permanently delete a private key resource with all its associated certificates.

DELETE /rest/privatekeys/<PRIVATEKEY_ID>

HTTP Status Codes

Status Code Description
204 NO CONTENT Successful deletion of resource
400 BAD REQUEST Malformed syntax or bad query
403 FORBIDDEN Authentication failure