Importing the Root Certificate

Function

Imports the corresponding root certificates of third-party software repositories and image repositories before using containerized applications.

  • If this API is called repeatedly, the root certificate will be updated.
  • It is recommended that the validity period of the root certificate be greater than the value of certificate alarm detection period (the default value is 7).
  • If the root certificate is imported repeatedly, the previously imported certificate is backed up.

Syntax

Operation type: POST

URL: https://{ip}:{port}/certmanager/v1/certificates/import

Request message body:
{
    "certName": certname,
    "cert": cert
}

Request Parameters

Table 1 Description

Parameter

Type

Description

Value

certName

String

Usage of the imported certificate

The value can be:
  • software: root certificate of a software repository
  • image: root certificate of an image repository

cert

String

PEM root certificate in Base64 encoding format

  • The root certificate must be encoded using Base64.
  • The certificate must be in PEM format.
  • The signature in the root CA certificate is correct.
  • The root CA certificate is valid.
  • The certificate must be an X.509v3 digital certificate. For a root CA, the "Basic Constraints" extensions must be "CA", and the "Key Usage" extensions must contain the "Certificate Signature".
  • The key must be the RSA algorithm with a length of at least 3072 bits or the ECDSA algorithm with a length of at least 256 bits. The digest algorithm must be SHA256, SHA384, or SHA512.

Usage Example

Request:

POST https://10.10.10.10:30035/certmanager/v1/certificates/import

Request message body:

{
    "certName": "software",
    "cert": "xxxxxxxxxxxxxxxxxxx..."
}
Response:
{
    "status": "00000000",
    "msg": "import certificate success"
}

Response status code: 200

Output Description

Table 2 Operation output description

Parameter

Type

Description

status

String

Error code

msg

String

Description