Import a Trusted PKCS#7 Certificate into the JKS Keystore

Imports a PKCS#7 trusted certificate or a certificate chain associated with a private key indicated by the specified alias into the JKS keystore.

REST Request

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

Parameters

The following table summarizes the POST request parameter.

Name Description Type
alias Alias of the private key for which the trusted PKCS#7 certificate will be imported. The alias must already in the JKS keystore. 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.
"keyPassword" Password for the private key.

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 PKCS#7 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/pkcs7/myprivatekey

Example of Request Body

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

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

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"
}