1// Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. All Rights Reserved. 2// 3// Licensed under the Apache License, Version 2.0 (the "License"); 4// you may not use this file except in compliance with the License. 5// You may obtain a copy of the License at 6// 7// http://www.apache.org/licenses/LICENSE-2.0 8// 9// Unless required by applicable law or agreed to in writing, software 10// distributed under the License is distributed on an "AS IS" BASIS, 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12// See the License for the specific language governing permissions and 13// limitations under the License. 14 15package v20190118 16 17import ( 18 "encoding/json" 19 tcerr "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/errors" 20 tchttp "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/http" 21) 22 23type AlgorithmInfo struct { 24 25 // 算法的标识 26 KeyUsage *string `json:"KeyUsage,omitempty" name:"KeyUsage"` 27 28 // 算法的名称 29 Algorithm *string `json:"Algorithm,omitempty" name:"Algorithm"` 30} 31 32type ArchiveKeyRequest struct { 33 *tchttp.BaseRequest 34 35 // CMK唯一标识符 36 KeyId *string `json:"KeyId,omitempty" name:"KeyId"` 37} 38 39func (r *ArchiveKeyRequest) ToJsonString() string { 40 b, _ := json.Marshal(r) 41 return string(b) 42} 43 44// FromJsonString It is highly **NOT** recommended to use this function 45// because it has no param check, nor strict type check 46func (r *ArchiveKeyRequest) FromJsonString(s string) error { 47 f := make(map[string]interface{}) 48 if err := json.Unmarshal([]byte(s), &f); err != nil { 49 return err 50 } 51 delete(f, "KeyId") 52 if len(f) > 0 { 53 return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ArchiveKeyRequest has unknown keys!", "") 54 } 55 return json.Unmarshal([]byte(s), &r) 56} 57 58type ArchiveKeyResponse struct { 59 *tchttp.BaseResponse 60 Response *struct { 61 62 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 63 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 64 } `json:"Response"` 65} 66 67func (r *ArchiveKeyResponse) ToJsonString() string { 68 b, _ := json.Marshal(r) 69 return string(b) 70} 71 72// FromJsonString It is highly **NOT** recommended to use this function 73// because it has no param check, nor strict type check 74func (r *ArchiveKeyResponse) FromJsonString(s string) error { 75 return json.Unmarshal([]byte(s), &r) 76} 77 78type AsymmetricRsaDecryptRequest struct { 79 *tchttp.BaseRequest 80 81 // CMK的唯一标识 82 KeyId *string `json:"KeyId,omitempty" name:"KeyId"` 83 84 // 使用PublicKey加密的密文,Base64编码 85 Ciphertext *string `json:"Ciphertext,omitempty" name:"Ciphertext"` 86 87 // 在使用公钥加密时对应的算法:当前支持RSAES_PKCS1_V1_5、RSAES_OAEP_SHA_1、RSAES_OAEP_SHA_256 88 Algorithm *string `json:"Algorithm,omitempty" name:"Algorithm"` 89} 90 91func (r *AsymmetricRsaDecryptRequest) ToJsonString() string { 92 b, _ := json.Marshal(r) 93 return string(b) 94} 95 96// FromJsonString It is highly **NOT** recommended to use this function 97// because it has no param check, nor strict type check 98func (r *AsymmetricRsaDecryptRequest) FromJsonString(s string) error { 99 f := make(map[string]interface{}) 100 if err := json.Unmarshal([]byte(s), &f); err != nil { 101 return err 102 } 103 delete(f, "KeyId") 104 delete(f, "Ciphertext") 105 delete(f, "Algorithm") 106 if len(f) > 0 { 107 return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "AsymmetricRsaDecryptRequest has unknown keys!", "") 108 } 109 return json.Unmarshal([]byte(s), &r) 110} 111 112type AsymmetricRsaDecryptResponse struct { 113 *tchttp.BaseResponse 114 Response *struct { 115 116 // CMK的唯一标识 117 KeyId *string `json:"KeyId,omitempty" name:"KeyId"` 118 119 // 解密后的明文,base64编码 120 Plaintext *string `json:"Plaintext,omitempty" name:"Plaintext"` 121 122 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 123 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 124 } `json:"Response"` 125} 126 127func (r *AsymmetricRsaDecryptResponse) ToJsonString() string { 128 b, _ := json.Marshal(r) 129 return string(b) 130} 131 132// FromJsonString It is highly **NOT** recommended to use this function 133// because it has no param check, nor strict type check 134func (r *AsymmetricRsaDecryptResponse) FromJsonString(s string) error { 135 return json.Unmarshal([]byte(s), &r) 136} 137 138type AsymmetricSm2DecryptRequest struct { 139 *tchttp.BaseRequest 140 141 // CMK的唯一标识 142 KeyId *string `json:"KeyId,omitempty" name:"KeyId"` 143 144 // 使用PublicKey加密的密文,Base64编码。密文长度不能超过256字节。 145 Ciphertext *string `json:"Ciphertext,omitempty" name:"Ciphertext"` 146} 147 148func (r *AsymmetricSm2DecryptRequest) ToJsonString() string { 149 b, _ := json.Marshal(r) 150 return string(b) 151} 152 153// FromJsonString It is highly **NOT** recommended to use this function 154// because it has no param check, nor strict type check 155func (r *AsymmetricSm2DecryptRequest) FromJsonString(s string) error { 156 f := make(map[string]interface{}) 157 if err := json.Unmarshal([]byte(s), &f); err != nil { 158 return err 159 } 160 delete(f, "KeyId") 161 delete(f, "Ciphertext") 162 if len(f) > 0 { 163 return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "AsymmetricSm2DecryptRequest has unknown keys!", "") 164 } 165 return json.Unmarshal([]byte(s), &r) 166} 167 168type AsymmetricSm2DecryptResponse struct { 169 *tchttp.BaseResponse 170 Response *struct { 171 172 // CMK的唯一标识 173 KeyId *string `json:"KeyId,omitempty" name:"KeyId"` 174 175 // 解密后的明文,base64编码 176 Plaintext *string `json:"Plaintext,omitempty" name:"Plaintext"` 177 178 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 179 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 180 } `json:"Response"` 181} 182 183func (r *AsymmetricSm2DecryptResponse) ToJsonString() string { 184 b, _ := json.Marshal(r) 185 return string(b) 186} 187 188// FromJsonString It is highly **NOT** recommended to use this function 189// because it has no param check, nor strict type check 190func (r *AsymmetricSm2DecryptResponse) FromJsonString(s string) error { 191 return json.Unmarshal([]byte(s), &r) 192} 193 194type BindCloudResourceRequest struct { 195 *tchttp.BaseRequest 196 197 // cmk的ID 198 KeyId *string `json:"KeyId,omitempty" name:"KeyId"` 199 200 // 云产品的唯一性标识符 201 ProductId *string `json:"ProductId,omitempty" name:"ProductId"` 202 203 // 资源/实例ID,由调用方根据自己的云产品特征来定义,以字符串形式做存储。 204 ResourceId *string `json:"ResourceId,omitempty" name:"ResourceId"` 205} 206 207func (r *BindCloudResourceRequest) ToJsonString() string { 208 b, _ := json.Marshal(r) 209 return string(b) 210} 211 212// FromJsonString It is highly **NOT** recommended to use this function 213// because it has no param check, nor strict type check 214func (r *BindCloudResourceRequest) FromJsonString(s string) error { 215 f := make(map[string]interface{}) 216 if err := json.Unmarshal([]byte(s), &f); err != nil { 217 return err 218 } 219 delete(f, "KeyId") 220 delete(f, "ProductId") 221 delete(f, "ResourceId") 222 if len(f) > 0 { 223 return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "BindCloudResourceRequest has unknown keys!", "") 224 } 225 return json.Unmarshal([]byte(s), &r) 226} 227 228type BindCloudResourceResponse struct { 229 *tchttp.BaseResponse 230 Response *struct { 231 232 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 233 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 234 } `json:"Response"` 235} 236 237func (r *BindCloudResourceResponse) ToJsonString() string { 238 b, _ := json.Marshal(r) 239 return string(b) 240} 241 242// FromJsonString It is highly **NOT** recommended to use this function 243// because it has no param check, nor strict type check 244func (r *BindCloudResourceResponse) FromJsonString(s string) error { 245 return json.Unmarshal([]byte(s), &r) 246} 247 248type CancelKeyArchiveRequest struct { 249 *tchttp.BaseRequest 250 251 // CMK唯一标识符 252 KeyId *string `json:"KeyId,omitempty" name:"KeyId"` 253} 254 255func (r *CancelKeyArchiveRequest) ToJsonString() string { 256 b, _ := json.Marshal(r) 257 return string(b) 258} 259 260// FromJsonString It is highly **NOT** recommended to use this function 261// because it has no param check, nor strict type check 262func (r *CancelKeyArchiveRequest) FromJsonString(s string) error { 263 f := make(map[string]interface{}) 264 if err := json.Unmarshal([]byte(s), &f); err != nil { 265 return err 266 } 267 delete(f, "KeyId") 268 if len(f) > 0 { 269 return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CancelKeyArchiveRequest has unknown keys!", "") 270 } 271 return json.Unmarshal([]byte(s), &r) 272} 273 274type CancelKeyArchiveResponse struct { 275 *tchttp.BaseResponse 276 Response *struct { 277 278 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 279 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 280 } `json:"Response"` 281} 282 283func (r *CancelKeyArchiveResponse) ToJsonString() string { 284 b, _ := json.Marshal(r) 285 return string(b) 286} 287 288// FromJsonString It is highly **NOT** recommended to use this function 289// because it has no param check, nor strict type check 290func (r *CancelKeyArchiveResponse) FromJsonString(s string) error { 291 return json.Unmarshal([]byte(s), &r) 292} 293 294type CancelKeyDeletionRequest struct { 295 *tchttp.BaseRequest 296 297 // 需要被取消删除的CMK的唯一标志 298 KeyId *string `json:"KeyId,omitempty" name:"KeyId"` 299} 300 301func (r *CancelKeyDeletionRequest) ToJsonString() string { 302 b, _ := json.Marshal(r) 303 return string(b) 304} 305 306// FromJsonString It is highly **NOT** recommended to use this function 307// because it has no param check, nor strict type check 308func (r *CancelKeyDeletionRequest) FromJsonString(s string) error { 309 f := make(map[string]interface{}) 310 if err := json.Unmarshal([]byte(s), &f); err != nil { 311 return err 312 } 313 delete(f, "KeyId") 314 if len(f) > 0 { 315 return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CancelKeyDeletionRequest has unknown keys!", "") 316 } 317 return json.Unmarshal([]byte(s), &r) 318} 319 320type CancelKeyDeletionResponse struct { 321 *tchttp.BaseResponse 322 Response *struct { 323 324 // 唯一标志被取消删除的CMK。 325 KeyId *string `json:"KeyId,omitempty" name:"KeyId"` 326 327 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 328 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 329 } `json:"Response"` 330} 331 332func (r *CancelKeyDeletionResponse) ToJsonString() string { 333 b, _ := json.Marshal(r) 334 return string(b) 335} 336 337// FromJsonString It is highly **NOT** recommended to use this function 338// because it has no param check, nor strict type check 339func (r *CancelKeyDeletionResponse) FromJsonString(s string) error { 340 return json.Unmarshal([]byte(s), &r) 341} 342 343type CreateKeyRequest struct { 344 *tchttp.BaseRequest 345 346 // 作为密钥更容易辨识,更容易被人看懂的别名, 不可为空,1-60个字母数字 - _ 的组合,首字符必须为字母或者数字。以 kms- 作为前缀的用于云产品使用,Alias 不可重复。 347 Alias *string `json:"Alias,omitempty" name:"Alias"` 348 349 // CMK 的描述,最大1024字节 350 Description *string `json:"Description,omitempty" name:"Description"` 351 352 // 指定key的用途,默认为 "ENCRYPT_DECRYPT" 表示创建对称加解密密钥,其它支持用途 “ASYMMETRIC_DECRYPT_RSA_2048” 表示创建用于加解密的RSA2048非对称密钥,“ASYMMETRIC_DECRYPT_SM2” 表示创建用于加解密的SM2非对称密钥, “ASYMMETRIC_SIGN_VERIFY_SM2” 表示创建用于签名验签的SM2非对称密钥, “ASYMMETRIC_SIGN_VERIFY_ECC” 表示创建用于签名验签的ECC非对称密钥, “ASYMMETRIC_SIGN_VERIFY_RSA_2048” 表示创建用于签名验签的RSA_2048非对称密钥 353 KeyUsage *string `json:"KeyUsage,omitempty" name:"KeyUsage"` 354 355 // 指定key类型,默认为1,1表示默认类型,由KMS创建CMK密钥,2 表示EXTERNAL 类型,该类型需要用户导入密钥材料,参考 GetParametersForImport 和 ImportKeyMaterial 接口 356 Type *uint64 `json:"Type,omitempty" name:"Type"` 357 358 // 标签列表 359 Tags []*Tag `json:"Tags,omitempty" name:"Tags"` 360} 361 362func (r *CreateKeyRequest) ToJsonString() string { 363 b, _ := json.Marshal(r) 364 return string(b) 365} 366 367// FromJsonString It is highly **NOT** recommended to use this function 368// because it has no param check, nor strict type check 369func (r *CreateKeyRequest) FromJsonString(s string) error { 370 f := make(map[string]interface{}) 371 if err := json.Unmarshal([]byte(s), &f); err != nil { 372 return err 373 } 374 delete(f, "Alias") 375 delete(f, "Description") 376 delete(f, "KeyUsage") 377 delete(f, "Type") 378 delete(f, "Tags") 379 if len(f) > 0 { 380 return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateKeyRequest has unknown keys!", "") 381 } 382 return json.Unmarshal([]byte(s), &r) 383} 384 385type CreateKeyResponse struct { 386 *tchttp.BaseResponse 387 Response *struct { 388 389 // CMK的全局唯一标识符 390 KeyId *string `json:"KeyId,omitempty" name:"KeyId"` 391 392 // 作为密钥更容易辨识,更容易被人看懂的别名 393 Alias *string `json:"Alias,omitempty" name:"Alias"` 394 395 // 密钥创建时间,unix时间戳 396 CreateTime *uint64 `json:"CreateTime,omitempty" name:"CreateTime"` 397 398 // CMK的描述 399 // 注意:此字段可能返回 null,表示取不到有效值。 400 Description *string `json:"Description,omitempty" name:"Description"` 401 402 // CMK的状态 403 KeyState *string `json:"KeyState,omitempty" name:"KeyState"` 404 405 // CMK的用途 406 KeyUsage *string `json:"KeyUsage,omitempty" name:"KeyUsage"` 407 408 // 标签操作的返回码. 0: 成功;1: 内部错误;2: 业务处理错误 409 // 注意:此字段可能返回 null,表示取不到有效值。 410 TagCode *uint64 `json:"TagCode,omitempty" name:"TagCode"` 411 412 // 标签操作的返回信息 413 // 注意:此字段可能返回 null,表示取不到有效值。 414 TagMsg *string `json:"TagMsg,omitempty" name:"TagMsg"` 415 416 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 417 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 418 } `json:"Response"` 419} 420 421func (r *CreateKeyResponse) ToJsonString() string { 422 b, _ := json.Marshal(r) 423 return string(b) 424} 425 426// FromJsonString It is highly **NOT** recommended to use this function 427// because it has no param check, nor strict type check 428func (r *CreateKeyResponse) FromJsonString(s string) error { 429 return json.Unmarshal([]byte(s), &r) 430} 431 432type CreateWhiteBoxKeyRequest struct { 433 *tchttp.BaseRequest 434 435 // 作为密钥更容易辨识,更容易被人看懂的别名, 不可为空,1-60个字母数字 - _ 的组合,首字符必须为字母或者数字。Alias不可重复。 436 Alias *string `json:"Alias,omitempty" name:"Alias"` 437 438 // 创建密钥所有的算法类型,支持的取值:AES_256,SM4 439 Algorithm *string `json:"Algorithm,omitempty" name:"Algorithm"` 440 441 // 密钥的描述,最大1024字节 442 Description *string `json:"Description,omitempty" name:"Description"` 443 444 // 标签列表 445 Tags []*Tag `json:"Tags,omitempty" name:"Tags"` 446} 447 448func (r *CreateWhiteBoxKeyRequest) ToJsonString() string { 449 b, _ := json.Marshal(r) 450 return string(b) 451} 452 453// FromJsonString It is highly **NOT** recommended to use this function 454// because it has no param check, nor strict type check 455func (r *CreateWhiteBoxKeyRequest) FromJsonString(s string) error { 456 f := make(map[string]interface{}) 457 if err := json.Unmarshal([]byte(s), &f); err != nil { 458 return err 459 } 460 delete(f, "Alias") 461 delete(f, "Algorithm") 462 delete(f, "Description") 463 delete(f, "Tags") 464 if len(f) > 0 { 465 return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateWhiteBoxKeyRequest has unknown keys!", "") 466 } 467 return json.Unmarshal([]byte(s), &r) 468} 469 470type CreateWhiteBoxKeyResponse struct { 471 *tchttp.BaseResponse 472 Response *struct { 473 474 // 用于加密的密钥,base64编码 475 EncryptKey *string `json:"EncryptKey,omitempty" name:"EncryptKey"` 476 477 // 用于解密的密钥,base64编码 478 DecryptKey *string `json:"DecryptKey,omitempty" name:"DecryptKey"` 479 480 // 白盒密钥的全局唯一标识符 481 KeyId *string `json:"KeyId,omitempty" name:"KeyId"` 482 483 // 标签操作的返回码. 0: 成功;1: 内部错误;2: 业务处理错误 484 // 注意:此字段可能返回 null,表示取不到有效值。 485 TagCode *uint64 `json:"TagCode,omitempty" name:"TagCode"` 486 487 // 标签操作的返回信息 488 // 注意:此字段可能返回 null,表示取不到有效值。 489 TagMsg *string `json:"TagMsg,omitempty" name:"TagMsg"` 490 491 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 492 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 493 } `json:"Response"` 494} 495 496func (r *CreateWhiteBoxKeyResponse) ToJsonString() string { 497 b, _ := json.Marshal(r) 498 return string(b) 499} 500 501// FromJsonString It is highly **NOT** recommended to use this function 502// because it has no param check, nor strict type check 503func (r *CreateWhiteBoxKeyResponse) FromJsonString(s string) error { 504 return json.Unmarshal([]byte(s), &r) 505} 506 507type DecryptRequest struct { 508 *tchttp.BaseRequest 509 510 // 待解密的密文数据 511 CiphertextBlob *string `json:"CiphertextBlob,omitempty" name:"CiphertextBlob"` 512 513 // key/value对的json字符串,如果Encrypt指定了该参数,则在调用Decrypt API时需要提供同样的参数,最大支持1024字符 514 EncryptionContext *string `json:"EncryptionContext,omitempty" name:"EncryptionContext"` 515} 516 517func (r *DecryptRequest) ToJsonString() string { 518 b, _ := json.Marshal(r) 519 return string(b) 520} 521 522// FromJsonString It is highly **NOT** recommended to use this function 523// because it has no param check, nor strict type check 524func (r *DecryptRequest) FromJsonString(s string) error { 525 f := make(map[string]interface{}) 526 if err := json.Unmarshal([]byte(s), &f); err != nil { 527 return err 528 } 529 delete(f, "CiphertextBlob") 530 delete(f, "EncryptionContext") 531 if len(f) > 0 { 532 return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DecryptRequest has unknown keys!", "") 533 } 534 return json.Unmarshal([]byte(s), &r) 535} 536 537type DecryptResponse struct { 538 *tchttp.BaseResponse 539 Response *struct { 540 541 // CMK的全局唯一标识 542 KeyId *string `json:"KeyId,omitempty" name:"KeyId"` 543 544 // 解密后的明文。该字段是base64编码的,为了得到原始明文,调用方需要进行base64解码 545 Plaintext *string `json:"Plaintext,omitempty" name:"Plaintext"` 546 547 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 548 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 549 } `json:"Response"` 550} 551 552func (r *DecryptResponse) ToJsonString() string { 553 b, _ := json.Marshal(r) 554 return string(b) 555} 556 557// FromJsonString It is highly **NOT** recommended to use this function 558// because it has no param check, nor strict type check 559func (r *DecryptResponse) FromJsonString(s string) error { 560 return json.Unmarshal([]byte(s), &r) 561} 562 563type DeleteImportedKeyMaterialRequest struct { 564 *tchttp.BaseRequest 565 566 // 指定需要删除密钥材料的EXTERNAL CMK。 567 KeyId *string `json:"KeyId,omitempty" name:"KeyId"` 568} 569 570func (r *DeleteImportedKeyMaterialRequest) ToJsonString() string { 571 b, _ := json.Marshal(r) 572 return string(b) 573} 574 575// FromJsonString It is highly **NOT** recommended to use this function 576// because it has no param check, nor strict type check 577func (r *DeleteImportedKeyMaterialRequest) FromJsonString(s string) error { 578 f := make(map[string]interface{}) 579 if err := json.Unmarshal([]byte(s), &f); err != nil { 580 return err 581 } 582 delete(f, "KeyId") 583 if len(f) > 0 { 584 return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteImportedKeyMaterialRequest has unknown keys!", "") 585 } 586 return json.Unmarshal([]byte(s), &r) 587} 588 589type DeleteImportedKeyMaterialResponse struct { 590 *tchttp.BaseResponse 591 Response *struct { 592 593 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 594 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 595 } `json:"Response"` 596} 597 598func (r *DeleteImportedKeyMaterialResponse) ToJsonString() string { 599 b, _ := json.Marshal(r) 600 return string(b) 601} 602 603// FromJsonString It is highly **NOT** recommended to use this function 604// because it has no param check, nor strict type check 605func (r *DeleteImportedKeyMaterialResponse) FromJsonString(s string) error { 606 return json.Unmarshal([]byte(s), &r) 607} 608 609type DeleteWhiteBoxKeyRequest struct { 610 *tchttp.BaseRequest 611 612 // 白盒密钥的全局唯一标识符 613 KeyId *string `json:"KeyId,omitempty" name:"KeyId"` 614} 615 616func (r *DeleteWhiteBoxKeyRequest) ToJsonString() string { 617 b, _ := json.Marshal(r) 618 return string(b) 619} 620 621// FromJsonString It is highly **NOT** recommended to use this function 622// because it has no param check, nor strict type check 623func (r *DeleteWhiteBoxKeyRequest) FromJsonString(s string) error { 624 f := make(map[string]interface{}) 625 if err := json.Unmarshal([]byte(s), &f); err != nil { 626 return err 627 } 628 delete(f, "KeyId") 629 if len(f) > 0 { 630 return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteWhiteBoxKeyRequest has unknown keys!", "") 631 } 632 return json.Unmarshal([]byte(s), &r) 633} 634 635type DeleteWhiteBoxKeyResponse struct { 636 *tchttp.BaseResponse 637 Response *struct { 638 639 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 640 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 641 } `json:"Response"` 642} 643 644func (r *DeleteWhiteBoxKeyResponse) ToJsonString() string { 645 b, _ := json.Marshal(r) 646 return string(b) 647} 648 649// FromJsonString It is highly **NOT** recommended to use this function 650// because it has no param check, nor strict type check 651func (r *DeleteWhiteBoxKeyResponse) FromJsonString(s string) error { 652 return json.Unmarshal([]byte(s), &r) 653} 654 655type DescribeKeyRequest struct { 656 *tchttp.BaseRequest 657 658 // CMK全局唯一标识符 659 KeyId *string `json:"KeyId,omitempty" name:"KeyId"` 660} 661 662func (r *DescribeKeyRequest) ToJsonString() string { 663 b, _ := json.Marshal(r) 664 return string(b) 665} 666 667// FromJsonString It is highly **NOT** recommended to use this function 668// because it has no param check, nor strict type check 669func (r *DescribeKeyRequest) FromJsonString(s string) error { 670 f := make(map[string]interface{}) 671 if err := json.Unmarshal([]byte(s), &f); err != nil { 672 return err 673 } 674 delete(f, "KeyId") 675 if len(f) > 0 { 676 return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeKeyRequest has unknown keys!", "") 677 } 678 return json.Unmarshal([]byte(s), &r) 679} 680 681type DescribeKeyResponse struct { 682 *tchttp.BaseResponse 683 Response *struct { 684 685 // 密钥属性信息 686 // 注意:此字段可能返回 null,表示取不到有效值。 687 KeyMetadata *KeyMetadata `json:"KeyMetadata,omitempty" name:"KeyMetadata"` 688 689 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 690 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 691 } `json:"Response"` 692} 693 694func (r *DescribeKeyResponse) ToJsonString() string { 695 b, _ := json.Marshal(r) 696 return string(b) 697} 698 699// FromJsonString It is highly **NOT** recommended to use this function 700// because it has no param check, nor strict type check 701func (r *DescribeKeyResponse) FromJsonString(s string) error { 702 return json.Unmarshal([]byte(s), &r) 703} 704 705type DescribeKeysRequest struct { 706 *tchttp.BaseRequest 707 708 // 查询CMK的ID列表,批量查询一次最多支持100个KeyId 709 KeyIds []*string `json:"KeyIds,omitempty" name:"KeyIds"` 710} 711 712func (r *DescribeKeysRequest) ToJsonString() string { 713 b, _ := json.Marshal(r) 714 return string(b) 715} 716 717// FromJsonString It is highly **NOT** recommended to use this function 718// because it has no param check, nor strict type check 719func (r *DescribeKeysRequest) FromJsonString(s string) error { 720 f := make(map[string]interface{}) 721 if err := json.Unmarshal([]byte(s), &f); err != nil { 722 return err 723 } 724 delete(f, "KeyIds") 725 if len(f) > 0 { 726 return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeKeysRequest has unknown keys!", "") 727 } 728 return json.Unmarshal([]byte(s), &r) 729} 730 731type DescribeKeysResponse struct { 732 *tchttp.BaseResponse 733 Response *struct { 734 735 // 返回的属性信息列表 736 // 注意:此字段可能返回 null,表示取不到有效值。 737 KeyMetadatas []*KeyMetadata `json:"KeyMetadatas,omitempty" name:"KeyMetadatas"` 738 739 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 740 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 741 } `json:"Response"` 742} 743 744func (r *DescribeKeysResponse) ToJsonString() string { 745 b, _ := json.Marshal(r) 746 return string(b) 747} 748 749// FromJsonString It is highly **NOT** recommended to use this function 750// because it has no param check, nor strict type check 751func (r *DescribeKeysResponse) FromJsonString(s string) error { 752 return json.Unmarshal([]byte(s), &r) 753} 754 755type DescribeWhiteBoxDecryptKeyRequest struct { 756 *tchttp.BaseRequest 757 758 // 白盒密钥的全局唯一标识符 759 KeyId *string `json:"KeyId,omitempty" name:"KeyId"` 760} 761 762func (r *DescribeWhiteBoxDecryptKeyRequest) ToJsonString() string { 763 b, _ := json.Marshal(r) 764 return string(b) 765} 766 767// FromJsonString It is highly **NOT** recommended to use this function 768// because it has no param check, nor strict type check 769func (r *DescribeWhiteBoxDecryptKeyRequest) FromJsonString(s string) error { 770 f := make(map[string]interface{}) 771 if err := json.Unmarshal([]byte(s), &f); err != nil { 772 return err 773 } 774 delete(f, "KeyId") 775 if len(f) > 0 { 776 return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeWhiteBoxDecryptKeyRequest has unknown keys!", "") 777 } 778 return json.Unmarshal([]byte(s), &r) 779} 780 781type DescribeWhiteBoxDecryptKeyResponse struct { 782 *tchttp.BaseResponse 783 Response *struct { 784 785 // 白盒解密密钥,base64编码 786 DecryptKey *string `json:"DecryptKey,omitempty" name:"DecryptKey"` 787 788 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 789 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 790 } `json:"Response"` 791} 792 793func (r *DescribeWhiteBoxDecryptKeyResponse) ToJsonString() string { 794 b, _ := json.Marshal(r) 795 return string(b) 796} 797 798// FromJsonString It is highly **NOT** recommended to use this function 799// because it has no param check, nor strict type check 800func (r *DescribeWhiteBoxDecryptKeyResponse) FromJsonString(s string) error { 801 return json.Unmarshal([]byte(s), &r) 802} 803 804type DescribeWhiteBoxDeviceFingerprintsRequest struct { 805 *tchttp.BaseRequest 806 807 // 白盒密钥ID 808 KeyId *string `json:"KeyId,omitempty" name:"KeyId"` 809} 810 811func (r *DescribeWhiteBoxDeviceFingerprintsRequest) ToJsonString() string { 812 b, _ := json.Marshal(r) 813 return string(b) 814} 815 816// FromJsonString It is highly **NOT** recommended to use this function 817// because it has no param check, nor strict type check 818func (r *DescribeWhiteBoxDeviceFingerprintsRequest) FromJsonString(s string) error { 819 f := make(map[string]interface{}) 820 if err := json.Unmarshal([]byte(s), &f); err != nil { 821 return err 822 } 823 delete(f, "KeyId") 824 if len(f) > 0 { 825 return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeWhiteBoxDeviceFingerprintsRequest has unknown keys!", "") 826 } 827 return json.Unmarshal([]byte(s), &r) 828} 829 830type DescribeWhiteBoxDeviceFingerprintsResponse struct { 831 *tchttp.BaseResponse 832 Response *struct { 833 834 // 设备指纹列表 835 DeviceFingerprints []*DeviceFingerprint `json:"DeviceFingerprints,omitempty" name:"DeviceFingerprints"` 836 837 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 838 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 839 } `json:"Response"` 840} 841 842func (r *DescribeWhiteBoxDeviceFingerprintsResponse) ToJsonString() string { 843 b, _ := json.Marshal(r) 844 return string(b) 845} 846 847// FromJsonString It is highly **NOT** recommended to use this function 848// because it has no param check, nor strict type check 849func (r *DescribeWhiteBoxDeviceFingerprintsResponse) FromJsonString(s string) error { 850 return json.Unmarshal([]byte(s), &r) 851} 852 853type DescribeWhiteBoxKeyDetailsRequest struct { 854 *tchttp.BaseRequest 855 856 // 过滤条件:密钥的状态,0:disabled,1:enabled 857 KeyStatus *int64 `json:"KeyStatus,omitempty" name:"KeyStatus"` 858 859 // 含义跟 SQL 查询的 Offset 一致,表示本次获取从按一定顺序排列数组的第 Offset 个元素开始,缺省为0 860 Offset *uint64 `json:"Offset,omitempty" name:"Offset"` 861 862 // 含义跟 SQL 查询的 Limit 一致,表示本次最多获取 Limit 个元素。缺省值为0, 表示不分页 863 Limit *uint64 `json:"Limit,omitempty" name:"Limit"` 864 865 // 标签过滤条件 866 TagFilters []*TagFilter `json:"TagFilters,omitempty" name:"TagFilters"` 867} 868 869func (r *DescribeWhiteBoxKeyDetailsRequest) ToJsonString() string { 870 b, _ := json.Marshal(r) 871 return string(b) 872} 873 874// FromJsonString It is highly **NOT** recommended to use this function 875// because it has no param check, nor strict type check 876func (r *DescribeWhiteBoxKeyDetailsRequest) FromJsonString(s string) error { 877 f := make(map[string]interface{}) 878 if err := json.Unmarshal([]byte(s), &f); err != nil { 879 return err 880 } 881 delete(f, "KeyStatus") 882 delete(f, "Offset") 883 delete(f, "Limit") 884 delete(f, "TagFilters") 885 if len(f) > 0 { 886 return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeWhiteBoxKeyDetailsRequest has unknown keys!", "") 887 } 888 return json.Unmarshal([]byte(s), &r) 889} 890 891type DescribeWhiteBoxKeyDetailsResponse struct { 892 *tchttp.BaseResponse 893 Response *struct { 894 895 // 白盒密钥信息列表 896 KeyInfos []*WhiteboxKeyInfo `json:"KeyInfos,omitempty" name:"KeyInfos"` 897 898 // key总数量 899 // 注意:此字段可能返回 null,表示取不到有效值。 900 TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` 901 902 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 903 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 904 } `json:"Response"` 905} 906 907func (r *DescribeWhiteBoxKeyDetailsResponse) ToJsonString() string { 908 b, _ := json.Marshal(r) 909 return string(b) 910} 911 912// FromJsonString It is highly **NOT** recommended to use this function 913// because it has no param check, nor strict type check 914func (r *DescribeWhiteBoxKeyDetailsResponse) FromJsonString(s string) error { 915 return json.Unmarshal([]byte(s), &r) 916} 917 918type DescribeWhiteBoxKeyRequest struct { 919 *tchttp.BaseRequest 920 921 // 白盒密钥的全局唯一标识符 922 KeyId *string `json:"KeyId,omitempty" name:"KeyId"` 923} 924 925func (r *DescribeWhiteBoxKeyRequest) ToJsonString() string { 926 b, _ := json.Marshal(r) 927 return string(b) 928} 929 930// FromJsonString It is highly **NOT** recommended to use this function 931// because it has no param check, nor strict type check 932func (r *DescribeWhiteBoxKeyRequest) FromJsonString(s string) error { 933 f := make(map[string]interface{}) 934 if err := json.Unmarshal([]byte(s), &f); err != nil { 935 return err 936 } 937 delete(f, "KeyId") 938 if len(f) > 0 { 939 return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeWhiteBoxKeyRequest has unknown keys!", "") 940 } 941 return json.Unmarshal([]byte(s), &r) 942} 943 944type DescribeWhiteBoxKeyResponse struct { 945 *tchttp.BaseResponse 946 Response *struct { 947 948 // 白盒密钥信息 949 KeyInfo *WhiteboxKeyInfo `json:"KeyInfo,omitempty" name:"KeyInfo"` 950 951 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 952 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 953 } `json:"Response"` 954} 955 956func (r *DescribeWhiteBoxKeyResponse) ToJsonString() string { 957 b, _ := json.Marshal(r) 958 return string(b) 959} 960 961// FromJsonString It is highly **NOT** recommended to use this function 962// because it has no param check, nor strict type check 963func (r *DescribeWhiteBoxKeyResponse) FromJsonString(s string) error { 964 return json.Unmarshal([]byte(s), &r) 965} 966 967type DescribeWhiteBoxServiceStatusRequest struct { 968 *tchttp.BaseRequest 969} 970 971func (r *DescribeWhiteBoxServiceStatusRequest) ToJsonString() string { 972 b, _ := json.Marshal(r) 973 return string(b) 974} 975 976// FromJsonString It is highly **NOT** recommended to use this function 977// because it has no param check, nor strict type check 978func (r *DescribeWhiteBoxServiceStatusRequest) FromJsonString(s string) error { 979 f := make(map[string]interface{}) 980 if err := json.Unmarshal([]byte(s), &f); err != nil { 981 return err 982 } 983 if len(f) > 0 { 984 return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeWhiteBoxServiceStatusRequest has unknown keys!", "") 985 } 986 return json.Unmarshal([]byte(s), &r) 987} 988 989type DescribeWhiteBoxServiceStatusResponse struct { 990 *tchttp.BaseResponse 991 Response *struct { 992 993 // 用户的白盒密钥服务是否可用 994 ServiceEnabled *bool `json:"ServiceEnabled,omitempty" name:"ServiceEnabled"` 995 996 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 997 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 998 } `json:"Response"` 999} 1000 1001func (r *DescribeWhiteBoxServiceStatusResponse) ToJsonString() string { 1002 b, _ := json.Marshal(r) 1003 return string(b) 1004} 1005 1006// FromJsonString It is highly **NOT** recommended to use this function 1007// because it has no param check, nor strict type check 1008func (r *DescribeWhiteBoxServiceStatusResponse) FromJsonString(s string) error { 1009 return json.Unmarshal([]byte(s), &r) 1010} 1011 1012type DeviceFingerprint struct { 1013 1014 // 指纹信息,由设备指纹采集工具采集获得,格式满足正则表达式:^[0-9a-f]{8}[\-][0-9a-f]{14}[\-][0-9a-f]{14}[\-][0-9a-f]{14}[\-][0-9a-f]{16}$ 1015 Identity *string `json:"Identity,omitempty" name:"Identity"` 1016 1017 // 描述信息,如:IP,设备名称等,最大1024字节 1018 // 注意:此字段可能返回 null,表示取不到有效值。 1019 Description *string `json:"Description,omitempty" name:"Description"` 1020} 1021 1022type DisableKeyRequest struct { 1023 *tchttp.BaseRequest 1024 1025 // CMK唯一标识符 1026 KeyId *string `json:"KeyId,omitempty" name:"KeyId"` 1027} 1028 1029func (r *DisableKeyRequest) ToJsonString() string { 1030 b, _ := json.Marshal(r) 1031 return string(b) 1032} 1033 1034// FromJsonString It is highly **NOT** recommended to use this function 1035// because it has no param check, nor strict type check 1036func (r *DisableKeyRequest) FromJsonString(s string) error { 1037 f := make(map[string]interface{}) 1038 if err := json.Unmarshal([]byte(s), &f); err != nil { 1039 return err 1040 } 1041 delete(f, "KeyId") 1042 if len(f) > 0 { 1043 return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DisableKeyRequest has unknown keys!", "") 1044 } 1045 return json.Unmarshal([]byte(s), &r) 1046} 1047 1048type DisableKeyResponse struct { 1049 *tchttp.BaseResponse 1050 Response *struct { 1051 1052 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 1053 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 1054 } `json:"Response"` 1055} 1056 1057func (r *DisableKeyResponse) ToJsonString() string { 1058 b, _ := json.Marshal(r) 1059 return string(b) 1060} 1061 1062// FromJsonString It is highly **NOT** recommended to use this function 1063// because it has no param check, nor strict type check 1064func (r *DisableKeyResponse) FromJsonString(s string) error { 1065 return json.Unmarshal([]byte(s), &r) 1066} 1067 1068type DisableKeyRotationRequest struct { 1069 *tchttp.BaseRequest 1070 1071 // CMK唯一标识符 1072 KeyId *string `json:"KeyId,omitempty" name:"KeyId"` 1073} 1074 1075func (r *DisableKeyRotationRequest) ToJsonString() string { 1076 b, _ := json.Marshal(r) 1077 return string(b) 1078} 1079 1080// FromJsonString It is highly **NOT** recommended to use this function 1081// because it has no param check, nor strict type check 1082func (r *DisableKeyRotationRequest) FromJsonString(s string) error { 1083 f := make(map[string]interface{}) 1084 if err := json.Unmarshal([]byte(s), &f); err != nil { 1085 return err 1086 } 1087 delete(f, "KeyId") 1088 if len(f) > 0 { 1089 return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DisableKeyRotationRequest has unknown keys!", "") 1090 } 1091 return json.Unmarshal([]byte(s), &r) 1092} 1093 1094type DisableKeyRotationResponse struct { 1095 *tchttp.BaseResponse 1096 Response *struct { 1097 1098 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 1099 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 1100 } `json:"Response"` 1101} 1102 1103func (r *DisableKeyRotationResponse) ToJsonString() string { 1104 b, _ := json.Marshal(r) 1105 return string(b) 1106} 1107 1108// FromJsonString It is highly **NOT** recommended to use this function 1109// because it has no param check, nor strict type check 1110func (r *DisableKeyRotationResponse) FromJsonString(s string) error { 1111 return json.Unmarshal([]byte(s), &r) 1112} 1113 1114type DisableKeysRequest struct { 1115 *tchttp.BaseRequest 1116 1117 // 需要批量禁用的CMK Id 列表,CMK数量最大支持100 1118 KeyIds []*string `json:"KeyIds,omitempty" name:"KeyIds"` 1119} 1120 1121func (r *DisableKeysRequest) ToJsonString() string { 1122 b, _ := json.Marshal(r) 1123 return string(b) 1124} 1125 1126// FromJsonString It is highly **NOT** recommended to use this function 1127// because it has no param check, nor strict type check 1128func (r *DisableKeysRequest) FromJsonString(s string) error { 1129 f := make(map[string]interface{}) 1130 if err := json.Unmarshal([]byte(s), &f); err != nil { 1131 return err 1132 } 1133 delete(f, "KeyIds") 1134 if len(f) > 0 { 1135 return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DisableKeysRequest has unknown keys!", "") 1136 } 1137 return json.Unmarshal([]byte(s), &r) 1138} 1139 1140type DisableKeysResponse struct { 1141 *tchttp.BaseResponse 1142 Response *struct { 1143 1144 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 1145 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 1146 } `json:"Response"` 1147} 1148 1149func (r *DisableKeysResponse) ToJsonString() string { 1150 b, _ := json.Marshal(r) 1151 return string(b) 1152} 1153 1154// FromJsonString It is highly **NOT** recommended to use this function 1155// because it has no param check, nor strict type check 1156func (r *DisableKeysResponse) FromJsonString(s string) error { 1157 return json.Unmarshal([]byte(s), &r) 1158} 1159 1160type DisableWhiteBoxKeyRequest struct { 1161 *tchttp.BaseRequest 1162 1163 // 白盒密钥的全局唯一标识符 1164 KeyId *string `json:"KeyId,omitempty" name:"KeyId"` 1165} 1166 1167func (r *DisableWhiteBoxKeyRequest) ToJsonString() string { 1168 b, _ := json.Marshal(r) 1169 return string(b) 1170} 1171 1172// FromJsonString It is highly **NOT** recommended to use this function 1173// because it has no param check, nor strict type check 1174func (r *DisableWhiteBoxKeyRequest) FromJsonString(s string) error { 1175 f := make(map[string]interface{}) 1176 if err := json.Unmarshal([]byte(s), &f); err != nil { 1177 return err 1178 } 1179 delete(f, "KeyId") 1180 if len(f) > 0 { 1181 return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DisableWhiteBoxKeyRequest has unknown keys!", "") 1182 } 1183 return json.Unmarshal([]byte(s), &r) 1184} 1185 1186type DisableWhiteBoxKeyResponse struct { 1187 *tchttp.BaseResponse 1188 Response *struct { 1189 1190 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 1191 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 1192 } `json:"Response"` 1193} 1194 1195func (r *DisableWhiteBoxKeyResponse) ToJsonString() string { 1196 b, _ := json.Marshal(r) 1197 return string(b) 1198} 1199 1200// FromJsonString It is highly **NOT** recommended to use this function 1201// because it has no param check, nor strict type check 1202func (r *DisableWhiteBoxKeyResponse) FromJsonString(s string) error { 1203 return json.Unmarshal([]byte(s), &r) 1204} 1205 1206type DisableWhiteBoxKeysRequest struct { 1207 *tchttp.BaseRequest 1208 1209 // 白盒密钥的全局唯一标识符列表。注意:要确保所有提供的KeyId是格式有效的,没有重复,个数不超过50个,并且都是有效存在的。 1210 KeyIds []*string `json:"KeyIds,omitempty" name:"KeyIds"` 1211} 1212 1213func (r *DisableWhiteBoxKeysRequest) ToJsonString() string { 1214 b, _ := json.Marshal(r) 1215 return string(b) 1216} 1217 1218// FromJsonString It is highly **NOT** recommended to use this function 1219// because it has no param check, nor strict type check 1220func (r *DisableWhiteBoxKeysRequest) FromJsonString(s string) error { 1221 f := make(map[string]interface{}) 1222 if err := json.Unmarshal([]byte(s), &f); err != nil { 1223 return err 1224 } 1225 delete(f, "KeyIds") 1226 if len(f) > 0 { 1227 return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DisableWhiteBoxKeysRequest has unknown keys!", "") 1228 } 1229 return json.Unmarshal([]byte(s), &r) 1230} 1231 1232type DisableWhiteBoxKeysResponse struct { 1233 *tchttp.BaseResponse 1234 Response *struct { 1235 1236 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 1237 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 1238 } `json:"Response"` 1239} 1240 1241func (r *DisableWhiteBoxKeysResponse) ToJsonString() string { 1242 b, _ := json.Marshal(r) 1243 return string(b) 1244} 1245 1246// FromJsonString It is highly **NOT** recommended to use this function 1247// because it has no param check, nor strict type check 1248func (r *DisableWhiteBoxKeysResponse) FromJsonString(s string) error { 1249 return json.Unmarshal([]byte(s), &r) 1250} 1251 1252type EnableKeyRequest struct { 1253 *tchttp.BaseRequest 1254 1255 // CMK唯一标识符 1256 KeyId *string `json:"KeyId,omitempty" name:"KeyId"` 1257} 1258 1259func (r *EnableKeyRequest) ToJsonString() string { 1260 b, _ := json.Marshal(r) 1261 return string(b) 1262} 1263 1264// FromJsonString It is highly **NOT** recommended to use this function 1265// because it has no param check, nor strict type check 1266func (r *EnableKeyRequest) FromJsonString(s string) error { 1267 f := make(map[string]interface{}) 1268 if err := json.Unmarshal([]byte(s), &f); err != nil { 1269 return err 1270 } 1271 delete(f, "KeyId") 1272 if len(f) > 0 { 1273 return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "EnableKeyRequest has unknown keys!", "") 1274 } 1275 return json.Unmarshal([]byte(s), &r) 1276} 1277 1278type EnableKeyResponse struct { 1279 *tchttp.BaseResponse 1280 Response *struct { 1281 1282 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 1283 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 1284 } `json:"Response"` 1285} 1286 1287func (r *EnableKeyResponse) ToJsonString() string { 1288 b, _ := json.Marshal(r) 1289 return string(b) 1290} 1291 1292// FromJsonString It is highly **NOT** recommended to use this function 1293// because it has no param check, nor strict type check 1294func (r *EnableKeyResponse) FromJsonString(s string) error { 1295 return json.Unmarshal([]byte(s), &r) 1296} 1297 1298type EnableKeyRotationRequest struct { 1299 *tchttp.BaseRequest 1300 1301 // CMK唯一标识符 1302 KeyId *string `json:"KeyId,omitempty" name:"KeyId"` 1303} 1304 1305func (r *EnableKeyRotationRequest) ToJsonString() string { 1306 b, _ := json.Marshal(r) 1307 return string(b) 1308} 1309 1310// FromJsonString It is highly **NOT** recommended to use this function 1311// because it has no param check, nor strict type check 1312func (r *EnableKeyRotationRequest) FromJsonString(s string) error { 1313 f := make(map[string]interface{}) 1314 if err := json.Unmarshal([]byte(s), &f); err != nil { 1315 return err 1316 } 1317 delete(f, "KeyId") 1318 if len(f) > 0 { 1319 return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "EnableKeyRotationRequest has unknown keys!", "") 1320 } 1321 return json.Unmarshal([]byte(s), &r) 1322} 1323 1324type EnableKeyRotationResponse struct { 1325 *tchttp.BaseResponse 1326 Response *struct { 1327 1328 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 1329 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 1330 } `json:"Response"` 1331} 1332 1333func (r *EnableKeyRotationResponse) ToJsonString() string { 1334 b, _ := json.Marshal(r) 1335 return string(b) 1336} 1337 1338// FromJsonString It is highly **NOT** recommended to use this function 1339// because it has no param check, nor strict type check 1340func (r *EnableKeyRotationResponse) FromJsonString(s string) error { 1341 return json.Unmarshal([]byte(s), &r) 1342} 1343 1344type EnableKeysRequest struct { 1345 *tchttp.BaseRequest 1346 1347 // 需要批量启用的CMK Id 列表, CMK数量最大支持100 1348 KeyIds []*string `json:"KeyIds,omitempty" name:"KeyIds"` 1349} 1350 1351func (r *EnableKeysRequest) ToJsonString() string { 1352 b, _ := json.Marshal(r) 1353 return string(b) 1354} 1355 1356// FromJsonString It is highly **NOT** recommended to use this function 1357// because it has no param check, nor strict type check 1358func (r *EnableKeysRequest) FromJsonString(s string) error { 1359 f := make(map[string]interface{}) 1360 if err := json.Unmarshal([]byte(s), &f); err != nil { 1361 return err 1362 } 1363 delete(f, "KeyIds") 1364 if len(f) > 0 { 1365 return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "EnableKeysRequest has unknown keys!", "") 1366 } 1367 return json.Unmarshal([]byte(s), &r) 1368} 1369 1370type EnableKeysResponse struct { 1371 *tchttp.BaseResponse 1372 Response *struct { 1373 1374 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 1375 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 1376 } `json:"Response"` 1377} 1378 1379func (r *EnableKeysResponse) ToJsonString() string { 1380 b, _ := json.Marshal(r) 1381 return string(b) 1382} 1383 1384// FromJsonString It is highly **NOT** recommended to use this function 1385// because it has no param check, nor strict type check 1386func (r *EnableKeysResponse) FromJsonString(s string) error { 1387 return json.Unmarshal([]byte(s), &r) 1388} 1389 1390type EnableWhiteBoxKeyRequest struct { 1391 *tchttp.BaseRequest 1392 1393 // 白盒密钥的全局唯一标识符 1394 KeyId *string `json:"KeyId,omitempty" name:"KeyId"` 1395} 1396 1397func (r *EnableWhiteBoxKeyRequest) ToJsonString() string { 1398 b, _ := json.Marshal(r) 1399 return string(b) 1400} 1401 1402// FromJsonString It is highly **NOT** recommended to use this function 1403// because it has no param check, nor strict type check 1404func (r *EnableWhiteBoxKeyRequest) FromJsonString(s string) error { 1405 f := make(map[string]interface{}) 1406 if err := json.Unmarshal([]byte(s), &f); err != nil { 1407 return err 1408 } 1409 delete(f, "KeyId") 1410 if len(f) > 0 { 1411 return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "EnableWhiteBoxKeyRequest has unknown keys!", "") 1412 } 1413 return json.Unmarshal([]byte(s), &r) 1414} 1415 1416type EnableWhiteBoxKeyResponse struct { 1417 *tchttp.BaseResponse 1418 Response *struct { 1419 1420 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 1421 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 1422 } `json:"Response"` 1423} 1424 1425func (r *EnableWhiteBoxKeyResponse) ToJsonString() string { 1426 b, _ := json.Marshal(r) 1427 return string(b) 1428} 1429 1430// FromJsonString It is highly **NOT** recommended to use this function 1431// because it has no param check, nor strict type check 1432func (r *EnableWhiteBoxKeyResponse) FromJsonString(s string) error { 1433 return json.Unmarshal([]byte(s), &r) 1434} 1435 1436type EnableWhiteBoxKeysRequest struct { 1437 *tchttp.BaseRequest 1438 1439 // 白盒密钥的全局唯一标识符列表。注意:要确保所有提供的KeyId是格式有效的,没有重复,个数不超过50个,并且都是有效存在的。 1440 KeyIds []*string `json:"KeyIds,omitempty" name:"KeyIds"` 1441} 1442 1443func (r *EnableWhiteBoxKeysRequest) ToJsonString() string { 1444 b, _ := json.Marshal(r) 1445 return string(b) 1446} 1447 1448// FromJsonString It is highly **NOT** recommended to use this function 1449// because it has no param check, nor strict type check 1450func (r *EnableWhiteBoxKeysRequest) FromJsonString(s string) error { 1451 f := make(map[string]interface{}) 1452 if err := json.Unmarshal([]byte(s), &f); err != nil { 1453 return err 1454 } 1455 delete(f, "KeyIds") 1456 if len(f) > 0 { 1457 return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "EnableWhiteBoxKeysRequest has unknown keys!", "") 1458 } 1459 return json.Unmarshal([]byte(s), &r) 1460} 1461 1462type EnableWhiteBoxKeysResponse struct { 1463 *tchttp.BaseResponse 1464 Response *struct { 1465 1466 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 1467 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 1468 } `json:"Response"` 1469} 1470 1471func (r *EnableWhiteBoxKeysResponse) ToJsonString() string { 1472 b, _ := json.Marshal(r) 1473 return string(b) 1474} 1475 1476// FromJsonString It is highly **NOT** recommended to use this function 1477// because it has no param check, nor strict type check 1478func (r *EnableWhiteBoxKeysResponse) FromJsonString(s string) error { 1479 return json.Unmarshal([]byte(s), &r) 1480} 1481 1482type EncryptByWhiteBoxRequest struct { 1483 *tchttp.BaseRequest 1484 1485 // 白盒密钥的全局唯一标识符 1486 KeyId *string `json:"KeyId,omitempty" name:"KeyId"` 1487 1488 // 待加密的文本, base64编码,文本的原始长度最大不超过4KB 1489 PlainText *string `json:"PlainText,omitempty" name:"PlainText"` 1490 1491 // 初始化向量,大小为 16 Bytes,加密算法会使用到, base64编码;如果不传,则由后端服务随机生成。用户需要自行保存该值,作为解密的参数。 1492 InitializationVector *string `json:"InitializationVector,omitempty" name:"InitializationVector"` 1493} 1494 1495func (r *EncryptByWhiteBoxRequest) ToJsonString() string { 1496 b, _ := json.Marshal(r) 1497 return string(b) 1498} 1499 1500// FromJsonString It is highly **NOT** recommended to use this function 1501// because it has no param check, nor strict type check 1502func (r *EncryptByWhiteBoxRequest) FromJsonString(s string) error { 1503 f := make(map[string]interface{}) 1504 if err := json.Unmarshal([]byte(s), &f); err != nil { 1505 return err 1506 } 1507 delete(f, "KeyId") 1508 delete(f, "PlainText") 1509 delete(f, "InitializationVector") 1510 if len(f) > 0 { 1511 return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "EncryptByWhiteBoxRequest has unknown keys!", "") 1512 } 1513 return json.Unmarshal([]byte(s), &r) 1514} 1515 1516type EncryptByWhiteBoxResponse struct { 1517 *tchttp.BaseResponse 1518 Response *struct { 1519 1520 // 初始化向量,加密算法会使用到, base64编码。如果由调用方在入参中传入,则原样返回。如果调用方没有传入,则后端服务随机生成,并返回 1521 InitializationVector *string `json:"InitializationVector,omitempty" name:"InitializationVector"` 1522 1523 // 加密后的密文,base64编码 1524 CipherText *string `json:"CipherText,omitempty" name:"CipherText"` 1525 1526 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 1527 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 1528 } `json:"Response"` 1529} 1530 1531func (r *EncryptByWhiteBoxResponse) ToJsonString() string { 1532 b, _ := json.Marshal(r) 1533 return string(b) 1534} 1535 1536// FromJsonString It is highly **NOT** recommended to use this function 1537// because it has no param check, nor strict type check 1538func (r *EncryptByWhiteBoxResponse) FromJsonString(s string) error { 1539 return json.Unmarshal([]byte(s), &r) 1540} 1541 1542type EncryptRequest struct { 1543 *tchttp.BaseRequest 1544 1545 // 调用CreateKey生成的CMK全局唯一标识符 1546 KeyId *string `json:"KeyId,omitempty" name:"KeyId"` 1547 1548 // 被加密的明文数据,该字段必须使用base64编码,原文最大长度支持4K 1549 Plaintext *string `json:"Plaintext,omitempty" name:"Plaintext"` 1550 1551 // key/value对的json字符串,如果指定了该参数,则在调用Decrypt API时需要提供同样的参数,最大支持1024个字符 1552 EncryptionContext *string `json:"EncryptionContext,omitempty" name:"EncryptionContext"` 1553} 1554 1555func (r *EncryptRequest) ToJsonString() string { 1556 b, _ := json.Marshal(r) 1557 return string(b) 1558} 1559 1560// FromJsonString It is highly **NOT** recommended to use this function 1561// because it has no param check, nor strict type check 1562func (r *EncryptRequest) FromJsonString(s string) error { 1563 f := make(map[string]interface{}) 1564 if err := json.Unmarshal([]byte(s), &f); err != nil { 1565 return err 1566 } 1567 delete(f, "KeyId") 1568 delete(f, "Plaintext") 1569 delete(f, "EncryptionContext") 1570 if len(f) > 0 { 1571 return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "EncryptRequest has unknown keys!", "") 1572 } 1573 return json.Unmarshal([]byte(s), &r) 1574} 1575 1576type EncryptResponse struct { 1577 *tchttp.BaseResponse 1578 Response *struct { 1579 1580 // 加密后的密文,base64编码。注意:本字段中打包了密文和密钥的相关信息,不是对明文的直接加密结果,只有将该字段作为Decrypt接口的输入参数,才可以解密出原文。 1581 CiphertextBlob *string `json:"CiphertextBlob,omitempty" name:"CiphertextBlob"` 1582 1583 // 加密使用的CMK的全局唯一标识 1584 KeyId *string `json:"KeyId,omitempty" name:"KeyId"` 1585 1586 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 1587 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 1588 } `json:"Response"` 1589} 1590 1591func (r *EncryptResponse) ToJsonString() string { 1592 b, _ := json.Marshal(r) 1593 return string(b) 1594} 1595 1596// FromJsonString It is highly **NOT** recommended to use this function 1597// because it has no param check, nor strict type check 1598func (r *EncryptResponse) FromJsonString(s string) error { 1599 return json.Unmarshal([]byte(s), &r) 1600} 1601 1602type GenerateDataKeyRequest struct { 1603 *tchttp.BaseRequest 1604 1605 // CMK全局唯一标识符 1606 KeyId *string `json:"KeyId,omitempty" name:"KeyId"` 1607 1608 // 指定生成Datakey的加密算法以及Datakey大小,AES_128或者AES_256。KeySpec 和 NumberOfBytes 必须指定一个 1609 KeySpec *string `json:"KeySpec,omitempty" name:"KeySpec"` 1610 1611 // 生成的DataKey的长度,同时指定NumberOfBytes和KeySpec时,以NumberOfBytes为准。最小值为1, 最大值为1024。KeySpec 和 NumberOfBytes 必须指定一个 1612 NumberOfBytes *uint64 `json:"NumberOfBytes,omitempty" name:"NumberOfBytes"` 1613 1614 // key/value对的json字符串,如果使用该字段,则返回的DataKey在解密时需要填入相同的字符串 1615 EncryptionContext *string `json:"EncryptionContext,omitempty" name:"EncryptionContext"` 1616} 1617 1618func (r *GenerateDataKeyRequest) ToJsonString() string { 1619 b, _ := json.Marshal(r) 1620 return string(b) 1621} 1622 1623// FromJsonString It is highly **NOT** recommended to use this function 1624// because it has no param check, nor strict type check 1625func (r *GenerateDataKeyRequest) FromJsonString(s string) error { 1626 f := make(map[string]interface{}) 1627 if err := json.Unmarshal([]byte(s), &f); err != nil { 1628 return err 1629 } 1630 delete(f, "KeyId") 1631 delete(f, "KeySpec") 1632 delete(f, "NumberOfBytes") 1633 delete(f, "EncryptionContext") 1634 if len(f) > 0 { 1635 return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "GenerateDataKeyRequest has unknown keys!", "") 1636 } 1637 return json.Unmarshal([]byte(s), &r) 1638} 1639 1640type GenerateDataKeyResponse struct { 1641 *tchttp.BaseResponse 1642 Response *struct { 1643 1644 // CMK的全局唯一标识 1645 KeyId *string `json:"KeyId,omitempty" name:"KeyId"` 1646 1647 // 生成的数据密钥DataKey的明文,该明文使用base64进行了编码,需base64解码后作为数据密钥本地使用 1648 Plaintext *string `json:"Plaintext,omitempty" name:"Plaintext"` 1649 1650 // 数据密钥DataKey加密后的密文,用户需要自行保存该密文,KMS不托管用户的数据密钥。可以通过Decrypt接口从CiphertextBlob中获取数据密钥DataKey明文 1651 CiphertextBlob *string `json:"CiphertextBlob,omitempty" name:"CiphertextBlob"` 1652 1653 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 1654 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 1655 } `json:"Response"` 1656} 1657 1658func (r *GenerateDataKeyResponse) ToJsonString() string { 1659 b, _ := json.Marshal(r) 1660 return string(b) 1661} 1662 1663// FromJsonString It is highly **NOT** recommended to use this function 1664// because it has no param check, nor strict type check 1665func (r *GenerateDataKeyResponse) FromJsonString(s string) error { 1666 return json.Unmarshal([]byte(s), &r) 1667} 1668 1669type GenerateRandomRequest struct { 1670 *tchttp.BaseRequest 1671 1672 // 生成的随机数的长度。最小值为1, 最大值为1024。 1673 NumberOfBytes *uint64 `json:"NumberOfBytes,omitempty" name:"NumberOfBytes"` 1674} 1675 1676func (r *GenerateRandomRequest) ToJsonString() string { 1677 b, _ := json.Marshal(r) 1678 return string(b) 1679} 1680 1681// FromJsonString It is highly **NOT** recommended to use this function 1682// because it has no param check, nor strict type check 1683func (r *GenerateRandomRequest) FromJsonString(s string) error { 1684 f := make(map[string]interface{}) 1685 if err := json.Unmarshal([]byte(s), &f); err != nil { 1686 return err 1687 } 1688 delete(f, "NumberOfBytes") 1689 if len(f) > 0 { 1690 return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "GenerateRandomRequest has unknown keys!", "") 1691 } 1692 return json.Unmarshal([]byte(s), &r) 1693} 1694 1695type GenerateRandomResponse struct { 1696 *tchttp.BaseResponse 1697 Response *struct { 1698 1699 // 生成的随机数的明文,该明文使用base64编码,用户需要使用base64解码得到明文。 1700 Plaintext *string `json:"Plaintext,omitempty" name:"Plaintext"` 1701 1702 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 1703 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 1704 } `json:"Response"` 1705} 1706 1707func (r *GenerateRandomResponse) ToJsonString() string { 1708 b, _ := json.Marshal(r) 1709 return string(b) 1710} 1711 1712// FromJsonString It is highly **NOT** recommended to use this function 1713// because it has no param check, nor strict type check 1714func (r *GenerateRandomResponse) FromJsonString(s string) error { 1715 return json.Unmarshal([]byte(s), &r) 1716} 1717 1718type GetKeyRotationStatusRequest struct { 1719 *tchttp.BaseRequest 1720 1721 // CMK唯一标识符 1722 KeyId *string `json:"KeyId,omitempty" name:"KeyId"` 1723} 1724 1725func (r *GetKeyRotationStatusRequest) ToJsonString() string { 1726 b, _ := json.Marshal(r) 1727 return string(b) 1728} 1729 1730// FromJsonString It is highly **NOT** recommended to use this function 1731// because it has no param check, nor strict type check 1732func (r *GetKeyRotationStatusRequest) FromJsonString(s string) error { 1733 f := make(map[string]interface{}) 1734 if err := json.Unmarshal([]byte(s), &f); err != nil { 1735 return err 1736 } 1737 delete(f, "KeyId") 1738 if len(f) > 0 { 1739 return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "GetKeyRotationStatusRequest has unknown keys!", "") 1740 } 1741 return json.Unmarshal([]byte(s), &r) 1742} 1743 1744type GetKeyRotationStatusResponse struct { 1745 *tchttp.BaseResponse 1746 Response *struct { 1747 1748 // 密钥轮换是否开启 1749 KeyRotationEnabled *bool `json:"KeyRotationEnabled,omitempty" name:"KeyRotationEnabled"` 1750 1751 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 1752 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 1753 } `json:"Response"` 1754} 1755 1756func (r *GetKeyRotationStatusResponse) ToJsonString() string { 1757 b, _ := json.Marshal(r) 1758 return string(b) 1759} 1760 1761// FromJsonString It is highly **NOT** recommended to use this function 1762// because it has no param check, nor strict type check 1763func (r *GetKeyRotationStatusResponse) FromJsonString(s string) error { 1764 return json.Unmarshal([]byte(s), &r) 1765} 1766 1767type GetParametersForImportRequest struct { 1768 *tchttp.BaseRequest 1769 1770 // CMK的唯一标识,获取密钥参数的CMK必须是EXTERNAL类型,即在CreateKey时指定Type=2 类型的CMK。 1771 KeyId *string `json:"KeyId,omitempty" name:"KeyId"` 1772 1773 // 指定加密密钥材料的算法,目前支持RSAES_PKCS1_V1_5、RSAES_OAEP_SHA_1、RSAES_OAEP_SHA_256 1774 WrappingAlgorithm *string `json:"WrappingAlgorithm,omitempty" name:"WrappingAlgorithm"` 1775 1776 // 指定加密密钥材料的类型,目前只支持RSA_2048 1777 WrappingKeySpec *string `json:"WrappingKeySpec,omitempty" name:"WrappingKeySpec"` 1778} 1779 1780func (r *GetParametersForImportRequest) ToJsonString() string { 1781 b, _ := json.Marshal(r) 1782 return string(b) 1783} 1784 1785// FromJsonString It is highly **NOT** recommended to use this function 1786// because it has no param check, nor strict type check 1787func (r *GetParametersForImportRequest) FromJsonString(s string) error { 1788 f := make(map[string]interface{}) 1789 if err := json.Unmarshal([]byte(s), &f); err != nil { 1790 return err 1791 } 1792 delete(f, "KeyId") 1793 delete(f, "WrappingAlgorithm") 1794 delete(f, "WrappingKeySpec") 1795 if len(f) > 0 { 1796 return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "GetParametersForImportRequest has unknown keys!", "") 1797 } 1798 return json.Unmarshal([]byte(s), &r) 1799} 1800 1801type GetParametersForImportResponse struct { 1802 *tchttp.BaseResponse 1803 Response *struct { 1804 1805 // CMK的唯一标识,用于指定目标导入密钥材料的CMK。 1806 KeyId *string `json:"KeyId,omitempty" name:"KeyId"` 1807 1808 // 导入密钥材料需要的token,用于作为 ImportKeyMaterial 的参数。 1809 ImportToken *string `json:"ImportToken,omitempty" name:"ImportToken"` 1810 1811 // 用于加密密钥材料的RSA公钥,base64编码。使用PublicKey base64解码后的公钥将导入密钥进行加密后作为 ImportKeyMaterial 的参数。 1812 PublicKey *string `json:"PublicKey,omitempty" name:"PublicKey"` 1813 1814 // 该导出token和公钥的有效期,超过该时间后无法导入,需要重新调用GetParametersForImport获取。 1815 ParametersValidTo *uint64 `json:"ParametersValidTo,omitempty" name:"ParametersValidTo"` 1816 1817 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 1818 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 1819 } `json:"Response"` 1820} 1821 1822func (r *GetParametersForImportResponse) ToJsonString() string { 1823 b, _ := json.Marshal(r) 1824 return string(b) 1825} 1826 1827// FromJsonString It is highly **NOT** recommended to use this function 1828// because it has no param check, nor strict type check 1829func (r *GetParametersForImportResponse) FromJsonString(s string) error { 1830 return json.Unmarshal([]byte(s), &r) 1831} 1832 1833type GetPublicKeyRequest struct { 1834 *tchttp.BaseRequest 1835 1836 // CMK的唯一标识。 1837 KeyId *string `json:"KeyId,omitempty" name:"KeyId"` 1838} 1839 1840func (r *GetPublicKeyRequest) ToJsonString() string { 1841 b, _ := json.Marshal(r) 1842 return string(b) 1843} 1844 1845// FromJsonString It is highly **NOT** recommended to use this function 1846// because it has no param check, nor strict type check 1847func (r *GetPublicKeyRequest) FromJsonString(s string) error { 1848 f := make(map[string]interface{}) 1849 if err := json.Unmarshal([]byte(s), &f); err != nil { 1850 return err 1851 } 1852 delete(f, "KeyId") 1853 if len(f) > 0 { 1854 return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "GetPublicKeyRequest has unknown keys!", "") 1855 } 1856 return json.Unmarshal([]byte(s), &r) 1857} 1858 1859type GetPublicKeyResponse struct { 1860 *tchttp.BaseResponse 1861 Response *struct { 1862 1863 // CMK的唯一标识。 1864 KeyId *string `json:"KeyId,omitempty" name:"KeyId"` 1865 1866 // 经过base64编码的公钥内容。 1867 PublicKey *string `json:"PublicKey,omitempty" name:"PublicKey"` 1868 1869 // PEM格式的公钥内容。 1870 PublicKeyPem *string `json:"PublicKeyPem,omitempty" name:"PublicKeyPem"` 1871 1872 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 1873 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 1874 } `json:"Response"` 1875} 1876 1877func (r *GetPublicKeyResponse) ToJsonString() string { 1878 b, _ := json.Marshal(r) 1879 return string(b) 1880} 1881 1882// FromJsonString It is highly **NOT** recommended to use this function 1883// because it has no param check, nor strict type check 1884func (r *GetPublicKeyResponse) FromJsonString(s string) error { 1885 return json.Unmarshal([]byte(s), &r) 1886} 1887 1888type GetRegionsRequest struct { 1889 *tchttp.BaseRequest 1890} 1891 1892func (r *GetRegionsRequest) ToJsonString() string { 1893 b, _ := json.Marshal(r) 1894 return string(b) 1895} 1896 1897// FromJsonString It is highly **NOT** recommended to use this function 1898// because it has no param check, nor strict type check 1899func (r *GetRegionsRequest) FromJsonString(s string) error { 1900 f := make(map[string]interface{}) 1901 if err := json.Unmarshal([]byte(s), &f); err != nil { 1902 return err 1903 } 1904 if len(f) > 0 { 1905 return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "GetRegionsRequest has unknown keys!", "") 1906 } 1907 return json.Unmarshal([]byte(s), &r) 1908} 1909 1910type GetRegionsResponse struct { 1911 *tchttp.BaseResponse 1912 Response *struct { 1913 1914 // 可用region列表 1915 // 注意:此字段可能返回 null,表示取不到有效值。 1916 Regions []*string `json:"Regions,omitempty" name:"Regions"` 1917 1918 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 1919 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 1920 } `json:"Response"` 1921} 1922 1923func (r *GetRegionsResponse) ToJsonString() string { 1924 b, _ := json.Marshal(r) 1925 return string(b) 1926} 1927 1928// FromJsonString It is highly **NOT** recommended to use this function 1929// because it has no param check, nor strict type check 1930func (r *GetRegionsResponse) FromJsonString(s string) error { 1931 return json.Unmarshal([]byte(s), &r) 1932} 1933 1934type GetServiceStatusRequest struct { 1935 *tchttp.BaseRequest 1936} 1937 1938func (r *GetServiceStatusRequest) ToJsonString() string { 1939 b, _ := json.Marshal(r) 1940 return string(b) 1941} 1942 1943// FromJsonString It is highly **NOT** recommended to use this function 1944// because it has no param check, nor strict type check 1945func (r *GetServiceStatusRequest) FromJsonString(s string) error { 1946 f := make(map[string]interface{}) 1947 if err := json.Unmarshal([]byte(s), &f); err != nil { 1948 return err 1949 } 1950 if len(f) > 0 { 1951 return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "GetServiceStatusRequest has unknown keys!", "") 1952 } 1953 return json.Unmarshal([]byte(s), &r) 1954} 1955 1956type GetServiceStatusResponse struct { 1957 *tchttp.BaseResponse 1958 Response *struct { 1959 1960 // KMS服务是否开通, true 表示已开通 1961 ServiceEnabled *bool `json:"ServiceEnabled,omitempty" name:"ServiceEnabled"` 1962 1963 // 服务不可用类型: 0-未购买,1-正常, 2-欠费停服, 3-资源释放 1964 // 注意:此字段可能返回 null,表示取不到有效值。 1965 InvalidType *int64 `json:"InvalidType,omitempty" name:"InvalidType"` 1966 1967 // 0-普通版,1-旗舰版 1968 UserLevel *uint64 `json:"UserLevel,omitempty" name:"UserLevel"` 1969 1970 // 旗舰版到期时间 1971 // 注意:此字段可能返回 null,表示取不到有效值。 1972 ProExpireTime *uint64 `json:"ProExpireTime,omitempty" name:"ProExpireTime"` 1973 1974 // 旗舰版是否自动续费:0-不自动续费,1-自动续费 1975 // 注意:此字段可能返回 null,表示取不到有效值。 1976 ProRenewFlag *uint64 `json:"ProRenewFlag,omitempty" name:"ProRenewFlag"` 1977 1978 // 旗舰版购买记录的唯一性标识。如果为开通旗舰版,则返回值为空 1979 // 注意:此字段可能返回 null,表示取不到有效值。 1980 ProResourceId *string `json:"ProResourceId,omitempty" name:"ProResourceId"` 1981 1982 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 1983 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 1984 } `json:"Response"` 1985} 1986 1987func (r *GetServiceStatusResponse) ToJsonString() string { 1988 b, _ := json.Marshal(r) 1989 return string(b) 1990} 1991 1992// FromJsonString It is highly **NOT** recommended to use this function 1993// because it has no param check, nor strict type check 1994func (r *GetServiceStatusResponse) FromJsonString(s string) error { 1995 return json.Unmarshal([]byte(s), &r) 1996} 1997 1998type ImportKeyMaterialRequest struct { 1999 *tchttp.BaseRequest 2000 2001 // 使用GetParametersForImport 返回的PublicKey加密后的密钥材料base64编码。对于国密版本region的KMS,导入的密钥材料长度要求为 128 bit,FIPS版本region的KMS, 导入的密钥材料长度要求为 256 bit。 2002 EncryptedKeyMaterial *string `json:"EncryptedKeyMaterial,omitempty" name:"EncryptedKeyMaterial"` 2003 2004 // 通过调用GetParametersForImport获得的导入令牌。 2005 ImportToken *string `json:"ImportToken,omitempty" name:"ImportToken"` 2006 2007 // 指定导入密钥材料的CMK,需要和GetParametersForImport 指定的CMK相同。 2008 KeyId *string `json:"KeyId,omitempty" name:"KeyId"` 2009 2010 // 密钥材料过期时间 unix 时间戳,不指定或者 0 表示密钥材料不会过期,若指定过期时间,需要大于当前时间点,最大支持 2147443200。 2011 ValidTo *uint64 `json:"ValidTo,omitempty" name:"ValidTo"` 2012} 2013 2014func (r *ImportKeyMaterialRequest) ToJsonString() string { 2015 b, _ := json.Marshal(r) 2016 return string(b) 2017} 2018 2019// FromJsonString It is highly **NOT** recommended to use this function 2020// because it has no param check, nor strict type check 2021func (r *ImportKeyMaterialRequest) FromJsonString(s string) error { 2022 f := make(map[string]interface{}) 2023 if err := json.Unmarshal([]byte(s), &f); err != nil { 2024 return err 2025 } 2026 delete(f, "EncryptedKeyMaterial") 2027 delete(f, "ImportToken") 2028 delete(f, "KeyId") 2029 delete(f, "ValidTo") 2030 if len(f) > 0 { 2031 return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ImportKeyMaterialRequest has unknown keys!", "") 2032 } 2033 return json.Unmarshal([]byte(s), &r) 2034} 2035 2036type ImportKeyMaterialResponse struct { 2037 *tchttp.BaseResponse 2038 Response *struct { 2039 2040 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 2041 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 2042 } `json:"Response"` 2043} 2044 2045func (r *ImportKeyMaterialResponse) ToJsonString() string { 2046 b, _ := json.Marshal(r) 2047 return string(b) 2048} 2049 2050// FromJsonString It is highly **NOT** recommended to use this function 2051// because it has no param check, nor strict type check 2052func (r *ImportKeyMaterialResponse) FromJsonString(s string) error { 2053 return json.Unmarshal([]byte(s), &r) 2054} 2055 2056type Key struct { 2057 2058 // CMK的全局唯一标识。 2059 KeyId *string `json:"KeyId,omitempty" name:"KeyId"` 2060} 2061 2062type KeyMetadata struct { 2063 2064 // CMK的全局唯一标识 2065 KeyId *string `json:"KeyId,omitempty" name:"KeyId"` 2066 2067 // 作为密钥更容易辨识,更容易被人看懂的别名 2068 Alias *string `json:"Alias,omitempty" name:"Alias"` 2069 2070 // 密钥创建时间 2071 CreateTime *uint64 `json:"CreateTime,omitempty" name:"CreateTime"` 2072 2073 // CMK的描述 2074 Description *string `json:"Description,omitempty" name:"Description"` 2075 2076 // CMK的状态, 取值为:Enabled | Disabled | PendingDelete | PendingImport | Archived 2077 KeyState *string `json:"KeyState,omitempty" name:"KeyState"` 2078 2079 // CMK用途,取值为: ENCRYPT_DECRYPT | ASYMMETRIC_DECRYPT_RSA_2048 | ASYMMETRIC_DECRYPT_SM2 | ASYMMETRIC_SIGN_VERIFY_SM2 | ASYMMETRIC_SIGN_VERIFY_RSA_2048 | ASYMMETRIC_SIGN_VERIFY_ECC 2080 KeyUsage *string `json:"KeyUsage,omitempty" name:"KeyUsage"` 2081 2082 // CMK类型,2 表示符合FIPS标准,4表示符合国密标准 2083 Type *int64 `json:"Type,omitempty" name:"Type"` 2084 2085 // 创建者 2086 CreatorUin *uint64 `json:"CreatorUin,omitempty" name:"CreatorUin"` 2087 2088 // 是否开启了密钥轮换功能 2089 KeyRotationEnabled *bool `json:"KeyRotationEnabled,omitempty" name:"KeyRotationEnabled"` 2090 2091 // CMK的创建者,用户创建的为 user,授权各云产品自动创建的为对应的产品名 2092 Owner *string `json:"Owner,omitempty" name:"Owner"` 2093 2094 // 在密钥轮换开启状态下,下次轮换的时间 2095 NextRotateTime *uint64 `json:"NextRotateTime,omitempty" name:"NextRotateTime"` 2096 2097 // 计划删除的时间 2098 // 注意:此字段可能返回 null,表示取不到有效值。 2099 DeletionDate *uint64 `json:"DeletionDate,omitempty" name:"DeletionDate"` 2100 2101 // CMK 密钥材料类型,由KMS创建的为: TENCENT_KMS, 由用户导入的类型为:EXTERNAL 2102 // 注意:此字段可能返回 null,表示取不到有效值。 2103 Origin *string `json:"Origin,omitempty" name:"Origin"` 2104 2105 // 在Origin为 EXTERNAL 时有效,表示密钥材料的有效日期, 0 表示不过期 2106 // 注意:此字段可能返回 null,表示取不到有效值。 2107 ValidTo *uint64 `json:"ValidTo,omitempty" name:"ValidTo"` 2108 2109 // 资源ID,格式:creatorUin/$creatorUin/$keyId 2110 ResourceId *string `json:"ResourceId,omitempty" name:"ResourceId"` 2111} 2112 2113type ListAlgorithmsRequest struct { 2114 *tchttp.BaseRequest 2115} 2116 2117func (r *ListAlgorithmsRequest) ToJsonString() string { 2118 b, _ := json.Marshal(r) 2119 return string(b) 2120} 2121 2122// FromJsonString It is highly **NOT** recommended to use this function 2123// because it has no param check, nor strict type check 2124func (r *ListAlgorithmsRequest) FromJsonString(s string) error { 2125 f := make(map[string]interface{}) 2126 if err := json.Unmarshal([]byte(s), &f); err != nil { 2127 return err 2128 } 2129 if len(f) > 0 { 2130 return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ListAlgorithmsRequest has unknown keys!", "") 2131 } 2132 return json.Unmarshal([]byte(s), &r) 2133} 2134 2135type ListAlgorithmsResponse struct { 2136 *tchttp.BaseResponse 2137 Response *struct { 2138 2139 // 本地区支持的对称加密算法 2140 SymmetricAlgorithms []*AlgorithmInfo `json:"SymmetricAlgorithms,omitempty" name:"SymmetricAlgorithms"` 2141 2142 // 本地区支持的非对称加密算法 2143 AsymmetricAlgorithms []*AlgorithmInfo `json:"AsymmetricAlgorithms,omitempty" name:"AsymmetricAlgorithms"` 2144 2145 // 本地区支持的非对称签名验签算法 2146 AsymmetricSignVerifyAlgorithms []*AlgorithmInfo `json:"AsymmetricSignVerifyAlgorithms,omitempty" name:"AsymmetricSignVerifyAlgorithms"` 2147 2148 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 2149 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 2150 } `json:"Response"` 2151} 2152 2153func (r *ListAlgorithmsResponse) ToJsonString() string { 2154 b, _ := json.Marshal(r) 2155 return string(b) 2156} 2157 2158// FromJsonString It is highly **NOT** recommended to use this function 2159// because it has no param check, nor strict type check 2160func (r *ListAlgorithmsResponse) FromJsonString(s string) error { 2161 return json.Unmarshal([]byte(s), &r) 2162} 2163 2164type ListKeyDetailRequest struct { 2165 *tchttp.BaseRequest 2166 2167 // 含义跟 SQL 查询的 Offset 一致,表示本次获取从按一定顺序排列数组的第 Offset 个元素开始,缺省为0 2168 Offset *uint64 `json:"Offset,omitempty" name:"Offset"` 2169 2170 // 含义跟 SQL 查询的 Limit 一致,表示本次最多获取 Limit 个元素。缺省值为10,最大值为200 2171 Limit *uint64 `json:"Limit,omitempty" name:"Limit"` 2172 2173 // 根据创建者角色筛选,默认 0 表示用户自己创建的cmk, 1 表示授权其它云产品自动创建的cmk 2174 Role *uint64 `json:"Role,omitempty" name:"Role"` 2175 2176 // 根据CMK创建时间排序, 0 表示按照降序排序,1表示按照升序排序 2177 OrderType *uint64 `json:"OrderType,omitempty" name:"OrderType"` 2178 2179 // 根据CMK状态筛选, 0表示全部CMK, 1 表示仅查询Enabled CMK, 2 表示仅查询Disabled CMK,3 表示查询PendingDelete 状态的CMK(处于计划删除状态的Key),4 表示查询 PendingImport 状态的CMK,5 表示查询 Archived 状态的 CMK 2180 KeyState *uint64 `json:"KeyState,omitempty" name:"KeyState"` 2181 2182 // 根据KeyId或者Alias进行模糊匹配查询 2183 SearchKeyAlias *string `json:"SearchKeyAlias,omitempty" name:"SearchKeyAlias"` 2184 2185 // 根据CMK类型筛选, "TENCENT_KMS" 表示筛选密钥材料由KMS创建的CMK, "EXTERNAL" 表示筛选密钥材料需要用户导入的 EXTERNAL类型CMK,"ALL" 或者不设置表示两种类型都查询,大小写敏感。 2186 Origin *string `json:"Origin,omitempty" name:"Origin"` 2187 2188 // 根据CMK的KeyUsage筛选,ALL表示筛选全部,可使用的参数为:ALL 或 ENCRYPT_DECRYPT 或 ASYMMETRIC_DECRYPT_RSA_2048 或 ASYMMETRIC_DECRYPT_SM2 或 ASYMMETRIC_SIGN_VERIFY_SM2 或 ASYMMETRIC_SIGN_VERIFY_RSA_2048 或 ASYMMETRIC_SIGN_VERIFY_ECC,为空则默认筛选ENCRYPT_DECRYPT类型 2189 KeyUsage *string `json:"KeyUsage,omitempty" name:"KeyUsage"` 2190 2191 // 标签过滤条件 2192 TagFilters []*TagFilter `json:"TagFilters,omitempty" name:"TagFilters"` 2193} 2194 2195func (r *ListKeyDetailRequest) ToJsonString() string { 2196 b, _ := json.Marshal(r) 2197 return string(b) 2198} 2199 2200// FromJsonString It is highly **NOT** recommended to use this function 2201// because it has no param check, nor strict type check 2202func (r *ListKeyDetailRequest) FromJsonString(s string) error { 2203 f := make(map[string]interface{}) 2204 if err := json.Unmarshal([]byte(s), &f); err != nil { 2205 return err 2206 } 2207 delete(f, "Offset") 2208 delete(f, "Limit") 2209 delete(f, "Role") 2210 delete(f, "OrderType") 2211 delete(f, "KeyState") 2212 delete(f, "SearchKeyAlias") 2213 delete(f, "Origin") 2214 delete(f, "KeyUsage") 2215 delete(f, "TagFilters") 2216 if len(f) > 0 { 2217 return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ListKeyDetailRequest has unknown keys!", "") 2218 } 2219 return json.Unmarshal([]byte(s), &r) 2220} 2221 2222type ListKeyDetailResponse struct { 2223 *tchttp.BaseResponse 2224 Response *struct { 2225 2226 // CMK的总数量 2227 TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` 2228 2229 // 返回的属性信息列表。 2230 // 注意:此字段可能返回 null,表示取不到有效值。 2231 KeyMetadatas []*KeyMetadata `json:"KeyMetadatas,omitempty" name:"KeyMetadatas"` 2232 2233 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 2234 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 2235 } `json:"Response"` 2236} 2237 2238func (r *ListKeyDetailResponse) ToJsonString() string { 2239 b, _ := json.Marshal(r) 2240 return string(b) 2241} 2242 2243// FromJsonString It is highly **NOT** recommended to use this function 2244// because it has no param check, nor strict type check 2245func (r *ListKeyDetailResponse) FromJsonString(s string) error { 2246 return json.Unmarshal([]byte(s), &r) 2247} 2248 2249type ListKeysRequest struct { 2250 *tchttp.BaseRequest 2251 2252 // 含义跟 SQL 查询的 Offset 一致,表示本次获取从按一定顺序排列数组的第 Offset 个元素开始,缺省为0 2253 Offset *uint64 `json:"Offset,omitempty" name:"Offset"` 2254 2255 // 含义跟 SQL 查询的 Limit 一致,表示本次获最多获取 Limit 个元素。缺省值为10,最大值为200 2256 Limit *uint64 `json:"Limit,omitempty" name:"Limit"` 2257 2258 // 根据创建者角色筛选,默认 0 表示用户自己创建的cmk, 1 表示授权其它云产品自动创建的cmk 2259 Role *uint64 `json:"Role,omitempty" name:"Role"` 2260} 2261 2262func (r *ListKeysRequest) ToJsonString() string { 2263 b, _ := json.Marshal(r) 2264 return string(b) 2265} 2266 2267// FromJsonString It is highly **NOT** recommended to use this function 2268// because it has no param check, nor strict type check 2269func (r *ListKeysRequest) FromJsonString(s string) error { 2270 f := make(map[string]interface{}) 2271 if err := json.Unmarshal([]byte(s), &f); err != nil { 2272 return err 2273 } 2274 delete(f, "Offset") 2275 delete(f, "Limit") 2276 delete(f, "Role") 2277 if len(f) > 0 { 2278 return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ListKeysRequest has unknown keys!", "") 2279 } 2280 return json.Unmarshal([]byte(s), &r) 2281} 2282 2283type ListKeysResponse struct { 2284 *tchttp.BaseResponse 2285 Response *struct { 2286 2287 // CMK列表数组 2288 // 注意:此字段可能返回 null,表示取不到有效值。 2289 Keys []*Key `json:"Keys,omitempty" name:"Keys"` 2290 2291 // CMK的总数量 2292 TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` 2293 2294 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 2295 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 2296 } `json:"Response"` 2297} 2298 2299func (r *ListKeysResponse) ToJsonString() string { 2300 b, _ := json.Marshal(r) 2301 return string(b) 2302} 2303 2304// FromJsonString It is highly **NOT** recommended to use this function 2305// because it has no param check, nor strict type check 2306func (r *ListKeysResponse) FromJsonString(s string) error { 2307 return json.Unmarshal([]byte(s), &r) 2308} 2309 2310type OverwriteWhiteBoxDeviceFingerprintsRequest struct { 2311 *tchttp.BaseRequest 2312 2313 // 白盒密钥ID 2314 KeyId *string `json:"KeyId,omitempty" name:"KeyId"` 2315 2316 // 设备指纹列表,如果列表为空,则表示删除该密钥对应的所有指纹信息。列表最大长度不超过200。 2317 DeviceFingerprints []*DeviceFingerprint `json:"DeviceFingerprints,omitempty" name:"DeviceFingerprints"` 2318} 2319 2320func (r *OverwriteWhiteBoxDeviceFingerprintsRequest) ToJsonString() string { 2321 b, _ := json.Marshal(r) 2322 return string(b) 2323} 2324 2325// FromJsonString It is highly **NOT** recommended to use this function 2326// because it has no param check, nor strict type check 2327func (r *OverwriteWhiteBoxDeviceFingerprintsRequest) FromJsonString(s string) error { 2328 f := make(map[string]interface{}) 2329 if err := json.Unmarshal([]byte(s), &f); err != nil { 2330 return err 2331 } 2332 delete(f, "KeyId") 2333 delete(f, "DeviceFingerprints") 2334 if len(f) > 0 { 2335 return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "OverwriteWhiteBoxDeviceFingerprintsRequest has unknown keys!", "") 2336 } 2337 return json.Unmarshal([]byte(s), &r) 2338} 2339 2340type OverwriteWhiteBoxDeviceFingerprintsResponse struct { 2341 *tchttp.BaseResponse 2342 Response *struct { 2343 2344 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 2345 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 2346 } `json:"Response"` 2347} 2348 2349func (r *OverwriteWhiteBoxDeviceFingerprintsResponse) ToJsonString() string { 2350 b, _ := json.Marshal(r) 2351 return string(b) 2352} 2353 2354// FromJsonString It is highly **NOT** recommended to use this function 2355// because it has no param check, nor strict type check 2356func (r *OverwriteWhiteBoxDeviceFingerprintsResponse) FromJsonString(s string) error { 2357 return json.Unmarshal([]byte(s), &r) 2358} 2359 2360type ReEncryptRequest struct { 2361 *tchttp.BaseRequest 2362 2363 // 需要重新加密的密文 2364 CiphertextBlob *string `json:"CiphertextBlob,omitempty" name:"CiphertextBlob"` 2365 2366 // 重新加密使用的CMK,如果为空,则使用密文原有的CMK重新加密(若密钥没有轮换则密文不会刷新) 2367 DestinationKeyId *string `json:"DestinationKeyId,omitempty" name:"DestinationKeyId"` 2368 2369 // CiphertextBlob 密文加密时使用的key/value对的json字符串。如果加密时未使用,则为空 2370 SourceEncryptionContext *string `json:"SourceEncryptionContext,omitempty" name:"SourceEncryptionContext"` 2371 2372 // 重新加密使用的key/value对的json字符串,如果使用该字段,则返回的新密文在解密时需要填入相同的字符串 2373 DestinationEncryptionContext *string `json:"DestinationEncryptionContext,omitempty" name:"DestinationEncryptionContext"` 2374} 2375 2376func (r *ReEncryptRequest) ToJsonString() string { 2377 b, _ := json.Marshal(r) 2378 return string(b) 2379} 2380 2381// FromJsonString It is highly **NOT** recommended to use this function 2382// because it has no param check, nor strict type check 2383func (r *ReEncryptRequest) FromJsonString(s string) error { 2384 f := make(map[string]interface{}) 2385 if err := json.Unmarshal([]byte(s), &f); err != nil { 2386 return err 2387 } 2388 delete(f, "CiphertextBlob") 2389 delete(f, "DestinationKeyId") 2390 delete(f, "SourceEncryptionContext") 2391 delete(f, "DestinationEncryptionContext") 2392 if len(f) > 0 { 2393 return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ReEncryptRequest has unknown keys!", "") 2394 } 2395 return json.Unmarshal([]byte(s), &r) 2396} 2397 2398type ReEncryptResponse struct { 2399 *tchttp.BaseResponse 2400 Response *struct { 2401 2402 // 重新加密后的密文 2403 CiphertextBlob *string `json:"CiphertextBlob,omitempty" name:"CiphertextBlob"` 2404 2405 // 重新加密使用的CMK 2406 KeyId *string `json:"KeyId,omitempty" name:"KeyId"` 2407 2408 // 重新加密前密文使用的CMK 2409 SourceKeyId *string `json:"SourceKeyId,omitempty" name:"SourceKeyId"` 2410 2411 // true表示密文已经重新加密。同一个CMK进行重加密,在密钥没有发生轮换的情况下不会进行实际重新加密操作,返回原密文 2412 ReEncrypted *bool `json:"ReEncrypted,omitempty" name:"ReEncrypted"` 2413 2414 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 2415 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 2416 } `json:"Response"` 2417} 2418 2419func (r *ReEncryptResponse) ToJsonString() string { 2420 b, _ := json.Marshal(r) 2421 return string(b) 2422} 2423 2424// FromJsonString It is highly **NOT** recommended to use this function 2425// because it has no param check, nor strict type check 2426func (r *ReEncryptResponse) FromJsonString(s string) error { 2427 return json.Unmarshal([]byte(s), &r) 2428} 2429 2430type ScheduleKeyDeletionRequest struct { 2431 *tchttp.BaseRequest 2432 2433 // CMK的唯一标志 2434 KeyId *string `json:"KeyId,omitempty" name:"KeyId"` 2435 2436 // 计划删除时间区间[7,30] 2437 PendingWindowInDays *uint64 `json:"PendingWindowInDays,omitempty" name:"PendingWindowInDays"` 2438} 2439 2440func (r *ScheduleKeyDeletionRequest) ToJsonString() string { 2441 b, _ := json.Marshal(r) 2442 return string(b) 2443} 2444 2445// FromJsonString It is highly **NOT** recommended to use this function 2446// because it has no param check, nor strict type check 2447func (r *ScheduleKeyDeletionRequest) FromJsonString(s string) error { 2448 f := make(map[string]interface{}) 2449 if err := json.Unmarshal([]byte(s), &f); err != nil { 2450 return err 2451 } 2452 delete(f, "KeyId") 2453 delete(f, "PendingWindowInDays") 2454 if len(f) > 0 { 2455 return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ScheduleKeyDeletionRequest has unknown keys!", "") 2456 } 2457 return json.Unmarshal([]byte(s), &r) 2458} 2459 2460type ScheduleKeyDeletionResponse struct { 2461 *tchttp.BaseResponse 2462 Response *struct { 2463 2464 // 计划删除执行时间 2465 DeletionDate *uint64 `json:"DeletionDate,omitempty" name:"DeletionDate"` 2466 2467 // 唯一标志被计划删除的CMK 2468 KeyId *string `json:"KeyId,omitempty" name:"KeyId"` 2469 2470 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 2471 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 2472 } `json:"Response"` 2473} 2474 2475func (r *ScheduleKeyDeletionResponse) ToJsonString() string { 2476 b, _ := json.Marshal(r) 2477 return string(b) 2478} 2479 2480// FromJsonString It is highly **NOT** recommended to use this function 2481// because it has no param check, nor strict type check 2482func (r *ScheduleKeyDeletionResponse) FromJsonString(s string) error { 2483 return json.Unmarshal([]byte(s), &r) 2484} 2485 2486type SignByAsymmetricKeyRequest struct { 2487 *tchttp.BaseRequest 2488 2489 // 签名算法,支持的算法:SM2DSA,ECC_P256_R1,RSA_PSS_SHA_256,RSA_PKCS1_SHA_256 2490 Algorithm *string `json:"Algorithm,omitempty" name:"Algorithm"` 2491 2492 // 消息原文或消息摘要。如果提供的是消息原文,则消息原文的长度(Base64编码前的长度)不超过4096字节。如果提供的是消息摘要,消息摘要长度(Base64编码前的长度)必须等于32字节 2493 Message *string `json:"Message,omitempty" name:"Message"` 2494 2495 // 密钥的唯一标识 2496 KeyId *string `json:"KeyId,omitempty" name:"KeyId"` 2497 2498 // 消息类型:RAW,DIGEST,如果不传,默认为RAW,表示消息原文。 2499 MessageType *string `json:"MessageType,omitempty" name:"MessageType"` 2500} 2501 2502func (r *SignByAsymmetricKeyRequest) ToJsonString() string { 2503 b, _ := json.Marshal(r) 2504 return string(b) 2505} 2506 2507// FromJsonString It is highly **NOT** recommended to use this function 2508// because it has no param check, nor strict type check 2509func (r *SignByAsymmetricKeyRequest) FromJsonString(s string) error { 2510 f := make(map[string]interface{}) 2511 if err := json.Unmarshal([]byte(s), &f); err != nil { 2512 return err 2513 } 2514 delete(f, "Algorithm") 2515 delete(f, "Message") 2516 delete(f, "KeyId") 2517 delete(f, "MessageType") 2518 if len(f) > 0 { 2519 return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "SignByAsymmetricKeyRequest has unknown keys!", "") 2520 } 2521 return json.Unmarshal([]byte(s), &r) 2522} 2523 2524type SignByAsymmetricKeyResponse struct { 2525 *tchttp.BaseResponse 2526 Response *struct { 2527 2528 // 签名,Base64编码 2529 Signature *string `json:"Signature,omitempty" name:"Signature"` 2530 2531 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 2532 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 2533 } `json:"Response"` 2534} 2535 2536func (r *SignByAsymmetricKeyResponse) ToJsonString() string { 2537 b, _ := json.Marshal(r) 2538 return string(b) 2539} 2540 2541// FromJsonString It is highly **NOT** recommended to use this function 2542// because it has no param check, nor strict type check 2543func (r *SignByAsymmetricKeyResponse) FromJsonString(s string) error { 2544 return json.Unmarshal([]byte(s), &r) 2545} 2546 2547type Tag struct { 2548 2549 // 标签键 2550 TagKey *string `json:"TagKey,omitempty" name:"TagKey"` 2551 2552 // 标签值 2553 TagValue *string `json:"TagValue,omitempty" name:"TagValue"` 2554} 2555 2556type TagFilter struct { 2557 2558 // 标签键 2559 TagKey *string `json:"TagKey,omitempty" name:"TagKey"` 2560 2561 // 标签值 2562 TagValue []*string `json:"TagValue,omitempty" name:"TagValue"` 2563} 2564 2565type UnbindCloudResourceRequest struct { 2566 *tchttp.BaseRequest 2567 2568 // cmk的ID 2569 KeyId *string `json:"KeyId,omitempty" name:"KeyId"` 2570 2571 // 云产品的唯一性标识符 2572 ProductId *string `json:"ProductId,omitempty" name:"ProductId"` 2573 2574 // 资源/实例ID,由调用方根据自己的云产品特征来定义,以字符串形式做存储。 2575 ResourceId *string `json:"ResourceId,omitempty" name:"ResourceId"` 2576} 2577 2578func (r *UnbindCloudResourceRequest) ToJsonString() string { 2579 b, _ := json.Marshal(r) 2580 return string(b) 2581} 2582 2583// FromJsonString It is highly **NOT** recommended to use this function 2584// because it has no param check, nor strict type check 2585func (r *UnbindCloudResourceRequest) FromJsonString(s string) error { 2586 f := make(map[string]interface{}) 2587 if err := json.Unmarshal([]byte(s), &f); err != nil { 2588 return err 2589 } 2590 delete(f, "KeyId") 2591 delete(f, "ProductId") 2592 delete(f, "ResourceId") 2593 if len(f) > 0 { 2594 return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "UnbindCloudResourceRequest has unknown keys!", "") 2595 } 2596 return json.Unmarshal([]byte(s), &r) 2597} 2598 2599type UnbindCloudResourceResponse struct { 2600 *tchttp.BaseResponse 2601 Response *struct { 2602 2603 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 2604 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 2605 } `json:"Response"` 2606} 2607 2608func (r *UnbindCloudResourceResponse) ToJsonString() string { 2609 b, _ := json.Marshal(r) 2610 return string(b) 2611} 2612 2613// FromJsonString It is highly **NOT** recommended to use this function 2614// because it has no param check, nor strict type check 2615func (r *UnbindCloudResourceResponse) FromJsonString(s string) error { 2616 return json.Unmarshal([]byte(s), &r) 2617} 2618 2619type UpdateAliasRequest struct { 2620 *tchttp.BaseRequest 2621 2622 // 新的别名,1-60个字符或数字的组合 2623 Alias *string `json:"Alias,omitempty" name:"Alias"` 2624 2625 // CMK的全局唯一标识符 2626 KeyId *string `json:"KeyId,omitempty" name:"KeyId"` 2627} 2628 2629func (r *UpdateAliasRequest) ToJsonString() string { 2630 b, _ := json.Marshal(r) 2631 return string(b) 2632} 2633 2634// FromJsonString It is highly **NOT** recommended to use this function 2635// because it has no param check, nor strict type check 2636func (r *UpdateAliasRequest) FromJsonString(s string) error { 2637 f := make(map[string]interface{}) 2638 if err := json.Unmarshal([]byte(s), &f); err != nil { 2639 return err 2640 } 2641 delete(f, "Alias") 2642 delete(f, "KeyId") 2643 if len(f) > 0 { 2644 return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "UpdateAliasRequest has unknown keys!", "") 2645 } 2646 return json.Unmarshal([]byte(s), &r) 2647} 2648 2649type UpdateAliasResponse struct { 2650 *tchttp.BaseResponse 2651 Response *struct { 2652 2653 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 2654 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 2655 } `json:"Response"` 2656} 2657 2658func (r *UpdateAliasResponse) ToJsonString() string { 2659 b, _ := json.Marshal(r) 2660 return string(b) 2661} 2662 2663// FromJsonString It is highly **NOT** recommended to use this function 2664// because it has no param check, nor strict type check 2665func (r *UpdateAliasResponse) FromJsonString(s string) error { 2666 return json.Unmarshal([]byte(s), &r) 2667} 2668 2669type UpdateKeyDescriptionRequest struct { 2670 *tchttp.BaseRequest 2671 2672 // 新的描述信息,最大支持1024字节 2673 Description *string `json:"Description,omitempty" name:"Description"` 2674 2675 // 需要修改描述信息的CMK ID 2676 KeyId *string `json:"KeyId,omitempty" name:"KeyId"` 2677} 2678 2679func (r *UpdateKeyDescriptionRequest) ToJsonString() string { 2680 b, _ := json.Marshal(r) 2681 return string(b) 2682} 2683 2684// FromJsonString It is highly **NOT** recommended to use this function 2685// because it has no param check, nor strict type check 2686func (r *UpdateKeyDescriptionRequest) FromJsonString(s string) error { 2687 f := make(map[string]interface{}) 2688 if err := json.Unmarshal([]byte(s), &f); err != nil { 2689 return err 2690 } 2691 delete(f, "Description") 2692 delete(f, "KeyId") 2693 if len(f) > 0 { 2694 return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "UpdateKeyDescriptionRequest has unknown keys!", "") 2695 } 2696 return json.Unmarshal([]byte(s), &r) 2697} 2698 2699type UpdateKeyDescriptionResponse struct { 2700 *tchttp.BaseResponse 2701 Response *struct { 2702 2703 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 2704 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 2705 } `json:"Response"` 2706} 2707 2708func (r *UpdateKeyDescriptionResponse) ToJsonString() string { 2709 b, _ := json.Marshal(r) 2710 return string(b) 2711} 2712 2713// FromJsonString It is highly **NOT** recommended to use this function 2714// because it has no param check, nor strict type check 2715func (r *UpdateKeyDescriptionResponse) FromJsonString(s string) error { 2716 return json.Unmarshal([]byte(s), &r) 2717} 2718 2719type VerifyByAsymmetricKeyRequest struct { 2720 *tchttp.BaseRequest 2721 2722 // 密钥的唯一标识 2723 KeyId *string `json:"KeyId,omitempty" name:"KeyId"` 2724 2725 // 签名值,通过调用KMS签名接口生成 2726 SignatureValue *string `json:"SignatureValue,omitempty" name:"SignatureValue"` 2727 2728 // 消息原文或消息摘要。如果提供的是消息原文,则消息原文的长度(Base64编码前的长度)不超过4096字节。如果提供的是消息摘要,则消息摘要长度(Base64编码前的长度)必须等于32字节 2729 Message *string `json:"Message,omitempty" name:"Message"` 2730 2731 // 签名算法,支持的算法:SM2DSA,ECC_P256_R1,RSA_PSS_SHA_256,RSA_PKCS1_SHA_256 2732 Algorithm *string `json:"Algorithm,omitempty" name:"Algorithm"` 2733 2734 // 消息类型:RAW,DIGEST,如果不传,默认为RAW,表示消息原文。 2735 MessageType *string `json:"MessageType,omitempty" name:"MessageType"` 2736} 2737 2738func (r *VerifyByAsymmetricKeyRequest) ToJsonString() string { 2739 b, _ := json.Marshal(r) 2740 return string(b) 2741} 2742 2743// FromJsonString It is highly **NOT** recommended to use this function 2744// because it has no param check, nor strict type check 2745func (r *VerifyByAsymmetricKeyRequest) FromJsonString(s string) error { 2746 f := make(map[string]interface{}) 2747 if err := json.Unmarshal([]byte(s), &f); err != nil { 2748 return err 2749 } 2750 delete(f, "KeyId") 2751 delete(f, "SignatureValue") 2752 delete(f, "Message") 2753 delete(f, "Algorithm") 2754 delete(f, "MessageType") 2755 if len(f) > 0 { 2756 return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "VerifyByAsymmetricKeyRequest has unknown keys!", "") 2757 } 2758 return json.Unmarshal([]byte(s), &r) 2759} 2760 2761type VerifyByAsymmetricKeyResponse struct { 2762 *tchttp.BaseResponse 2763 Response *struct { 2764 2765 // 签名是否有效。true:签名有效,false:签名无效。 2766 SignatureValid *bool `json:"SignatureValid,omitempty" name:"SignatureValid"` 2767 2768 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 2769 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 2770 } `json:"Response"` 2771} 2772 2773func (r *VerifyByAsymmetricKeyResponse) ToJsonString() string { 2774 b, _ := json.Marshal(r) 2775 return string(b) 2776} 2777 2778// FromJsonString It is highly **NOT** recommended to use this function 2779// because it has no param check, nor strict type check 2780func (r *VerifyByAsymmetricKeyResponse) FromJsonString(s string) error { 2781 return json.Unmarshal([]byte(s), &r) 2782} 2783 2784type WhiteboxKeyInfo struct { 2785 2786 // 白盒密钥的全局唯一标识符 2787 KeyId *string `json:"KeyId,omitempty" name:"KeyId"` 2788 2789 // 作为密钥更容易辨识,更容易被人看懂的别名, 不可为空,1-60个字母数字 - _ 的组合,首字符必须为字母或者数字. 不可重复 2790 Alias *string `json:"Alias,omitempty" name:"Alias"` 2791 2792 // 创建者 2793 CreatorUin *uint64 `json:"CreatorUin,omitempty" name:"CreatorUin"` 2794 2795 // 密钥的描述信息 2796 Description *string `json:"Description,omitempty" name:"Description"` 2797 2798 // 密钥创建时间,Unix时间戳 2799 CreateTime *uint64 `json:"CreateTime,omitempty" name:"CreateTime"` 2800 2801 // 白盒密钥的状态, 取值为:Enabled | Disabled 2802 Status *string `json:"Status,omitempty" name:"Status"` 2803 2804 // 创建者 2805 OwnerUin *uint64 `json:"OwnerUin,omitempty" name:"OwnerUin"` 2806 2807 // 密钥所用的算法类型 2808 Algorithm *string `json:"Algorithm,omitempty" name:"Algorithm"` 2809 2810 // 白盒加密密钥,base64编码 2811 EncryptKey *string `json:"EncryptKey,omitempty" name:"EncryptKey"` 2812 2813 // 白盒解密密钥,base64编码 2814 DecryptKey *string `json:"DecryptKey,omitempty" name:"DecryptKey"` 2815 2816 // 资源ID,格式:creatorUin/$creatorUin/$keyId 2817 ResourceId *string `json:"ResourceId,omitempty" name:"ResourceId"` 2818 2819 // 是否有设备指纹与当前密钥绑定 2820 // 注意:此字段可能返回 null,表示取不到有效值。 2821 DeviceFingerprintBind *bool `json:"DeviceFingerprintBind,omitempty" name:"DeviceFingerprintBind"` 2822} 2823