ImportAsymmetricKey
更新时间:2023-03-07
ImportAsymmetricKey
- 接口描述
导入非对称密钥
- 请求URI
POST /?action=ImportAsymmetricKey
请求体参数
- 请求体字段数据结构说明
参数 | 类型 | 是否必需 | 描述 | 示例值 |
---|---|---|---|---|
keyId | String | 是 | CMK的密钥Id | 5be45b47-38ba-f055-e892-25ff66c91adc |
importToken | String | 是 | 导入密钥token | 735B2917220289CE28D68D40D9361C47DECF1106F094A5141E37822207543401272ADD4434A8DDA9619B681583D3D32B |
encryptedKeyEncryptionKey | String | 是 | 包装密钥加密的信封密钥密文,base64编码 | N9pFpk/GbNSp4JyCu6X/bw3Fyvwvz8kVo/5FKZ7IcRwsAtW3L2pCzI6ADb8i61MjK4mzNivxfyThQm2qFgjpIy/9ZIgPeFcN1yNDjBOIxaeodmO2SwZmgDpXoj+FRllayOUNrSjpxGFq5Zlr4sD+DPCrF0wkCteyLd+a87uWHOVz7g1CayvkiFYQqPjMHkHtzuvyNXNXLZ7KMhJfsK7DlxcPH0gyt1IivXhr5uvu2a/5u3CqPM6vefzmzRwOqrCRt8RpVnzTbKQr6gWC6XM2081MnPrZ4bRnqrTqD1r8oqeyEA6JWesiS6k1pAtzp+/fgwOknUW/X+k8JqMAnMmj4A== |
asymmetricKeySpec | String | 否 | 导入密钥类型,RSA_1024、RSA_2048、RSA_4096、SM2_256 | RSA_2048 |
asymmetricKeyUsage | String | 否 | 密钥用途 | ENCRYPT_DECRYPT |
encryptedRsaKey | EncryptedRsaKey | 否 | 待导入的RSA密钥成分 | |
encryptedSm2Key | EncryptedSm2Key | 是 | 待导入的SM2密钥成分 |
- EncryptedRsaKey字段数据结构说明
参数 | 类型 | 是否必需 | 描述 | 示例值 |
---|---|---|---|---|
publicKeyDer | String | 是 | 公钥 DER编码 ,base64编码 | MIGJAoGBALmF0NlX6MF8PS7RoObVItvzpYEkKarK8aDMUXES2ZJ9WBZrwGzhRIGkQ9BUV1EGX0Ig8qPQPFU+u0/V94SaKldND5KjUYpszJb0EJLeymTc+BAe2u/fhZe8sw90qT+CwgOsPVcacHMQHDsvx70nBg75AkXV/lQ1ZSSnKuE7rJFHAgMBAAE= |
encryptedD | String | 是 | D分量,经过信封密钥加密结果,base64编码 | BYXZIAYX2Rvud9k7uVmdcgOOtNVteQ+EA6WyjRmAcl4wG5DdO2QjQ+4vovCS5msIBfXNNt7h4EnrDr5xPgei2TcajrvA2vavQDxpz7QIHS1+XxrLkIlT/FArDH0ukU+Koj4H6dcquapxaZwELkYQ4xe7OqoRTOcVFTFrqDCgxGY= |
encryptedP | String | 是 | P分量,经过信封密钥加密结果,base64编码 | X9FEWmsnNggt5thO4kYgRfmbdGuhgCD+IB5hvo2nbqZhL+G3ATTKu9TKy4N9FmR+o7miz0VVgIwrCuqthnTB4A== |
encryptedQ | String | 是 | Q分量,经过信封密钥加密结果,base64编码 | r8KdOOzsbx1FCzZqWIPC0qaufH7X/hOeYkso1njEEyJNnSsgC4ie/ciYrgz0VrgNFqcEwPNmr0UlE3nEKFLS4g== |
encryptedDp | String | 是 | Dp分量,经过信封密钥加密结果,base64编码 | EN3uW94pNe72cqpU4NY9pg0mJ0VQCE1n6Sj4v2AZXntAW40QUyRgrotD9jwavfsAlafob9fFCv2ClGnjqW6xSQ== |
encryptedDq | String | 是 | Dq分量,经过信封密钥加密结果,base64编码 | h9grzSBaa4IJpLr5EioM6CINmb5YMQvCe7PWIVU5k41evV/QE2VQC81tAXmls95ULZuWdYgw+lry2emA72NagQ== |
encryptedQinv | String | 是 | Qinv分量,经过信封密钥加密结果,base64编码 | FYU2csVDSVknfcM1V+f1BFgoGzQC41uqPoZMfKIY3K1rDjCXeFIqH7fQlV3E7o4vaPm43+a/dkifW3diCtzg8w== |
- EncryptedSm2Key字段数据结构说明
参数 | 类型 | 是否必需 | 描述 | 示例值 |
---|---|---|---|---|
publicKeyDer | String | 是 | 公钥 DER编码 ,base64编码 | MFkwEwYHKoZIzj0CAQYIKoEcz1UBgi0DQgAESUUa8ZPpvU19QylQSp86O9mYExi4F3U1sC0Cs2G1ec2p1esP65mA7UHNFZ73A29crNfgGLrLXshU0/V1/cxhgg== |
encryptedPrivateKey | String | 是 | 私钥经过信封密钥加密结果,base64编码 | GafxSDLymFudqY5sdWoxQBr7CrODSdS2grKdWSPw9+8= |
响应体参数
无
请求示例
POST /?action=ImportAsymmetricKey
<公共请求头>
{
"encryptedKeyEncryptionKey" : "N9pFpk/GbNSp4JyCu6X/bw3Fyvwvz8kVo/5FKZ7IcRwsAtW3L2pCzI6ADb8i61MjK4mzNivxfyThQm2qFgjpIy/9ZIgPeFcN1yNDjBOIxaeodmO2SwZmgDpXoj+FRllayOUNrSjpxGFq5Zlr4sD+DPCrF0wkCteyLd+a87uWHOVz7g1CayvkiFYQqPjMHkHtzuvyNXNXLZ7KMhJfsK7DlxcPH0gyt1IivXhr5uvu2a/5u3CqPM6vefzmzRwOqrCRt8RpVnzTbKQr6gWC6XM2081MnPrZ4bRnqrTqD1r8oqeyEA6JWesiS6k1pAtzp+/fgwOknUW/X+k8JqMAnMmj4A==",
"asymmetricKeySpec" : "RSA_1024",
"asymmetricKeyUsage" : "ENCRYPT_DECRYPT",
"importToken" : "735B2917220289CE28D68D40D9361C47DECF1106F094A5141E37822207543401272ADD4434A8DDA9619B681583D3D32B",
"encryptedRsaKey" : {
"encryptedD" : "BYXZIAYX2Rvud9k7uVmdcgOOtNVteQ+EA6WyjRmAcl4wG5DdO2QjQ+4vovCS5msIBfXNNt7h4EnrDr5xPgei2TcajrvA2vavQDxpz7QIHS1+XxrLkIlT/FArDH0ukU+Koj4H6dcquapxaZwELkYQ4xe7OqoRTOcVFTFrqDCgxGY=",
"encryptedDp" : "EN3uW94pNe72cqpU4NY9pg0mJ0VQCE1n6Sj4v2AZXntAW40QUyRgrotD9jwavfsAlafob9fFCv2ClGnjqW6xSQ==",
"encryptedQinv" : "FYU2csVDSVknfcM1V+f1BFgoGzQC41uqPoZMfKIY3K1rDjCXeFIqH7fQlV3E7o4vaPm43+a/dkifW3diCtzg8w==",
"encryptedDq" : "h9grzSBaa4IJpLr5EioM6CINmb5YMQvCe7PWIVU5k41evV/QE2VQC81tAXmls95ULZuWdYgw+lry2emA72NagQ==",
"publicKeyDer" : "MIGJAoGBALmF0NlX6MF8PS7RoObVItvzpYEkKarK8aDMUXES2ZJ9WBZrwGzhRIGkQ9BUV1EGX0Ig8qPQPFU+u0/V94SaKldND5KjUYpszJb0EJLeymTc+BAe2u/fhZe8sw90qT+CwgOsPVcacHMQHDsvx70nBg75AkXV/lQ1ZSSnKuE7rJFHAgMBAAE=",
"encryptedP" : "X9FEWmsnNggt5thO4kYgRfmbdGuhgCD+IB5hvo2nbqZhL+G3ATTKu9TKy4N9FmR+o7miz0VVgIwrCuqthnTB4A==",
"encryptedQ" : "r8KdOOzsbx1FCzZqWIPC0qaufH7X/hOeYkso1njEEyJNnSsgC4ie/ciYrgz0VrgNFqcEwPNmr0UlE3nEKFLS4g=="
},
"keyId" : "5be45b47-38ba-f055-e892-25ff66c91adc",
"encryptedSm2Key" : {
"encryptedPrivateKey" : "GafxSDLymFudqY5sdWoxQBr7CrODSdS2grKdWSPw9+8=",
"publicKeyDer" : "MFkwEwYHKoZIzj0CAQYIKoEcz1UBgi0DQgAESUUa8ZPpvU19QylQSp86O9mYExi4F3U1sC0Cs2G1ec2p1esP65mA7UHNFZ73A29crNfgGLrLXshU0/V1/cxhgg=="
}
}
响应示例
无