Import a Trusted Certificate into the JKS Keystore

Imports a trusted certificate at the specified alias into the JKS keystore. The certificate must be Base64 encoded.

REST Request

POST /idaas/platform/admin/v1/keystore/{alias}

Parameters

The following table summarizes the POST request parameter.

Name Description Type
alias Alias of the trusted certificate to be imported.

The alias will be created. The alias must not already exist in the JKS keystore; otherwise, the request will fail.

Path

Request Body

Media Types: application/json

The request body contains the details of the import request:

Attribute Description
"certificate" Base64-encoded certificate.
"component" Component to which the certificate is imported. This value must be set to JKS.

Response Body

Media Types: application/json

The response body returns the status of the import operation, including:

Attribute Description
"ERROR_CODE" If "STATUS" is set to "Failed", provides the error code.
"ERROR_MSG" If "STATUS" is set to "Failed", provides the contents of the error message.
"STATUS" Status of operation. For example, "Succeeded" or "Failed".
"SUBJECT_DN" Subject DN list that was imported.

cURL Example

The following example shows how to import a trusted certificate into the JKS keystore by submitting a POST request on the REST resource using cURL. For more information, see "cURL Access".

curl -i -X POST -u username:password --data @importjkscert.json -H Content-Type:application/json http://myhost:7001/idaas/platform/admin/v1/keystore/mytestkey

Example of Request Body

The following shows an example of the request body in JSON format.

{   "component":"JKS",
  "certificate": "Base64-encoded certificate"
}

Example of Response Header

The following shows an example of the response header. For more about the HTTP status codes, see "Status Codes."

HTTP/1.1 200 OK

Example of Response Body

The following shows an example of the response body in JSON format.

{
    "STATUS": "Succeeded",
    "SUBJECT_DN": "CN=y,OU=y,O=y,L=y,ST=y,C=y"
}