Directory Service Public Keys

Path:/directory/v3/service/keys

Endpoint for managing Public Keys for a particular Directory Service

POST

Add a Public Key to a Directory Service

Request

Requests will be a JWE encrypted JSON payload with the following attribute:

service_id (string):Identifier of the Directory Service for which you wish to add the public key
public_key (string):PEM formatted RSA Public Key
date_expires (string) [optional]:ISO-8601 formatted date signifying the time at which the public key expires and is no longer active
active (boolean) [optional]:Is the public key active.

Example:

{
    "service_id": "ce5ab88c-e79e-4049-bb36-4f8709122648",
    "public_key", "-----BEGIN PUBLIC KEY-----
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQD38jQRiR5RffOHDcvU2Qp9X3qy
wKTYV0tKP/OpaA61BvtKudOlE1TUQNSmBBtzKSsVeA2SQ8BAwUF7smQn+uZpT90C
XMXnba7wNu7YfsmBIbjIjQ0M7xRm2z/jzVo0ltKog1RU2/5CY67Zw+wXcW7UuTCC
sv+nCk+H6gDCPl4TYwIDAQAB
-----END PUBLIC KEY-----",
    "date_expires": "2020-01-01T00:00:00Z",
    "active": true
}

Response

Responses will be a JWE encrypted JSON payload consisting the key ID for the key added to the Directory Service:

key_id (string):MD5 fingerprint of the public key added to the Directory Service. This will be used to identify the public key in the future.

Example:

{"key_id": "e2:f4:14:25:24:45:66:a2:c1:6f:d6:0c:c9:00:09:66"}

Errors

If the Directory Service ID supplied belongs to a Directory other than the one identified by the provided credentials, a 403 Forbidden error will be returned.

If the Directory Service ID supplied does not exist, you will receive a 400 Invalid Request response with the error code DIR-004.

If the Pubic Key provided is not valid, you will receive a 400 Invalid Request response with the error code KEY-001.

If the Pubic Key provided already exists for the provided Directory Service ID, you will receive a 400 Invalid Request response with the error code KEY-002.

PATCH

Modifies a Public Key belonging to a Directory Service

Request

Requests will be a JWE encrypted JSON payload with the following attribute:

service_id (string):Identifier of the Directory Service for which you wish to add a public key.
key_id (string):MD5 fingerprint of the public key used to identify the public key.
date_expires (string) [optional]:ISO-8601 formatted date signifying the time at which the public key expires and is no longer active.
active (boolean) [optional]:Is the current public key active.

Example:

{
    "service_id": "ce5ab88c-e79e-4049-bb36-4f8709122648",
    "key_id", "e2:f4:14:25:24:45:66:a2:c1:6f:d6:0c:c9:00:09:66",
    "date_expires": null,
    "active": false
}

Response

There is no response data.

Errors

If the Directory Service ID supplied belongs to a Directory other than the one identified by the provided credentials, a 403 Forbidden error will be returned.

If the Directory Service ID supplied does not exist, you will receive a 400 Invalid Request response with the error code DIR-004.

If the key ID supplied does not exist for the Directory Service, you will receive a 400 Invalid Request response with the error code KEY-003.

DELETE

Remove an existing public key from a Directory Service

Request

Requests will be a JWE encrypted JSON payload with the following attribute:

service_id (string):Identifier of the Directory Service from which you wish to delete a public key.
key_id (string):Identifier of the public key you wish to delete

Example:

{
    "service_id": "ce5ab88c-e79e-4049-bb36-4f8709122648",
    "key_id": "e2:f4:14:25:24:45:66:a2:c1:6f:d6:0c:c9:00:09:66"
}

Response

There is no response data.

Errors

If the Directory Service ID supplied belongs to a Directory other than the one identified by the provided credentials, a 403 Forbidden error will be returned.

If the Directory Service ID supplied does not exist, you will receive a 400 Invalid Request response with the error code DIR-004.

If the key ID supplied does not exist for the Directory Service, you will receive a 400 Invalid Request response with the error code KEY-003.

If the key ID supplied is the only remaining key for the Directory Service, you will receive a 400 Invalid Request response with the error code KEY-004.

User Contributed

LaunchKey links to user contributed code as a resource to its community. LaunchKey does not in any way guarantee or warrant the quality and security of these code bases. User contributed code is supported by the creators. If you do find a link from the site to user contributed code that is malicious or inappropriate in any way, please report that link to LaunchKey immediately and we will investigate the claim. Submit any issue to LaunchKey support at https://launchkey.com./support. ×