创建证书

最近更新时间:2019-08-29 21:19:59

1. 接口描述

接口请求域名: gaap.tencentcloudapi.com 。

本接口(CreateCertificate)用于创建Gaap相关证书和配置文件,包括基础认证配置文件,客户端CA证书,服务器SSL证书,Gaap SSL证书以及源站CA证书。

默认接口请求频率限制:20次/秒。

2. 输入参数

以下请求参数列表仅列出了接口请求参数和部分公共参数,完整公共参数列表见 公共请求参数

参数名称 必选 类型 描述
Action String 公共参数,本接口取值:CreateCertificate
Version String 公共参数,本接口取值:2018-05-29
Region String 公共参数,本接口不需要传递此参数。
CertificateType Integer 证书类型。其中:
0,表示基础认证配置;
1,表示客户端CA证书;
2,服务器SSL证书;
3,表示源站CA证书;
4,表示通道SSL证书。
CertificateContent String 证书内容。采用url编码。其中:
当证书类型为基础认证配置时,该参数填写用户名/密码对。格式:“用户名:密码”,例如:root:FSGdT。其中密码使用htpasswd或者openssl,例如:openssl passwd -crypt 123456。
当证书类型为CA/SSL证书时,该参数填写证书内容,格式为pem。
CertificateAlias String 证书名称
CertificateKey String 密钥内容。采用url编码。仅当证书类型为SSL证书时,需要填写该参数。格式为pem。

3. 输出参数

参数名称 类型 描述
CertificateId String 证书ID
RequestId String 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。

4. 示例

示例1 创建证书

输入示例

https://gaap.tencentcloudapi.com/?Action=CreateCertificate
&CertificateAlias=xxx
&CertificateType=2
&CertificateContent=%0A-----BEGIN%20CERTIFICATE-----%0AMIIFmDCCBICgAwIBAgIQC6TGAPV%2B4MO7NIhlkkKFljANBgkqhkiG9w0BAQsFADBy%0AMQswCQYDVQQGEwJDTjElMCMGA1UEChMcVHJ1c3RBc2lhIFRlY2hub2xvZ2llcywg%0ASW5jLjEdMBsGA1UECxMURG9tYWluIFZhbGlkYXRlZCBTU0wxHTAbBgNVBAMTFFRy%0AdXN0QXNpYSBUTFMgUlNBIENBMB4XDTE5MDQwMjAwMDAwMFoXDTIwMDQwMTEyMDAw%0AMFowGTEXMBUGA1UEA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/fsDImMYihAkp6VaNY/en8WZ5qcrQPVLuJrJ%0ADSXT04NnMeZOQDUoj/NHAmdfCBB/h1bZ5OGK6Sf1h5Yx/5wR4f3TUoPgGlnU7EuP%0AISLNdMRiDrXntcImDAiRvkh5GJuH4YCVE6XEntqaNIgGkRwxKSgnU3Id3iuFbW9F%0AUQ9Qqtb1GX91AJ7i4153TikGgYCdwYkBURD8gSVe8OAco6IfZOYt/TEwii1Ivi1C%0AqnuUlWpsF1LdQNIdfbW3TSe0BhQa7ifbVIfvPWHYOu3rkg1ZeMo6XRU9B4n5VyJY%0ARmE%3D%0A-----END%20CERTIFICATE-----%0A
&CertificateKey=%0A-----BEGIN%20RSA%20PRIVATE%20KEY-----%0Axxxxxxxxxxx%0A-----END%20RSA%20PRIVATE%20KEY-----%0A
&<公共请求参数>

输出示例

{
  "Response": {
    "RequestId": "c7bfcad5-3f20-472f-9afc-13a66faebad8",
    "CertificateId": "cert-xxx"
  }
}

5. 开发者资源

API Explorer

该工具提供了在线调用、签名验证、SDK 代码生成和快速检索接口等能力,能显著降低使用云 API 的难度,推荐使用。

SDK

云 API 3.0 提供了配套的开发工具集(SDK),支持多种编程语言,能更方便的调用 API。

命令行工具

6. 错误码

以下仅列出了接口业务逻辑相关的错误码,其他错误码详见 公共错误码

错误码 描述
InternalError 内部错误
InvalidParameter 参数错误
InvalidParameterValue 参数取值错误
InvalidParameterValue.InvalidCertificateContent 解析失败,请检查证书内容格式。
InvalidParameterValue.InvalidCertificateKey 解析失败,请检查证书密钥格式。
MissingParameter 缺少参数错误
UnauthorizedOperation 未授权操作
UnknownParameter 未知参数错误
UnsupportedOperation 不支持该操作。