-
Notifications
You must be signed in to change notification settings - Fork 194
/
models.go
3728 lines (2992 loc) · 143 KB
/
models.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package v20190118
import (
tcerr "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/errors"
tchttp "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/http"
"github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/json"
)
type AlgorithmInfo struct {
// 算法的标识
KeyUsage *string `json:"KeyUsage,omitnil,omitempty" name:"KeyUsage"`
// 算法的名称
Algorithm *string `json:"Algorithm,omitnil,omitempty" name:"Algorithm"`
}
// Predefined struct for user
type ArchiveKeyRequestParams struct {
// CMK唯一标识符
KeyId *string `json:"KeyId,omitnil,omitempty" name:"KeyId"`
}
type ArchiveKeyRequest struct {
*tchttp.BaseRequest
// CMK唯一标识符
KeyId *string `json:"KeyId,omitnil,omitempty" name:"KeyId"`
}
func (r *ArchiveKeyRequest) ToJsonString() string {
b, _ := json.Marshal(r)
return string(b)
}
// FromJsonString It is highly **NOT** recommended to use this function
// because it has no param check, nor strict type check
func (r *ArchiveKeyRequest) FromJsonString(s string) error {
f := make(map[string]interface{})
if err := json.Unmarshal([]byte(s), &f); err != nil {
return err
}
delete(f, "KeyId")
if len(f) > 0 {
return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ArchiveKeyRequest has unknown keys!", "")
}
return json.Unmarshal([]byte(s), &r)
}
// Predefined struct for user
type ArchiveKeyResponseParams struct {
// 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。
RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"`
}
type ArchiveKeyResponse struct {
*tchttp.BaseResponse
Response *ArchiveKeyResponseParams `json:"Response"`
}
func (r *ArchiveKeyResponse) ToJsonString() string {
b, _ := json.Marshal(r)
return string(b)
}
// FromJsonString It is highly **NOT** recommended to use this function
// because it has no param check, nor strict type check
func (r *ArchiveKeyResponse) FromJsonString(s string) error {
return json.Unmarshal([]byte(s), &r)
}
// Predefined struct for user
type AsymmetricRsaDecryptRequestParams struct {
// CMK的唯一标识
KeyId *string `json:"KeyId,omitnil,omitempty" name:"KeyId"`
// 使用PublicKey加密的密文,Base64编码
Ciphertext *string `json:"Ciphertext,omitnil,omitempty" name:"Ciphertext"`
// 在使用公钥加密时对应的算法:当前支持RSAES_PKCS1_V1_5、RSAES_OAEP_SHA_1、RSAES_OAEP_SHA_256
Algorithm *string `json:"Algorithm,omitnil,omitempty" name:"Algorithm"`
}
type AsymmetricRsaDecryptRequest struct {
*tchttp.BaseRequest
// CMK的唯一标识
KeyId *string `json:"KeyId,omitnil,omitempty" name:"KeyId"`
// 使用PublicKey加密的密文,Base64编码
Ciphertext *string `json:"Ciphertext,omitnil,omitempty" name:"Ciphertext"`
// 在使用公钥加密时对应的算法:当前支持RSAES_PKCS1_V1_5、RSAES_OAEP_SHA_1、RSAES_OAEP_SHA_256
Algorithm *string `json:"Algorithm,omitnil,omitempty" name:"Algorithm"`
}
func (r *AsymmetricRsaDecryptRequest) ToJsonString() string {
b, _ := json.Marshal(r)
return string(b)
}
// FromJsonString It is highly **NOT** recommended to use this function
// because it has no param check, nor strict type check
func (r *AsymmetricRsaDecryptRequest) FromJsonString(s string) error {
f := make(map[string]interface{})
if err := json.Unmarshal([]byte(s), &f); err != nil {
return err
}
delete(f, "KeyId")
delete(f, "Ciphertext")
delete(f, "Algorithm")
if len(f) > 0 {
return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "AsymmetricRsaDecryptRequest has unknown keys!", "")
}
return json.Unmarshal([]byte(s), &r)
}
// Predefined struct for user
type AsymmetricRsaDecryptResponseParams struct {
// CMK的唯一标识
KeyId *string `json:"KeyId,omitnil,omitempty" name:"KeyId"`
// 解密后的明文,base64编码
Plaintext *string `json:"Plaintext,omitnil,omitempty" name:"Plaintext"`
// 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。
RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"`
}
type AsymmetricRsaDecryptResponse struct {
*tchttp.BaseResponse
Response *AsymmetricRsaDecryptResponseParams `json:"Response"`
}
func (r *AsymmetricRsaDecryptResponse) ToJsonString() string {
b, _ := json.Marshal(r)
return string(b)
}
// FromJsonString It is highly **NOT** recommended to use this function
// because it has no param check, nor strict type check
func (r *AsymmetricRsaDecryptResponse) FromJsonString(s string) error {
return json.Unmarshal([]byte(s), &r)
}
// Predefined struct for user
type AsymmetricSm2DecryptRequestParams struct {
// CMK的唯一标识
KeyId *string `json:"KeyId,omitnil,omitempty" name:"KeyId"`
// 使用PublicKey加密的密文,Base64编码,原始密文格式需要为C1C3C2_ASN1。原始密文长度不能超过256字节。
Ciphertext *string `json:"Ciphertext,omitnil,omitempty" name:"Ciphertext"`
}
type AsymmetricSm2DecryptRequest struct {
*tchttp.BaseRequest
// CMK的唯一标识
KeyId *string `json:"KeyId,omitnil,omitempty" name:"KeyId"`
// 使用PublicKey加密的密文,Base64编码,原始密文格式需要为C1C3C2_ASN1。原始密文长度不能超过256字节。
Ciphertext *string `json:"Ciphertext,omitnil,omitempty" name:"Ciphertext"`
}
func (r *AsymmetricSm2DecryptRequest) ToJsonString() string {
b, _ := json.Marshal(r)
return string(b)
}
// FromJsonString It is highly **NOT** recommended to use this function
// because it has no param check, nor strict type check
func (r *AsymmetricSm2DecryptRequest) FromJsonString(s string) error {
f := make(map[string]interface{})
if err := json.Unmarshal([]byte(s), &f); err != nil {
return err
}
delete(f, "KeyId")
delete(f, "Ciphertext")
if len(f) > 0 {
return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "AsymmetricSm2DecryptRequest has unknown keys!", "")
}
return json.Unmarshal([]byte(s), &r)
}
// Predefined struct for user
type AsymmetricSm2DecryptResponseParams struct {
// CMK的唯一标识
KeyId *string `json:"KeyId,omitnil,omitempty" name:"KeyId"`
// 解密后的明文,base64编码
Plaintext *string `json:"Plaintext,omitnil,omitempty" name:"Plaintext"`
// 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。
RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"`
}
type AsymmetricSm2DecryptResponse struct {
*tchttp.BaseResponse
Response *AsymmetricSm2DecryptResponseParams `json:"Response"`
}
func (r *AsymmetricSm2DecryptResponse) ToJsonString() string {
b, _ := json.Marshal(r)
return string(b)
}
// FromJsonString It is highly **NOT** recommended to use this function
// because it has no param check, nor strict type check
func (r *AsymmetricSm2DecryptResponse) FromJsonString(s string) error {
return json.Unmarshal([]byte(s), &r)
}
// Predefined struct for user
type BindCloudResourceRequestParams struct {
// cmk的ID
KeyId *string `json:"KeyId,omitnil,omitempty" name:"KeyId"`
// 云产品的唯一性标识符
ProductId *string `json:"ProductId,omitnil,omitempty" name:"ProductId"`
// 资源/实例ID,由调用方根据自己的云产品特征来定义,以字符串形式做存储。
ResourceId *string `json:"ResourceId,omitnil,omitempty" name:"ResourceId"`
}
type BindCloudResourceRequest struct {
*tchttp.BaseRequest
// cmk的ID
KeyId *string `json:"KeyId,omitnil,omitempty" name:"KeyId"`
// 云产品的唯一性标识符
ProductId *string `json:"ProductId,omitnil,omitempty" name:"ProductId"`
// 资源/实例ID,由调用方根据自己的云产品特征来定义,以字符串形式做存储。
ResourceId *string `json:"ResourceId,omitnil,omitempty" name:"ResourceId"`
}
func (r *BindCloudResourceRequest) ToJsonString() string {
b, _ := json.Marshal(r)
return string(b)
}
// FromJsonString It is highly **NOT** recommended to use this function
// because it has no param check, nor strict type check
func (r *BindCloudResourceRequest) FromJsonString(s string) error {
f := make(map[string]interface{})
if err := json.Unmarshal([]byte(s), &f); err != nil {
return err
}
delete(f, "KeyId")
delete(f, "ProductId")
delete(f, "ResourceId")
if len(f) > 0 {
return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "BindCloudResourceRequest has unknown keys!", "")
}
return json.Unmarshal([]byte(s), &r)
}
// Predefined struct for user
type BindCloudResourceResponseParams struct {
// 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。
RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"`
}
type BindCloudResourceResponse struct {
*tchttp.BaseResponse
Response *BindCloudResourceResponseParams `json:"Response"`
}
func (r *BindCloudResourceResponse) ToJsonString() string {
b, _ := json.Marshal(r)
return string(b)
}
// FromJsonString It is highly **NOT** recommended to use this function
// because it has no param check, nor strict type check
func (r *BindCloudResourceResponse) FromJsonString(s string) error {
return json.Unmarshal([]byte(s), &r)
}
// Predefined struct for user
type CancelKeyArchiveRequestParams struct {
// CMK唯一标识符
KeyId *string `json:"KeyId,omitnil,omitempty" name:"KeyId"`
}
type CancelKeyArchiveRequest struct {
*tchttp.BaseRequest
// CMK唯一标识符
KeyId *string `json:"KeyId,omitnil,omitempty" name:"KeyId"`
}
func (r *CancelKeyArchiveRequest) ToJsonString() string {
b, _ := json.Marshal(r)
return string(b)
}
// FromJsonString It is highly **NOT** recommended to use this function
// because it has no param check, nor strict type check
func (r *CancelKeyArchiveRequest) FromJsonString(s string) error {
f := make(map[string]interface{})
if err := json.Unmarshal([]byte(s), &f); err != nil {
return err
}
delete(f, "KeyId")
if len(f) > 0 {
return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CancelKeyArchiveRequest has unknown keys!", "")
}
return json.Unmarshal([]byte(s), &r)
}
// Predefined struct for user
type CancelKeyArchiveResponseParams struct {
// 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。
RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"`
}
type CancelKeyArchiveResponse struct {
*tchttp.BaseResponse
Response *CancelKeyArchiveResponseParams `json:"Response"`
}
func (r *CancelKeyArchiveResponse) ToJsonString() string {
b, _ := json.Marshal(r)
return string(b)
}
// FromJsonString It is highly **NOT** recommended to use this function
// because it has no param check, nor strict type check
func (r *CancelKeyArchiveResponse) FromJsonString(s string) error {
return json.Unmarshal([]byte(s), &r)
}
// Predefined struct for user
type CancelKeyDeletionRequestParams struct {
// 需要被取消删除的CMK的唯一标志
KeyId *string `json:"KeyId,omitnil,omitempty" name:"KeyId"`
}
type CancelKeyDeletionRequest struct {
*tchttp.BaseRequest
// 需要被取消删除的CMK的唯一标志
KeyId *string `json:"KeyId,omitnil,omitempty" name:"KeyId"`
}
func (r *CancelKeyDeletionRequest) ToJsonString() string {
b, _ := json.Marshal(r)
return string(b)
}
// FromJsonString It is highly **NOT** recommended to use this function
// because it has no param check, nor strict type check
func (r *CancelKeyDeletionRequest) FromJsonString(s string) error {
f := make(map[string]interface{})
if err := json.Unmarshal([]byte(s), &f); err != nil {
return err
}
delete(f, "KeyId")
if len(f) > 0 {
return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CancelKeyDeletionRequest has unknown keys!", "")
}
return json.Unmarshal([]byte(s), &r)
}
// Predefined struct for user
type CancelKeyDeletionResponseParams struct {
// 唯一标志被取消删除的CMK。
KeyId *string `json:"KeyId,omitnil,omitempty" name:"KeyId"`
// 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。
RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"`
}
type CancelKeyDeletionResponse struct {
*tchttp.BaseResponse
Response *CancelKeyDeletionResponseParams `json:"Response"`
}
func (r *CancelKeyDeletionResponse) ToJsonString() string {
b, _ := json.Marshal(r)
return string(b)
}
// FromJsonString It is highly **NOT** recommended to use this function
// because it has no param check, nor strict type check
func (r *CancelKeyDeletionResponse) FromJsonString(s string) error {
return json.Unmarshal([]byte(s), &r)
}
// Predefined struct for user
type CreateKeyRequestParams struct {
// 作为密钥更容易辨识,更容易被人看懂的别名, 不可为空,1-60个字母数字 - _ 的组合,首字符必须为字母或者数字。以 kms- 作为前缀的用于云产品使用,Alias 不可重复。
Alias *string `json:"Alias,omitnil,omitempty" name:"Alias"`
// CMK 的描述,最大1024字节
Description *string `json:"Description,omitnil,omitempty" name:"Description"`
// 指定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非对称密钥,“ASYMMETRIC_SIGN_VERIFY_ECDSA384”表示创建用于签名验签的 ECDSA384 非对称秘钥。完整的秘钥用途与算法支持列表可通过 ListAlgorithms 接口获取。
KeyUsage *string `json:"KeyUsage,omitnil,omitempty" name:"KeyUsage"`
// 指定key类型,默认为1,1表示默认类型,由KMS创建CMK密钥,2 表示EXTERNAL 类型,该类型需要用户导入密钥材料,参考 GetParametersForImport 和 ImportKeyMaterial 接口
Type *uint64 `json:"Type,omitnil,omitempty" name:"Type"`
// 标签列表
Tags []*Tag `json:"Tags,omitnil,omitempty" name:"Tags"`
// KMS 高级版对应的 HSM 集群 ID(仅对 KMS 独占版/托管版服务实例有效)。
HsmClusterId *string `json:"HsmClusterId,omitnil,omitempty" name:"HsmClusterId"`
}
type CreateKeyRequest struct {
*tchttp.BaseRequest
// 作为密钥更容易辨识,更容易被人看懂的别名, 不可为空,1-60个字母数字 - _ 的组合,首字符必须为字母或者数字。以 kms- 作为前缀的用于云产品使用,Alias 不可重复。
Alias *string `json:"Alias,omitnil,omitempty" name:"Alias"`
// CMK 的描述,最大1024字节
Description *string `json:"Description,omitnil,omitempty" name:"Description"`
// 指定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非对称密钥,“ASYMMETRIC_SIGN_VERIFY_ECDSA384”表示创建用于签名验签的 ECDSA384 非对称秘钥。完整的秘钥用途与算法支持列表可通过 ListAlgorithms 接口获取。
KeyUsage *string `json:"KeyUsage,omitnil,omitempty" name:"KeyUsage"`
// 指定key类型,默认为1,1表示默认类型,由KMS创建CMK密钥,2 表示EXTERNAL 类型,该类型需要用户导入密钥材料,参考 GetParametersForImport 和 ImportKeyMaterial 接口
Type *uint64 `json:"Type,omitnil,omitempty" name:"Type"`
// 标签列表
Tags []*Tag `json:"Tags,omitnil,omitempty" name:"Tags"`
// KMS 高级版对应的 HSM 集群 ID(仅对 KMS 独占版/托管版服务实例有效)。
HsmClusterId *string `json:"HsmClusterId,omitnil,omitempty" name:"HsmClusterId"`
}
func (r *CreateKeyRequest) ToJsonString() string {
b, _ := json.Marshal(r)
return string(b)
}
// FromJsonString It is highly **NOT** recommended to use this function
// because it has no param check, nor strict type check
func (r *CreateKeyRequest) FromJsonString(s string) error {
f := make(map[string]interface{})
if err := json.Unmarshal([]byte(s), &f); err != nil {
return err
}
delete(f, "Alias")
delete(f, "Description")
delete(f, "KeyUsage")
delete(f, "Type")
delete(f, "Tags")
delete(f, "HsmClusterId")
if len(f) > 0 {
return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateKeyRequest has unknown keys!", "")
}
return json.Unmarshal([]byte(s), &r)
}
// Predefined struct for user
type CreateKeyResponseParams struct {
// CMK的全局唯一标识符
KeyId *string `json:"KeyId,omitnil,omitempty" name:"KeyId"`
// 作为密钥更容易辨识,更容易被人看懂的别名
Alias *string `json:"Alias,omitnil,omitempty" name:"Alias"`
// 密钥创建时间,unix时间戳
CreateTime *uint64 `json:"CreateTime,omitnil,omitempty" name:"CreateTime"`
// CMK的描述
// 注意:此字段可能返回 null,表示取不到有效值。
Description *string `json:"Description,omitnil,omitempty" name:"Description"`
// CMK的状态
KeyState *string `json:"KeyState,omitnil,omitempty" name:"KeyState"`
// CMK的用途
KeyUsage *string `json:"KeyUsage,omitnil,omitempty" name:"KeyUsage"`
// 标签操作的返回码. 0: 成功;1: 内部错误;2: 业务处理错误
// 注意:此字段可能返回 null,表示取不到有效值。
TagCode *uint64 `json:"TagCode,omitnil,omitempty" name:"TagCode"`
// 标签操作的返回信息
// 注意:此字段可能返回 null,表示取不到有效值。
TagMsg *string `json:"TagMsg,omitnil,omitempty" name:"TagMsg"`
// HSM 集群 ID(仅对 KMS 独占版/托管版服务实例有效)
// 注意:此字段可能返回 null,表示取不到有效值。
HsmClusterId *string `json:"HsmClusterId,omitnil,omitempty" name:"HsmClusterId"`
// 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。
RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"`
}
type CreateKeyResponse struct {
*tchttp.BaseResponse
Response *CreateKeyResponseParams `json:"Response"`
}
func (r *CreateKeyResponse) ToJsonString() string {
b, _ := json.Marshal(r)
return string(b)
}
// FromJsonString It is highly **NOT** recommended to use this function
// because it has no param check, nor strict type check
func (r *CreateKeyResponse) FromJsonString(s string) error {
return json.Unmarshal([]byte(s), &r)
}
// Predefined struct for user
type CreateWhiteBoxKeyRequestParams struct {
// 作为密钥更容易辨识,更容易被人看懂的别名, 不可为空,1-60个字母数字 - _ 的组合,首字符必须为字母或者数字。Alias不可重复。
Alias *string `json:"Alias,omitnil,omitempty" name:"Alias"`
// 创建密钥所有的算法类型,支持的取值:AES_256,SM4
Algorithm *string `json:"Algorithm,omitnil,omitempty" name:"Algorithm"`
// 密钥的描述,最大1024字节
Description *string `json:"Description,omitnil,omitempty" name:"Description"`
// 标签列表
Tags []*Tag `json:"Tags,omitnil,omitempty" name:"Tags"`
}
type CreateWhiteBoxKeyRequest struct {
*tchttp.BaseRequest
// 作为密钥更容易辨识,更容易被人看懂的别名, 不可为空,1-60个字母数字 - _ 的组合,首字符必须为字母或者数字。Alias不可重复。
Alias *string `json:"Alias,omitnil,omitempty" name:"Alias"`
// 创建密钥所有的算法类型,支持的取值:AES_256,SM4
Algorithm *string `json:"Algorithm,omitnil,omitempty" name:"Algorithm"`
// 密钥的描述,最大1024字节
Description *string `json:"Description,omitnil,omitempty" name:"Description"`
// 标签列表
Tags []*Tag `json:"Tags,omitnil,omitempty" name:"Tags"`
}
func (r *CreateWhiteBoxKeyRequest) ToJsonString() string {
b, _ := json.Marshal(r)
return string(b)
}
// FromJsonString It is highly **NOT** recommended to use this function
// because it has no param check, nor strict type check
func (r *CreateWhiteBoxKeyRequest) FromJsonString(s string) error {
f := make(map[string]interface{})
if err := json.Unmarshal([]byte(s), &f); err != nil {
return err
}
delete(f, "Alias")
delete(f, "Algorithm")
delete(f, "Description")
delete(f, "Tags")
if len(f) > 0 {
return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateWhiteBoxKeyRequest has unknown keys!", "")
}
return json.Unmarshal([]byte(s), &r)
}
// Predefined struct for user
type CreateWhiteBoxKeyResponseParams struct {
// 用于加密的密钥,base64编码
EncryptKey *string `json:"EncryptKey,omitnil,omitempty" name:"EncryptKey"`
// 用于解密的密钥,base64编码
DecryptKey *string `json:"DecryptKey,omitnil,omitempty" name:"DecryptKey"`
// 白盒密钥的全局唯一标识符
KeyId *string `json:"KeyId,omitnil,omitempty" name:"KeyId"`
// 标签操作的返回码. 0: 成功;1: 内部错误;2: 业务处理错误
// 注意:此字段可能返回 null,表示取不到有效值。
TagCode *uint64 `json:"TagCode,omitnil,omitempty" name:"TagCode"`
// 标签操作的返回信息
// 注意:此字段可能返回 null,表示取不到有效值。
TagMsg *string `json:"TagMsg,omitnil,omitempty" name:"TagMsg"`
// 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。
RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"`
}
type CreateWhiteBoxKeyResponse struct {
*tchttp.BaseResponse
Response *CreateWhiteBoxKeyResponseParams `json:"Response"`
}
func (r *CreateWhiteBoxKeyResponse) ToJsonString() string {
b, _ := json.Marshal(r)
return string(b)
}
// FromJsonString It is highly **NOT** recommended to use this function
// because it has no param check, nor strict type check
func (r *CreateWhiteBoxKeyResponse) FromJsonString(s string) error {
return json.Unmarshal([]byte(s), &r)
}
// Predefined struct for user
type DecryptRequestParams struct {
// 待解密的密文数据
CiphertextBlob *string `json:"CiphertextBlob,omitnil,omitempty" name:"CiphertextBlob"`
// key/value对的json字符串,如果Encrypt指定了该参数,则在调用Decrypt API时需要提供同样的参数,最大支持1024字符
EncryptionContext *string `json:"EncryptionContext,omitnil,omitempty" name:"EncryptionContext"`
// PEM 格式公钥字符串,支持 RSA2048 和 SM2 公钥,用于对返回数据中的 Plaintext 值进行加密。若为空,则不对 Plaintext 值加密。
EncryptionPublicKey *string `json:"EncryptionPublicKey,omitnil,omitempty" name:"EncryptionPublicKey"`
// 非对称加密算法,配合 EncryptionPublicKey 对返回数据进行加密。目前支持:SM2(以 C1C3C2 格式返回密文),SM2_C1C3C2_ASN1 (以 C1C3C2 ASN1 格式返回密文),RSAES_PKCS1_V1_5,RSAES_OAEP_SHA_1,RSAES_OAEP_SHA_256。若为空,则默认为 SM2。
EncryptionAlgorithm *string `json:"EncryptionAlgorithm,omitnil,omitempty" name:"EncryptionAlgorithm"`
}
type DecryptRequest struct {
*tchttp.BaseRequest
// 待解密的密文数据
CiphertextBlob *string `json:"CiphertextBlob,omitnil,omitempty" name:"CiphertextBlob"`
// key/value对的json字符串,如果Encrypt指定了该参数,则在调用Decrypt API时需要提供同样的参数,最大支持1024字符
EncryptionContext *string `json:"EncryptionContext,omitnil,omitempty" name:"EncryptionContext"`
// PEM 格式公钥字符串,支持 RSA2048 和 SM2 公钥,用于对返回数据中的 Plaintext 值进行加密。若为空,则不对 Plaintext 值加密。
EncryptionPublicKey *string `json:"EncryptionPublicKey,omitnil,omitempty" name:"EncryptionPublicKey"`
// 非对称加密算法,配合 EncryptionPublicKey 对返回数据进行加密。目前支持:SM2(以 C1C3C2 格式返回密文),SM2_C1C3C2_ASN1 (以 C1C3C2 ASN1 格式返回密文),RSAES_PKCS1_V1_5,RSAES_OAEP_SHA_1,RSAES_OAEP_SHA_256。若为空,则默认为 SM2。
EncryptionAlgorithm *string `json:"EncryptionAlgorithm,omitnil,omitempty" name:"EncryptionAlgorithm"`
}
func (r *DecryptRequest) ToJsonString() string {
b, _ := json.Marshal(r)
return string(b)
}
// FromJsonString It is highly **NOT** recommended to use this function
// because it has no param check, nor strict type check
func (r *DecryptRequest) FromJsonString(s string) error {
f := make(map[string]interface{})
if err := json.Unmarshal([]byte(s), &f); err != nil {
return err
}
delete(f, "CiphertextBlob")
delete(f, "EncryptionContext")
delete(f, "EncryptionPublicKey")
delete(f, "EncryptionAlgorithm")
if len(f) > 0 {
return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DecryptRequest has unknown keys!", "")
}
return json.Unmarshal([]byte(s), &r)
}
// Predefined struct for user
type DecryptResponseParams struct {
// CMK的全局唯一标识
KeyId *string `json:"KeyId,omitnil,omitempty" name:"KeyId"`
// 若调用时未提供 EncryptionPublicKey,该字段值为 Base64 编码的明文,需进行 Base64 解码以获取明文。
// 若调用时提供了 EncryptionPublicKey,则该字段值为使用 EncryptionPublicKey 公钥进行非对称加密后的 Base64 编码的密文。需在 Base64 解码后,使用用户上传的公钥对应的私钥进行进一步解密,以获取明文。
Plaintext *string `json:"Plaintext,omitnil,omitempty" name:"Plaintext"`
// 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。
RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"`
}
type DecryptResponse struct {
*tchttp.BaseResponse
Response *DecryptResponseParams `json:"Response"`
}
func (r *DecryptResponse) ToJsonString() string {
b, _ := json.Marshal(r)
return string(b)
}
// FromJsonString It is highly **NOT** recommended to use this function
// because it has no param check, nor strict type check
func (r *DecryptResponse) FromJsonString(s string) error {
return json.Unmarshal([]byte(s), &r)
}
// Predefined struct for user
type DeleteImportedKeyMaterialRequestParams struct {
// 指定需要删除密钥材料的EXTERNAL CMK。
KeyId *string `json:"KeyId,omitnil,omitempty" name:"KeyId"`
}
type DeleteImportedKeyMaterialRequest struct {
*tchttp.BaseRequest
// 指定需要删除密钥材料的EXTERNAL CMK。
KeyId *string `json:"KeyId,omitnil,omitempty" name:"KeyId"`
}
func (r *DeleteImportedKeyMaterialRequest) ToJsonString() string {
b, _ := json.Marshal(r)
return string(b)
}
// FromJsonString It is highly **NOT** recommended to use this function
// because it has no param check, nor strict type check
func (r *DeleteImportedKeyMaterialRequest) FromJsonString(s string) error {
f := make(map[string]interface{})
if err := json.Unmarshal([]byte(s), &f); err != nil {
return err
}
delete(f, "KeyId")
if len(f) > 0 {
return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteImportedKeyMaterialRequest has unknown keys!", "")
}
return json.Unmarshal([]byte(s), &r)
}
// Predefined struct for user
type DeleteImportedKeyMaterialResponseParams struct {
// 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。
RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"`
}
type DeleteImportedKeyMaterialResponse struct {
*tchttp.BaseResponse
Response *DeleteImportedKeyMaterialResponseParams `json:"Response"`
}
func (r *DeleteImportedKeyMaterialResponse) ToJsonString() string {
b, _ := json.Marshal(r)
return string(b)
}
// FromJsonString It is highly **NOT** recommended to use this function
// because it has no param check, nor strict type check
func (r *DeleteImportedKeyMaterialResponse) FromJsonString(s string) error {
return json.Unmarshal([]byte(s), &r)
}
// Predefined struct for user
type DeleteWhiteBoxKeyRequestParams struct {
// 白盒密钥的全局唯一标识符
KeyId *string `json:"KeyId,omitnil,omitempty" name:"KeyId"`
}
type DeleteWhiteBoxKeyRequest struct {
*tchttp.BaseRequest
// 白盒密钥的全局唯一标识符
KeyId *string `json:"KeyId,omitnil,omitempty" name:"KeyId"`
}
func (r *DeleteWhiteBoxKeyRequest) ToJsonString() string {
b, _ := json.Marshal(r)
return string(b)
}
// FromJsonString It is highly **NOT** recommended to use this function
// because it has no param check, nor strict type check
func (r *DeleteWhiteBoxKeyRequest) FromJsonString(s string) error {
f := make(map[string]interface{})
if err := json.Unmarshal([]byte(s), &f); err != nil {
return err
}
delete(f, "KeyId")
if len(f) > 0 {
return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteWhiteBoxKeyRequest has unknown keys!", "")
}
return json.Unmarshal([]byte(s), &r)
}
// Predefined struct for user
type DeleteWhiteBoxKeyResponseParams struct {
// 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。
RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"`
}
type DeleteWhiteBoxKeyResponse struct {
*tchttp.BaseResponse
Response *DeleteWhiteBoxKeyResponseParams `json:"Response"`
}
func (r *DeleteWhiteBoxKeyResponse) ToJsonString() string {
b, _ := json.Marshal(r)
return string(b)
}
// FromJsonString It is highly **NOT** recommended to use this function
// because it has no param check, nor strict type check
func (r *DeleteWhiteBoxKeyResponse) FromJsonString(s string) error {
return json.Unmarshal([]byte(s), &r)
}
// Predefined struct for user
type DescribeKeyRequestParams struct {
// CMK全局唯一标识符
KeyId *string `json:"KeyId,omitnil,omitempty" name:"KeyId"`
}
type DescribeKeyRequest struct {
*tchttp.BaseRequest
// CMK全局唯一标识符
KeyId *string `json:"KeyId,omitnil,omitempty" name:"KeyId"`
}
func (r *DescribeKeyRequest) ToJsonString() string {
b, _ := json.Marshal(r)
return string(b)
}
// FromJsonString It is highly **NOT** recommended to use this function
// because it has no param check, nor strict type check
func (r *DescribeKeyRequest) FromJsonString(s string) error {
f := make(map[string]interface{})
if err := json.Unmarshal([]byte(s), &f); err != nil {
return err
}
delete(f, "KeyId")
if len(f) > 0 {
return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeKeyRequest has unknown keys!", "")
}
return json.Unmarshal([]byte(s), &r)
}
// Predefined struct for user
type DescribeKeyResponseParams struct {
// 密钥属性信息
// 注意:此字段可能返回 null,表示取不到有效值。
KeyMetadata *KeyMetadata `json:"KeyMetadata,omitnil,omitempty" name:"KeyMetadata"`
// 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。
RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"`
}
type DescribeKeyResponse struct {
*tchttp.BaseResponse
Response *DescribeKeyResponseParams `json:"Response"`
}
func (r *DescribeKeyResponse) ToJsonString() string {
b, _ := json.Marshal(r)
return string(b)
}
// FromJsonString It is highly **NOT** recommended to use this function
// because it has no param check, nor strict type check
func (r *DescribeKeyResponse) FromJsonString(s string) error {
return json.Unmarshal([]byte(s), &r)
}
// Predefined struct for user
type DescribeKeysRequestParams struct {
// 查询CMK的ID列表,批量查询一次最多支持100个KeyId
KeyIds []*string `json:"KeyIds,omitnil,omitempty" name:"KeyIds"`
}
type DescribeKeysRequest struct {
*tchttp.BaseRequest
// 查询CMK的ID列表,批量查询一次最多支持100个KeyId
KeyIds []*string `json:"KeyIds,omitnil,omitempty" name:"KeyIds"`
}
func (r *DescribeKeysRequest) ToJsonString() string {
b, _ := json.Marshal(r)
return string(b)
}
// FromJsonString It is highly **NOT** recommended to use this function
// because it has no param check, nor strict type check
func (r *DescribeKeysRequest) FromJsonString(s string) error {
f := make(map[string]interface{})
if err := json.Unmarshal([]byte(s), &f); err != nil {
return err
}
delete(f, "KeyIds")
if len(f) > 0 {
return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeKeysRequest has unknown keys!", "")
}
return json.Unmarshal([]byte(s), &r)
}
// Predefined struct for user
type DescribeKeysResponseParams struct {
// 返回的属性信息列表
// 注意:此字段可能返回 null,表示取不到有效值。
KeyMetadatas []*KeyMetadata `json:"KeyMetadatas,omitnil,omitempty" name:"KeyMetadatas"`
// 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。
RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"`
}
type DescribeKeysResponse struct {
*tchttp.BaseResponse
Response *DescribeKeysResponseParams `json:"Response"`
}
func (r *DescribeKeysResponse) ToJsonString() string {
b, _ := json.Marshal(r)
return string(b)
}
// FromJsonString It is highly **NOT** recommended to use this function
// because it has no param check, nor strict type check
func (r *DescribeKeysResponse) FromJsonString(s string) error {
return json.Unmarshal([]byte(s), &r)
}
// Predefined struct for user
type DescribeWhiteBoxDecryptKeyRequestParams struct {
// 白盒密钥的全局唯一标识符
KeyId *string `json:"KeyId,omitnil,omitempty" name:"KeyId"`
}
type DescribeWhiteBoxDecryptKeyRequest struct {
*tchttp.BaseRequest
// 白盒密钥的全局唯一标识符
KeyId *string `json:"KeyId,omitnil,omitempty" name:"KeyId"`
}
func (r *DescribeWhiteBoxDecryptKeyRequest) ToJsonString() string {
b, _ := json.Marshal(r)
return string(b)
}
// FromJsonString It is highly **NOT** recommended to use this function
// because it has no param check, nor strict type check
func (r *DescribeWhiteBoxDecryptKeyRequest) FromJsonString(s string) error {
f := make(map[string]interface{})
if err := json.Unmarshal([]byte(s), &f); err != nil {
return err
}
delete(f, "KeyId")
if len(f) > 0 {
return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeWhiteBoxDecryptKeyRequest has unknown keys!", "")
}
return json.Unmarshal([]byte(s), &r)
}
// Predefined struct for user
type DescribeWhiteBoxDecryptKeyResponseParams struct {
// 白盒解密密钥,base64编码
DecryptKey *string `json:"DecryptKey,omitnil,omitempty" name:"DecryptKey"`
// 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。
RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"`
}
type DescribeWhiteBoxDecryptKeyResponse struct {
*tchttp.BaseResponse
Response *DescribeWhiteBoxDecryptKeyResponseParams `json:"Response"`
}
func (r *DescribeWhiteBoxDecryptKeyResponse) ToJsonString() string {
b, _ := json.Marshal(r)
return string(b)
}
// FromJsonString It is highly **NOT** recommended to use this function
// because it has no param check, nor strict type check
func (r *DescribeWhiteBoxDecryptKeyResponse) FromJsonString(s string) error {
return json.Unmarshal([]byte(s), &r)
}
// Predefined struct for user
type DescribeWhiteBoxDeviceFingerprintsRequestParams struct {
// 白盒密钥ID
KeyId *string `json:"KeyId,omitnil,omitempty" name:"KeyId"`
}
type DescribeWhiteBoxDeviceFingerprintsRequest struct {
*tchttp.BaseRequest
// 白盒密钥ID
KeyId *string `json:"KeyId,omitnil,omitempty" name:"KeyId"`
}
func (r *DescribeWhiteBoxDeviceFingerprintsRequest) ToJsonString() string {
b, _ := json.Marshal(r)
return string(b)
}
// FromJsonString It is highly **NOT** recommended to use this function
// because it has no param check, nor strict type check
func (r *DescribeWhiteBoxDeviceFingerprintsRequest) FromJsonString(s string) error {