Import Console Certificate

The Import Console Certificate operation imports a certificate based on its type to the console. [Added by feature bcpii-authorizations]

HTTP method and URI

POST /api/console/operations/import-certificate

Request body contents

The request body is expected to contain a JSON object with the following fields:

Name Type Req/Opt Description
name String Required The value to be set as the certificate's name property.
description String Optional The value to be set as the certificate's description property.
certificate String Required The base64-encoded string form of the Console certificate to import.
type String Enum Required The value to be set as the certificate's type property.

Response body contents

On successful completion, the response body is a JSON object with the following field:

Field name Type Description
certificate-uri String/ URI The URI of the newly created Certificate object.

Description

The Import Console Certificate operation imports a certificate based on its type to a console. An Inventory Change notification is emitted asynchronously to this operation.

The requirements based on the type of certificate being imported are as follows:

Certificate type Requirements
bcpii-authorization Public key info: The type must be an RSA public key. The RSA key size must be greater than or equal to 2048 bits.

If the Certificate being imported does not meet the defined requirements for the type of certificate being imported, status code 400 (Bad Request) is returned. If the Certificate being imported has the same name as an existing certificate or there was a problem with the certificate or the file being imported contained multiple certificates, a 400 (Bad Request) status code is returned. If the API user does not have the appropriate action/task permission for the type of certificate being imported, 403 (Forbidden) status code is returned.

Authorization requirements

This operation has the following authorization requirement:
  • Action/task permissions to the Authorize BCPii Access task when the Certificate is of type "bcpii-authorization".

HTTP status and reason codes

On success, HTTP status code 200 (OK) is returned and the response body is provided as described in Response body contents.

The following HTTP status codes are returned for the indicated errors, and the response body is a standard error response body providing the reason code indicated and associated error message.

HTTP error status code Reason code Description
400 (Bad Request) Various Errors were detected during common request validation. See Common request validation reason codes for a list of the possible reason codes.
8 The value of a field does not provide a unique value for the corresponding data model property as required.
368 There was a problem with the certificate. This could be due to bad formatting, not being able to decode the certificate, etc.
369 The operation cannot be completed because the certificate string being imported contains multiple certificates. Only one certificate can be imported at a time.
381 The operation cannot be completed because the certificate is expired.
401 The certificate being imported does not meet the defined standards based on its certificate type.
403 (Forbidden) 1 The user under which the API request was authenticated does not have the required authority to perform the requested action.

Additional standard status and reason codes can be returned, as described in Invoking API operations.

Example HTTP interaction

Figure 1. Import Console Certificate: Request
POST /api/console/operations/import-certificate HTTP/1.1
x-api-session: 67fbo5w4o1wwpkv2juhbrpux5k0rc5cbmt9594r6fxkl0v5xtv
Content-Type: application/json
Content-Length: 1178
{
    "certificate": "MIIDCTCCAfGgAwIBAgIUan5OAMsk5OSZb7HxnSxPSLEJBR8wDQYJKoZIhvcNAQELBQAwFDESMBAGA1UEAwwJbG9jYWxob3N0MB4XDTI0MDIyOTE4NTcyNloXDTI1MDIyODE4NTcyNlowFDESMBAGA1UEAwwJbG9jYWxob3N0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAreQSGbsQu2SeIIkyufwHPqErfXZsDMU3Q9d1XsfgiYexDInCL3sfDcbkUPxkUxA76MsJnD0Htdd5BTJlPdYlIuyMPtEm2LBA3XDDBViMwB8Tx+VnlvB9972VtQtchKRRQ9vMUyr57Ho7u+kk9VW+xOEKvvnHMHgXFaMuMKly9tetMpq6Yb7OhhAgtlujxA9T6OmuovRgzzvbbJ91OQZX5LZP0m6ILChXIaefLW04w5AKOOOlVeKxBddLh6WI2xjQoNDoMxR6fV5g3r1gljRtKjP7ASUX3/u9J+B/d8TSEl9PLxcGFIGh/lgoh7uNVlrBSKL9e07JquEy6e45MqgzYwIDAQABo1MwUTAdBgNVHQ4EFgQUtdensEIBWvg9xIqhNM5zfL2+GT4wHwYDVR0jBBgwFoAUtdensEIBWvg9xIqhNM5zfL2+GT4wDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEADXNb96QaQBbfCu6wBHHLWc6QUoBJ0SJSxHxj9cd34JVy9C/DXOwkziWHkFD8olBQ829FLqjS1mLA0cCDoNgEJJhDUfS3A39gPoI/gCne6AmWHQwL0pMShDVspNJfX0g1hP9wVC6yqdrFKGJ70Fz7hPBclL4ImXmu0EHnTNkHQZM+NopPVcCfV4XYAzN8N85X7lxk9959gRj4UTBTpA+x9H1Awv3i/INXR/x0HHofaFL4sbk16Ftt6W5GZLo8QM7KZW75gOoCDPvExT5CpBrZvS5AADqQLz2J5c7u0htHXAfOQmmejqxm9Bo8ZwEUzsiJ02V8ABqBav+bW7ACnEeXsA==",
            "description": "Certificate for BCPii authorizations",
            "name": "BCPii certificate",
            "type": "bcpii-authorization"
} 
Figure 2. Import Console Certificate: Response
200
Server: Hardware management console API web server / 2.0
Cache-control: no-cache
Date : Mon, 06 May 2024 14:55:28 GMT 
Content-Type: application/json;charset=UTF-8
Content-Length: 76
{
   "certificate-uri":"/api/certificates/ad63d35c-0bb8-11ef-9f87-fa163ee48fef"
}