Certificate Import REST Service
Use the Certificate Import REST Service to import a certificate file. You must use the Certificate Export REST Service to export the certificates. You can then import this certificate from the exported file.
- Operation
POST- URL
- https://host:port/GKLM/rest/v1/certificates/import
By default, IBM® Guardium® Key Lifecycle Manager server listens to the secure port 9443 (HTTPS) for communication. During IBM Guardium Key Lifecycle Manager installation, you can modify this default port.
Request
| Parameter | Description |
|---|---|
| host | Specify the IP address or hostname of the IBM Guardium Key Lifecycle Manager server. |
| port | Specify the port number on which the IBM Guardium Key Lifecycle Manager server listens for requests. |
| Header name | Value |
|---|---|
| Content-Type | application/json |
| Accept | application/json |
| Authorization | SKLMAuth userAuthId=<authIdValue> |
| Accept-Language | Any valid locale that is supported by IBM Guardium Key Lifecycle Manager. For example, en or de. |
| Property name | Description |
|---|---|
| fileName |
Specify the file name to import certificate data. The imported file is stored in IBM Guardium Key Lifecycle Manager in a keystore location relative to the SKLM_HOME directory. |
| alias |
Specify a unique name for the certificate. |
| usage |
Specify the target application usage, such as
You can specify the following values:
|
| format | Specify any of the following formats for file content:
|
| deviceRole | Specify the device role. Specify any of the following values:
|
| trusted | Specify whether the certificate is trusted or not by the server. You can
specify the following possible values:
|
| deviceGroup | When the usage parameter is set to
SSLCLIENT, specify the endpoint (device group) name for which this certificate will be used as the
communication certificate.You can specify the following possible values:
|
Response
| Header name | Value and description |
|---|---|
| Status Code |
|
| Content-Type | application/json |
| Content-Language | Locale for the response message. |
| JSON property name | Description |
|---|---|
| code | Returns a 0 (zero) to indicate the completion of the certificate import task |
| status | Returns the status with an appropriate message to indicate whether the certificate is imported. |
| JSON property name | Description |
|---|---|
| code | Returns the application error code. |
| message | Returns a message that describes the error. |
Examples
- Service request to import a certificate
POST https://localhost:port/GKLM/rest/v1/certificates/import Content-Type: application/json Accept: application/json Authorization: SKLMAuth userAuthId=139aeh34567m {"fileName":"/mycertfilenam.base64","alias":"newsklmCert","format":"base64", "usage":"3592"}- Service request with unsupported certificate format
POST https://localhost:port/GKLM/rest/v1/certificates/import Content-Type: application/json Accept: application/json Authorization: SKLMAuth userAuthId=139aeh34567m {"fileName":"/mycertfilenam.base64","alias":"newsklmCert","format":"ABC", "usage":"3592"}