0

我正在尝试将证书导入 IBM-Cloud 上的证书管理器服务。我总是得到这个响应 { "code": "CRTERR400-01", "message": "There is something wrong with the content of your certificate" }JSON 的主体看起来像这样 ->{ "name": "string", "data": { "content": "" } }

在内容中,我将日期从我已经通过 ibm-cloud 网页导入到证书管理器的证书 .pem 文件中。有什么建议么?

4

1 回答 1

1

导入的证书内容应仅包含 PEM 格式字符串(从 -----BEGIN CERTIFICATE----- 到 -----END CERTIFICATE-----,包括),其中所有换行符都替换为\n.

因此,示例正文 JSON 将如下所示:

{
    "name":"My Certificate",
    "data": {
                "content":"-----BEGIN CERTIFICATE-----\nMIICqjCCAZICCQCRzXdgpbyJWzANBgkqhkiG9w0BAQsFADAXMRUwEwYDVQQDDAxu\nZXcudGVzdC5jb20wHhcNMTgwNTMxMDgxOTMzWhcNMTgwNjEwMDgxOTMzWjAXMRUw\nEwYDVQQDDAxuZXcudGVzdC5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK\nAoIBAQDf10ZX0vQe7A6JacEN4LF5i4coTyPQlefu2EBmz5S1BzYFs7lRWMwR594g\nnCSWg7iFUGhITlQ+qfNdqc3LE/ViooLtUuqcWPVP3pqt2tpiRo2RegOAoXE1XlV4\n7vP3SrVDP722sBGieGINkLj9fXSbuh1OqfJD0U1yrcsPP0vhVD97AM/9MMzQh4Jr\nkkHnSAnKct7R+lzIZF1gNiEtAXjlQA/XQzdiNuVhE2yERSucKlE7iV/DYxobT92W\ndwL0z/gu5BiHZ6z+og/ryb2jjLAVoLcMF70JtE4YfdE93oCl7EIm+kag1FYZDgDt\nOtlL9W3M0rnAQqb2CJrJXC6OaMN9AgMBAAEwDQYJKoZIhvcNAQELBQADggEBANuQ\n2l8qQoteTguEDU9Dj9AOU06sTquyhbR1eXGznJJ3Gsiin9q+ZCBfh64AGwK4SQ74\n55GfVGWIrYt1AF7hijIEu6B8YXpoi5nKjXxHXZ+hGwKCAbUK5HdCUTzHVBnL6PR4\ntanqstQ03EbxKHIHQV7dGu+QvphIqRL4UwLuXL6DsLbo1HgNiL1NFW1Vph8Yqx0H\nbktUYhrOZxi0yeM8EGYNw/OsguZBDk3Q19zzmWu3gTe/R0d/+nj9EUdkyUhRveBS\n9uLxkJl7HmfY3g9LbL5xC2buMLyP/lnsuCC8k8XmwPGoMy0uujKB8EHrV4c13kdV\nGQYgv6Nvbwmka2t1Y1k=\n-----END CERTIFICATE-----"
    }
}
于 2018-05-31T18:36:39.260 回答