Halaman ini belum tersedia dalam bahasa lokal Anda. Kami berusaha keras untuk menambahkan lebih banyak versi bahasa. Terima kasih atas dukungan Anda.

Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Creating a CA

Updated on 2022-12-22 GMT+08:00

Function

This API is used to create a CA. If you wish to:

  • Create a root CA, configure mandatory parameters based on the parameter description.

  • Create a subordinate CA and activate its certificate, configure mandatory parameters based on the parameter description.

  • Create a subordinate CA, but not want to activate its certificate, exclude one of the following parameters in the request body: issuer_id, signature_algorithm, and validity.

URI

POST /v1/private-certificate-authorities

Request Parameters

Table 1 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token. The token can be obtained by calling the token API of IAM. The value of X-Auth-Token in the response header is the user token.

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

type

Yes

String

Type of the CA you want to create:

  • ROOT: a root CA

  • SUBORDINATE: a subordinate CA

distinguished_name

Yes

DistinguishedName object

Certificate name. For details, see data structure for the DistinguishedName field.

key_algorithm

Yes

String

Key algorithm. The options are as follows:

  • RSA2048: RSA algorithm with the key length of 2048 bits

  • RSA4096: RSA algorithm with the key length of 4096 bits

  • EC256: Elliptic Curve Digital Signature Algorithm (ECDSA) with the key length of 256 bits

  • EC384: Elliptic Curve Digital Signature Algorithm (ECDSA) with the key length of 384 bits

validity

No

Validity object

Validity period of a certificate. The options are as follows:

  • If you want to create a root CA, this parameter is mandatory.

  • If you want to create a subordinate CA and activate it, this parameter is mandatory.

  • If you want to create a subordinate CA but not activate it immediately, this parameter is not required. You can specify this parameter when activating the subordinate CA.

NOTE:

For details, see data structure description of the Validity field.

issuer_id

No

String

ID of the parent CA. The options are as follows:

  • If you want to create a root CA, this parameter is not required because a root CA is a self-signed certificate and does not have a parent CA.

  • If you want to create a subordinate CA and activate it, this parameter is mandatory.

  • If you want to create a subordinate CA but not activate it immediately, this parameter is not required. You can specify this parameter when activating the subordinate CA.

Minimum: 36

Maximum: 36

path_length

No

Integer

Length of the CA certificate path. The options are as follows:

  • If you want to create a root CA, this parameter is not required by default. This means CA path length is not limited and you can expand the CA hierarchies. To limit the CA hierarchies, you can specify this parameter when creating a subordinate CA.

  • If you want to create a subordinate CA and activate it, specify this parameter based on your need. Default value: 0

  • If you want to create a subordinate CA but not need to activate it, this parameter is not required. You can specify this parameter when you activate the subordinate CA.

Minimum: 0

Maximum: 6

signature_algorithm

No

String

Signature hash algorithm.

  • There are three scenarios:

    • If you want to create a root CA, this parameter is mandatory.

    • If you want to create a subordinate CA and activate it, this parameter is mandatory.

    • If you want to create a subordinate CA but not activate it immediately, this parameter is not required. You can specify this parameter when activating the subordinate CA.

  • The options are as follows:

    • SHA256

    • SHA384

    • SHA512

key_usages

No

Array of strings

Key usage. For details, see 4.2.1.3 in RFC 5280.

  • digitalSignature: The key can be used as a digital signature.

  • nonRepudiation: The key can be used for non-repudiation.

  • keyEncipherment: The key can be for key encryption.

  • dataEncipherment: The key can be used for data encryption.

  • keyAgreement: The key can be used for key negotiation.

  • keyCertSign: The key can issue a certificate.

  • cRLSign: The key can issue a certificate revocation list (CRL).

  • encipherOnly: The key is used only for encryption.

  • decipherOnly: The key is used only for decryption.

NOTE:

The default values are as follows:

  • Root CA certificates: [digitalSignature, keyCertSign, cRLSign], which cannot be changed. The value you specified is ignored.

  • Subordinate CA certificates: [digitalSignature, keyCertSign, cRLSign], which can be customized.

crl_configuration

No

CrlConfiguration object

Certificate CRL. For details, see data structure for the CrlConfiguration field.

Table 3 DistinguishedName

Parameter

Mandatory

Type

Description

common_name

Yes

String

Common certificate name (CN).

Minimum: 1

Maximum: 64

country

Yes

String

Country code, which must comply with the regular expression "[A-Za-z]{2}".

Minimum: 2

Maximum: 2

state

Yes

String

State or city name.

Minimum: 1

Maximum: 128

locality

Yes

String

Country/Region.

Minimum: 1

Maximum: 128

organization

Yes

String

Organization name.

Minimum: 1

Maximum: 64

organizational_unit

Yes

String

Organization Unit (OU).

Minimum: 1

Maximum: 64

Table 4 Validity

Parameter

Mandatory

Type

Description

type

Yes

String

Validity period type, which is mandatory. The options are as follows:

  • YEAR: Year (12 months)

  • MONTH: Month (31 days)

  • DAY: Day

  • HOUR: Hour

value

Yes

Integer

The certificate validity period. The value of this parameter varies depending on the value of type:

  • Root CA certificates: no longer than 30 years

  • Subordinate CA or private certificates: no longer than 20 years

start_from

No

Integer

Start time. The options are as follows:

  • The value is a timestamp in milliseconds. For example, 1645146939688 indicates 2022-02-18 09:15:39.

  • The value of start_from cannot be earlier than the result of the value of current_time minus 5 minutes.

Table 5 CrlConfiguration

Parameter

Mandatory

Type

Description

enabled

Yes

Boolean

Whether to enable the gray release function of CRL.

  • true

  • false

crl_name

No

String

Name of the certificate revocation list.

NOTE:

If you do not specify this parameter, the system uses the ID of the parent CA that issues the current certificate by default.

obs_bucket_name

No

String

OBS bucket name.

NOTE:

To enable the CRL release function:

  • This parameter is mandatory. You must have created an agency to authorize the PCA service to access OBS. For details, see Certificate Revocation > Checking the Agency Permission and Certificate Revocation > Creating an Agency in this document.

  • The specified OBS bucket must exist. Otherwise, an error will be reported.

valid_days

No

Integer

CRL update interval, in days. This parameter is mandatory when the CRL release function is enabled.

Minimum: 7

Maximum: 30

Response Parameters

Status code: 200

Table 6 Response body parameters

Parameter

Type

Description

ca_id

String

ID of the CA certificate being issued.

Minimum: 36

Maximum: 36

Status code: 400

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Error code

Minimum: 3

Maximum: 36

error_msg

String

Error message

Minimum: 0

Maximum: 1024

Status code: 401

Table 8 Response body parameters

Parameter

Type

Description

error_code

String

Error code

Minimum: 3

Maximum: 36

error_msg

String

Error message

Minimum: 0

Maximum: 1024

Status code: 403

Table 9 Response body parameters

Parameter

Type

Description

error_code

String

Error code

Minimum: 3

Maximum: 36

error_msg

String

Error message

Minimum: 0

Maximum: 1024

Status code: 404

Table 10 Response body parameters

Parameter

Type

Description

error_code

String

Error code

Minimum: 3

Maximum: 36

error_msg

String

Error message

Minimum: 0

Maximum: 1024

Status code: 500

Table 11 Response body parameters

Parameter

Type

Description

error_code

String

Error code

Minimum: 3

Maximum: 36

error_msg

String

Error message

Minimum: 0

Maximum: 1024

Example Requests

When you use this API to create a CA certificate, a token is required in the X-Auth-Token field in the request header. The token must have the permission to access the API.

POST https://ccm.ae-ad-1.myhuaweicloud.com/v1/private-certificate-authorities

{
  "type" : "ROOT",
  "key_algorithm" : "RSA4096",
  "signature_algorithm" : "SHA512",
  "distinguished_name" : {
    "country" : "your country abbreviation",
    "state" : "your state",
    "locality" : "your locality",
    "organization" : "your organization",
    "organizational_unit" : "your unit",
    "common_name" : "your CN"
  },
  "validity" : {
    "type" : "YEAR",
    "value" : 3
  },
  "crl_configuration" : {
    "enabled" : false,
    "obs_bucket_name" : "demoBucket",
    "valid_days" : 8
  }
}

Example Responses

Status code: 200

Request succeeded.

{
  "ca_id" : "66504812-fedc-414a-9b7c-4c1836398524"
}

Status code: 400

Invalid request parameters.

{
  "error_code" : "PCA.XXX",
  "error_msg" : "XXX"
}

Status code: 401

Token required for the requested page.

{
  "error_code" : "PCA.XXX",
  "error_msg" : "XXX"
}

Status code: 403

Authentication failed.

{
  "error_code" : "PCA.XXX",
  "error_msg" : "XXX"
}

Status code: 404

No resources available or found.

{
  "error_code" : "PCA.XXX",
  "error_msg" : "XXX"
}

Status code: 500

Internal service error.

{
  "error_code" : "PCA.XXX",
  "error_msg" : "XXX"
}

Status Codes

Status Code

Description

200

Request succeeded.

400

Invalid request parameters.

401

Token required for the requested page.

403

Authentication failed.

404

No resources available or found.

500

Internal service error.

Error Codes

See Error Codes.

Kami menggunakan cookie untuk meningkatkan kualitas situs kami dan pengalaman Anda. Dengan melanjutkan penelusuran di situs kami berarti Anda menerima kebijakan cookie kami. Cari tahu selengkapnya

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback