@ucloud-sdks/ucloud-sdk-js 0.2.19 → 0.2.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1184 @@
1
+ import Client from '../../core/client';
2
+ import { ConfigOptions } from '../../core/config';
3
+ import { CredentialOptions } from '../../core/credential';
4
+ /**
5
+ * This client is used to call actions of **ukms** service
6
+ */
7
+ export default class UKMSClient extends Client {
8
+ constructor({ config, credential, }: {
9
+ config: ConfigOptions;
10
+ credential: CredentialOptions;
11
+ });
12
+ /**
13
+ * CancelKeyDeletion - 取消计划删除中的密钥。
14
+ *
15
+ * See also: https://docs.ucloud.cn/api/ukms-api/cancel_key_deletion
16
+ */
17
+ cancelKeyDeletion(request?: CancelKeyDeletionRequest): Promise<CancelKeyDeletionResponse>;
18
+ /**
19
+ * CancelScheduleKeyDeletion - 取消计划删除密钥
20
+ *
21
+ * See also: https://docs.ucloud.cn/api/ukms-api/cancel_schedule_key_deletion
22
+ */
23
+ cancelScheduleKeyDeletion(request?: CancelScheduleKeyDeletionRequest): Promise<CancelScheduleKeyDeletionResponse>;
24
+ /**
25
+ * CreateAlias - 为密钥创建别名。
26
+ *
27
+ * See also: https://docs.ucloud.cn/api/ukms-api/create_alias
28
+ */
29
+ createAlias(request?: CreateAliasRequest): Promise<CreateAliasResponse>;
30
+ /**
31
+ * CreateKey - 创建密钥。
32
+ *
33
+ * See also: https://docs.ucloud.cn/api/ukms-api/create_key
34
+ */
35
+ createKey(request?: CreateKeyRequest): Promise<CreateKeyResponse>;
36
+ /**
37
+ * Decrypt - 您可以使用此操作解密使用对称加密 KMS 密钥或非对称加密 KMS 密钥加密的密文。当 KMS 密钥为非对称密钥时,您必须指定用于加密密文的 KMS 密钥和加密算法。
38
+ *
39
+ * See also: https://docs.ucloud.cn/api/ukms-api/decrypt
40
+ */
41
+ decrypt(request?: DecryptRequest): Promise<DecryptResponse>;
42
+ /**
43
+ * DeleteAlias - 删除密钥别名。
44
+ *
45
+ * See also: https://docs.ucloud.cn/api/ukms-api/delete_alias
46
+ */
47
+ deleteAlias(request?: DeleteAliasRequest): Promise<DeleteAliasResponse>;
48
+ /**
49
+ * DescribeKey - 查看指定密钥的元数据。
50
+ *
51
+ * See also: https://docs.ucloud.cn/api/ukms-api/describe_key
52
+ */
53
+ describeKey(request?: DescribeKeyRequest): Promise<DescribeKeyResponse>;
54
+ /**
55
+ * DisableKey - 禁用指定密钥。
56
+ *
57
+ * See also: https://docs.ucloud.cn/api/ukms-api/disable_key
58
+ */
59
+ disableKey(request?: DisableKeyRequest): Promise<DisableKeyResponse>;
60
+ /**
61
+ * DisableKeyRotation - 关闭密钥自动轮转。
62
+ *
63
+ * See also: https://docs.ucloud.cn/api/ukms-api/disable_key_rotation
64
+ */
65
+ disableKeyRotation(request?: DisableKeyRotationRequest): Promise<DisableKeyRotationResponse>;
66
+ /**
67
+ * EnableKey - 启用指定密钥。
68
+ *
69
+ * See also: https://docs.ucloud.cn/api/ukms-api/enable_key
70
+ */
71
+ enableKey(request?: EnableKeyRequest): Promise<EnableKeyResponse>;
72
+ /**
73
+ * EnableKeyRotation - 开启对称密钥自动轮转。
74
+ *
75
+ * See also: https://docs.ucloud.cn/api/ukms-api/enable_key_rotation
76
+ */
77
+ enableKeyRotation(request?: EnableKeyRotationRequest): Promise<EnableKeyRotationResponse>;
78
+ /**
79
+ * Encrypt - 使用指定密钥加密明文数据。
80
+ *
81
+ * See also: https://docs.ucloud.cn/api/ukms-api/encrypt
82
+ */
83
+ encrypt(request?: EncryptRequest): Promise<EncryptResponse>;
84
+ /**
85
+ * GenerateDataKey - 生成数据密钥,返回明文和密文。
86
+ *
87
+ * See also: https://docs.ucloud.cn/api/ukms-api/generate_data_key
88
+ */
89
+ generateDataKey(request?: GenerateDataKeyRequest): Promise<GenerateDataKeyResponse>;
90
+ /**
91
+ * GenerateDataKeyPair - 创建数据密钥对
92
+ *
93
+ * See also: https://docs.ucloud.cn/api/ukms-api/generate_data_key_pair
94
+ */
95
+ generateDataKeyPair(request?: GenerateDataKeyPairRequest): Promise<GenerateDataKeyPairResponse>;
96
+ /**
97
+ * GenerateDataKeyPairWithoutPlaintext - 创建数据密钥对(无明文返回)
98
+ *
99
+ * See also: https://docs.ucloud.cn/api/ukms-api/generate_data_key_pair_without_plaintext
100
+ */
101
+ generateDataKeyPairWithoutPlaintext(request?: GenerateDataKeyPairWithoutPlaintextRequest): Promise<GenerateDataKeyPairWithoutPlaintextResponse>;
102
+ /**
103
+ * GenerateDataKeyWithoutPlaintext - 创建数据密钥(无明文),仅返回加密后的数据密钥。
104
+ *
105
+ * See also: https://docs.ucloud.cn/api/ukms-api/generate_data_key_without_plaintext
106
+ */
107
+ generateDataKeyWithoutPlaintext(request?: GenerateDataKeyWithoutPlaintextRequest): Promise<GenerateDataKeyWithoutPlaintextResponse>;
108
+ /**
109
+ * GenerateMac - 使用HMAC密钥管理服务(KMS)密钥和该密钥支持的MAC算法,为消息生成基于哈希的消息认证码(HMAC)。
110
+ *
111
+ * See also: https://docs.ucloud.cn/api/ukms-api/generate_mac
112
+ */
113
+ generateMac(request?: GenerateMacRequest): Promise<GenerateMacResponse>;
114
+ /**
115
+ * GenerateRandom - 生成随机数
116
+ *
117
+ * See also: https://docs.ucloud.cn/api/ukms-api/generate_random
118
+ */
119
+ generateRandom(request?: GenerateRandomRequest): Promise<GenerateRandomResponse>;
120
+ /**
121
+ * GetKeyRotationStatus - 查询密钥自动轮转状态。
122
+ *
123
+ * See also: https://docs.ucloud.cn/api/ukms-api/get_key_rotation_status
124
+ */
125
+ getKeyRotationStatus(request?: GetKeyRotationStatusRequest): Promise<GetKeyRotationStatusResponse>;
126
+ /**
127
+ * GetPublicKey - 获取非对称密钥的公钥。
128
+ *
129
+ * See also: https://docs.ucloud.cn/api/ukms-api/get_public_key
130
+ */
131
+ getPublicKey(request?: GetPublicKeyRequest): Promise<GetPublicKeyResponse>;
132
+ /**
133
+ * ListAliases - 获取 UKMS 实例下的别名列表。
134
+ *
135
+ * See also: https://docs.ucloud.cn/api/ukms-api/list_aliases
136
+ */
137
+ listAliases(request?: ListAliasesRequest): Promise<ListAliasesResponse>;
138
+ /**
139
+ * ListKeys - 查询用户的主密钥信息列表。
140
+ *
141
+ * See also: https://docs.ucloud.cn/api/ukms-api/list_keys
142
+ */
143
+ listKeys(request?: ListKeysRequest): Promise<ListKeysResponse>;
144
+ /**
145
+ * ListScheduleDeletionKeys - 获取计划删除密钥列表,调用ScheduleKeyDeletion命令后进入此列表, 默认30天后正式删除。正式删除前可调用CancelScheduleKeyDeletion恢复
146
+ *
147
+ * See also: https://docs.ucloud.cn/api/ukms-api/list_schedule_deletion_keys
148
+ */
149
+ listScheduleDeletionKeys(request?: ListScheduleDeletionKeysRequest): Promise<ListScheduleDeletionKeysResponse>;
150
+ /**
151
+ * RotateKeyOnDemand - 立即触发一次密钥轮转。
152
+ *
153
+ * See also: https://docs.ucloud.cn/api/ukms-api/rotate_key_on_demand
154
+ */
155
+ rotateKeyOnDemand(request?: RotateKeyOnDemandRequest): Promise<RotateKeyOnDemandResponse>;
156
+ /**
157
+ * ScheduleKeyDeletion - 计划删除指定密钥。
158
+ *
159
+ * See also: https://docs.ucloud.cn/api/ukms-api/schedule_key_deletion
160
+ */
161
+ scheduleKeyDeletion(request?: ScheduleKeyDeletionRequest): Promise<ScheduleKeyDeletionResponse>;
162
+ /**
163
+ * Sign - 使用非对称密钥对消息或消息摘要签名。
164
+ *
165
+ * See also: https://docs.ucloud.cn/api/ukms-api/sign
166
+ */
167
+ sign(request?: SignRequest): Promise<SignResponse>;
168
+ /**
169
+ * UpdateAlias - 将别名更新到另一个密钥。
170
+ *
171
+ * See also: https://docs.ucloud.cn/api/ukms-api/update_alias
172
+ */
173
+ updateAlias(request?: UpdateAliasRequest): Promise<UpdateAliasResponse>;
174
+ /**
175
+ * UpdateKeyDescription - 更新指定密钥的描述信息。
176
+ *
177
+ * See also: https://docs.ucloud.cn/api/ukms-api/update_key_description
178
+ */
179
+ updateKeyDescription(request?: UpdateKeyDescriptionRequest): Promise<UpdateKeyDescriptionResponse>;
180
+ /**
181
+ * Verify - 使用非对称密钥验证签名。
182
+ *
183
+ * See also: https://docs.ucloud.cn/api/ukms-api/verify
184
+ */
185
+ verify(request?: VerifyRequest): Promise<VerifyResponse>;
186
+ /**
187
+ * VerifyMac - 验证签名
188
+ *
189
+ * See also: https://docs.ucloud.cn/api/ukms-api/verify_mac
190
+ */
191
+ verifyMac(request?: VerifyMacRequest): Promise<VerifyMacResponse>;
192
+ }
193
+ /**
194
+ * CancelKeyDeletion - 取消计划删除中的密钥。
195
+ */
196
+ export interface CancelKeyDeletionRequest {
197
+ /**
198
+ * 密钥 ID。
199
+ */
200
+ KeyId: string;
201
+ /**
202
+ * UKMS 实例资源 ID。
203
+ */
204
+ ResourceId?: string;
205
+ }
206
+ /**
207
+ * CancelKeyDeletion - 取消计划删除中的密钥。
208
+ */
209
+ export interface CancelKeyDeletionResponse {
210
+ }
211
+ /**
212
+ * CancelScheduleKeyDeletion - 取消计划删除密钥
213
+ */
214
+ export interface CancelScheduleKeyDeletionRequest {
215
+ /**
216
+ * 需要查看的主密钥对应的 KeyId
217
+ */
218
+ KeyId: string;
219
+ /**
220
+ * 资源id
221
+ */
222
+ ResourceId?: string;
223
+ }
224
+ /**
225
+ * CancelScheduleKeyDeletion - 取消计划删除密钥
226
+ */
227
+ export interface CancelScheduleKeyDeletionResponse {
228
+ }
229
+ /**
230
+ * CreateAlias - 为密钥创建别名。
231
+ */
232
+ export interface CreateAliasRequest {
233
+ /**
234
+ * 密钥别名,格式为 alias/name。
235
+ */
236
+ AliasName: string;
237
+ /**
238
+ * 密钥 ID、ARN 或别名。
239
+ */
240
+ KeyId: string;
241
+ /**
242
+ * UKMS 实例资源 ID。
243
+ */
244
+ ResourceId?: string;
245
+ }
246
+ /**
247
+ * CreateAlias - 为密钥创建别名。
248
+ */
249
+ export interface CreateAliasResponse {
250
+ }
251
+ /**
252
+ * CreateKey - 创建密钥。
253
+ */
254
+ export interface CreateKeyRequest {
255
+ /**
256
+ * UKMS 实例资源 ID。
257
+ */
258
+ ResourceId: string;
259
+ /**
260
+ * 密钥描述,最多 8192 字符。
261
+ */
262
+ Description?: string;
263
+ /**
264
+ * 可选密钥别名,格式为 alias/name。
265
+ */
266
+ Alias?: string;
267
+ /**
268
+ * 密钥规格,默认 SYMMETRIC_DEFAULT(AES_256)。可选值:SYMMETRIC_DEFAULT(AES_256)、RSA_2048、RSA_3072、RSA_4096、ECC_NIST_P256、ECC_NIST_P384、ECC_NIST_P521、HMAC_256、HMAC_384、HMAC_512。
269
+ */
270
+ KeySpec?: string;
271
+ /**
272
+ * 密钥用途
273
+ */
274
+ KeyUsage?: string;
275
+ /**
276
+ * 密钥材料来源,默认 UCLOUD_KMS。当前仅支持 UCLOUD_KMS;EXTERNAL 为 BYOK 规划值,当前传入会返回 100660。
277
+ */
278
+ Origin?: string;
279
+ /**
280
+ * 是否开启删除保护。可选值:true、false;默认 false。
281
+ */
282
+ DeletionProtection?: string;
283
+ }
284
+ /**
285
+ * CreateKey - 创建密钥。
286
+ */
287
+ export interface CreateKeyResponse {
288
+ /**
289
+ * 密钥 ID。
290
+ */
291
+ KeyId: string;
292
+ }
293
+ /**
294
+ * Decrypt - 您可以使用此操作解密使用对称加密 KMS 密钥或非对称加密 KMS 密钥加密的密文。当 KMS 密钥为非对称密钥时,您必须指定用于加密密文的 KMS 密钥和加密算法。
295
+ */
296
+ export interface DecryptRequest {
297
+ /**
298
+ * 待解密密文。
299
+ */
300
+ CiphertextBlob: string;
301
+ /**
302
+ * UKMS 实例资源 ID。
303
+ */
304
+ ResourceId?: string;
305
+ /**
306
+ * 主密钥 KeyId;对称密钥可空,从 CiphertextBlob 自动识别;非对称必填。
307
+ */
308
+ KeyId?: string;
309
+ /**
310
+ * 加密上下文,JSON Object。
311
+ */
312
+ EncryptionContext?: string;
313
+ /**
314
+ * 解密算法。可选值:SYMMETRIC_DEFAULT、RSAES_OAEP_SHA_1、RSAES_OAEP_SHA_256;非对称密钥解密时必填或使用默认 RSAES_OAEP_SHA_256。
315
+ */
316
+ EncryptionAlgorithm?: string;
317
+ }
318
+ /**
319
+ * Decrypt - 您可以使用此操作解密使用对称加密 KMS 密钥或非对称加密 KMS 密钥加密的密文。当 KMS 密钥为非对称密钥时,您必须指定用于加密密文的 KMS 密钥和加密算法。
320
+ */
321
+ export interface DecryptResponse {
322
+ /**
323
+ * 解密后的明文,Base64 编码。
324
+ */
325
+ Plaintext: string;
326
+ /**
327
+ * 密钥资源长 ID。
328
+ */
329
+ KeyId: string;
330
+ /**
331
+ * 实际使用的解密算法。取值:SYMMETRIC_DEFAULT、RSAES_OAEP_SHA_1、RSAES_OAEP_SHA_256。
332
+ */
333
+ EncryptionAlgorithm: string;
334
+ }
335
+ /**
336
+ * DeleteAlias - 删除密钥别名。
337
+ */
338
+ export interface DeleteAliasRequest {
339
+ /**
340
+ * 密钥别名,格式为 alias/name。
341
+ */
342
+ AliasName: string;
343
+ /**
344
+ * UKMS 实例资源 ID。
345
+ */
346
+ ResourceId?: string;
347
+ }
348
+ /**
349
+ * DeleteAlias - 删除密钥别名。
350
+ */
351
+ export interface DeleteAliasResponse {
352
+ }
353
+ /**
354
+ * DescribeKey - 查看指定密钥的元数据。
355
+ */
356
+ export interface DescribeKeyRequest {
357
+ /**
358
+ * 密钥资源长 ID、ARN 或别名。
359
+ */
360
+ KeyId: string;
361
+ /**
362
+ * UKMS 实例资源 ID。
363
+ */
364
+ ResourceId?: string;
365
+ }
366
+ /**
367
+ * DescribeKey - 查看指定密钥的元数据。
368
+ */
369
+ export interface DescribeKeyResponse {
370
+ /**
371
+ * 密钥元数据。
372
+ */
373
+ KeyMetadata: {
374
+ /**
375
+ * 密钥资源长 ID。
376
+ */
377
+ KeyId: string;
378
+ /**
379
+ * 创建时间,Unix 时间戳。
380
+ */
381
+ CreationDate: number;
382
+ /**
383
+ * 是否启用。取值:true、false。
384
+ */
385
+ Enabled: string;
386
+ /**
387
+ * 密钥用途。取值:ENCRYPT_DECRYPT、SIGN_VERIFY、GENERATE_VERIFY_MAC、KEY_AGREEMENT。
388
+ */
389
+ KeyUsage: string[];
390
+ /**
391
+ * 密钥对外状态。取值:Enabled、Disabled、PendingDeletion、PendingImport、Unavailable。
392
+ */
393
+ KeyState: string;
394
+ /**
395
+ * 密钥材料来源。取值:UCLOUD_KMS、EXTERNAL;当前 CreateKey 仅支持 UCLOUD_KMS。
396
+ */
397
+ Origin: string;
398
+ /**
399
+ * 密钥规格。取值:SYMMETRIC_DEFAULT、RSA_2048、RSA_3072、RSA_4096、ECC_NIST_P256、ECC_NIST_P384、ECC_NIST_P521、HMAC_256、HMAC_384、HMAC_512。
400
+ */
401
+ KeySpec: string;
402
+ /**
403
+ * 是否开启删除保护。取值:true、false。
404
+ */
405
+ DeletionProtection: string;
406
+ /**
407
+ * 当前密钥版本。
408
+ */
409
+ KeyVersion: number;
410
+ /**
411
+ * 密钥所属的 UKMS 实例资源 ID。
412
+ */
413
+ ResourceId: string;
414
+ /**
415
+ * 密钥描述。
416
+ */
417
+ Description?: string;
418
+ /**
419
+ * 计划删除时间,Unix 时间戳。
420
+ */
421
+ DeletionDate?: number;
422
+ };
423
+ }
424
+ /**
425
+ * DisableKey - 禁用指定密钥。
426
+ */
427
+ export interface DisableKeyRequest {
428
+ /**
429
+ * 密钥 DB 数字 ID。
430
+ */
431
+ KeyId: number;
432
+ /**
433
+ * UKMS 实例资源 ID。
434
+ */
435
+ ResourceId?: string;
436
+ }
437
+ /**
438
+ * DisableKey - 禁用指定密钥。
439
+ */
440
+ export interface DisableKeyResponse {
441
+ }
442
+ /**
443
+ * DisableKeyRotation - 关闭密钥自动轮转。
444
+ */
445
+ export interface DisableKeyRotationRequest {
446
+ /**
447
+ * 密钥 ID、ARN 或别名。
448
+ */
449
+ KeyId: string;
450
+ /**
451
+ * UKMS 实例资源 ID。
452
+ */
453
+ ResourceId?: string;
454
+ }
455
+ /**
456
+ * DisableKeyRotation - 关闭密钥自动轮转。
457
+ */
458
+ export interface DisableKeyRotationResponse {
459
+ }
460
+ /**
461
+ * EnableKey - 启用指定密钥。
462
+ */
463
+ export interface EnableKeyRequest {
464
+ /**
465
+ * 密钥 DB 数字 ID。
466
+ */
467
+ KeyId: number;
468
+ /**
469
+ * UKMS 实例资源 ID。
470
+ */
471
+ ResourceId?: string;
472
+ }
473
+ /**
474
+ * EnableKey - 启用指定密钥。
475
+ */
476
+ export interface EnableKeyResponse {
477
+ }
478
+ /**
479
+ * EnableKeyRotation - 开启对称密钥自动轮转。
480
+ */
481
+ export interface EnableKeyRotationRequest {
482
+ /**
483
+ * UKMS 实例资源 ID。
484
+ */
485
+ ResourceId: string;
486
+ /**
487
+ * 密钥 ID、ARN 或别名。
488
+ */
489
+ KeyId: string;
490
+ /**
491
+ * 轮转周期,单位天。取值范围 1~2560,默认 365。仅 SYMMETRIC_DEFAULT 且 Origin=UCLOUD_KMS 的密钥支持轮转。
492
+ */
493
+ RotationPeriodInDays?: number;
494
+ }
495
+ /**
496
+ * EnableKeyRotation - 开启对称密钥自动轮转。
497
+ */
498
+ export interface EnableKeyRotationResponse {
499
+ }
500
+ /**
501
+ * Encrypt - 使用指定密钥加密明文数据。
502
+ */
503
+ export interface EncryptRequest {
504
+ /**
505
+ * 密钥资源长 ID、ARN 或别名。
506
+ */
507
+ KeyId: string;
508
+ /**
509
+ * 待加密明文,Base64 编码。
510
+ */
511
+ Plaintext: string;
512
+ /**
513
+ * 加密上下文,JSON Object。
514
+ */
515
+ EncryptionContext?: string;
516
+ /**
517
+ * UKMS 实例资源 ID。
518
+ */
519
+ ResourceId?: string;
520
+ /**
521
+ * 加密算法。可选值:SYMMETRIC_DEFAULT、RSAES_OAEP_SHA_1、RSAES_OAEP_SHA_256;对称密钥默认 SYMMETRIC_DEFAULT,RSA 默认 RSAES_OAEP_SHA_256。
522
+ */
523
+ EncryptionAlgorithm?: string;
524
+ }
525
+ /**
526
+ * Encrypt - 使用指定密钥加密明文数据。
527
+ */
528
+ export interface EncryptResponse {
529
+ /**
530
+ * 加密后的密文。
531
+ */
532
+ CiphertextBlob: string;
533
+ /**
534
+ * 密钥资源长 ID。
535
+ */
536
+ KeyId: string;
537
+ /**
538
+ * 实际使用的加密算法。取值:SYMMETRIC_DEFAULT、RSAES_OAEP_SHA_1、RSAES_OAEP_SHA_256。
539
+ */
540
+ EncryptionAlgorithm: string;
541
+ }
542
+ /**
543
+ * GenerateDataKey - 生成数据密钥,返回明文和密文。
544
+ */
545
+ export interface GenerateDataKeyRequest {
546
+ /**
547
+ * 密钥资源长 ID、ARN 或别名。
548
+ */
549
+ KeyId: string;
550
+ /**
551
+ * UKMS 实例资源 ID。
552
+ */
553
+ ResourceId?: string;
554
+ /**
555
+ * 数据密钥规格。可选值:AES_256、AES_128;默认 AES_256。与 NumberOfBytes 二选一,同时填写时 NumberOfBytes 优先。
556
+ */
557
+ KeySpec?: string;
558
+ /**
559
+ * 生成数据密钥的字节长度,取值范围 1~1024。与 KeySpec 二选一,同时填写时本字段优先。
560
+ */
561
+ NumberOfBytes?: number;
562
+ /**
563
+ * 加密上下文,JSON Object。
564
+ */
565
+ EncryptionContext?: string;
566
+ }
567
+ /**
568
+ * GenerateDataKey - 生成数据密钥,返回明文和密文。
569
+ */
570
+ export interface GenerateDataKeyResponse {
571
+ /**
572
+ * 数据密钥明文,Base64 编码。
573
+ */
574
+ Plaintext?: string;
575
+ /**
576
+ * 加密后的数据密钥。
577
+ */
578
+ CiphertextBlob: string;
579
+ /**
580
+ * 加密该数据密钥的密钥资源长 ID。
581
+ */
582
+ KeyId: string;
583
+ }
584
+ /**
585
+ * GenerateDataKeyPair - 创建数据密钥对
586
+ */
587
+ export interface GenerateDataKeyPairRequest {
588
+ /**
589
+ * 密钥ID
590
+ */
591
+ KeyId: string;
592
+ /**
593
+ * 密钥类型
594
+ */
595
+ KeyPairSpec: string;
596
+ /**
597
+ * 加密上下文
598
+ */
599
+ EncryptionContext?: string;
600
+ }
601
+ /**
602
+ * GenerateDataKeyPair - 创建数据密钥对
603
+ */
604
+ export interface GenerateDataKeyPairResponse {
605
+ }
606
+ /**
607
+ * GenerateDataKeyPairWithoutPlaintext - 创建数据密钥对(无明文返回)
608
+ */
609
+ export interface GenerateDataKeyPairWithoutPlaintextRequest {
610
+ /**
611
+ * 密钥ID
612
+ */
613
+ KeyId: string;
614
+ }
615
+ /**
616
+ * GenerateDataKeyPairWithoutPlaintext - 创建数据密钥对(无明文返回)
617
+ */
618
+ export interface GenerateDataKeyPairWithoutPlaintextResponse {
619
+ }
620
+ /**
621
+ * GenerateDataKeyWithoutPlaintext - 创建数据密钥(无明文),仅返回加密后的数据密钥。
622
+ */
623
+ export interface GenerateDataKeyWithoutPlaintextRequest {
624
+ /**
625
+ * 密钥资源长 ID、ARN 或别名。
626
+ */
627
+ KeyId: string;
628
+ /**
629
+ * UKMS 实例资源 ID。
630
+ */
631
+ ResourceId?: string;
632
+ /**
633
+ * 数据密钥规格。可选值:AES_256、AES_128;默认 AES_256。与 NumberOfBytes 二选一,同时填写时 NumberOfBytes 优先。
634
+ */
635
+ KeySpec?: string;
636
+ /**
637
+ * 生成数据密钥的字节长度,取值范围 1~1024。与 KeySpec 二选一,同时填写时本字段优先。
638
+ */
639
+ NumberOfBytes?: number;
640
+ /**
641
+ * 加密上下文,JSON Object。
642
+ */
643
+ EncryptionContext?: string;
644
+ }
645
+ /**
646
+ * GenerateDataKeyWithoutPlaintext - 创建数据密钥(无明文),仅返回加密后的数据密钥。
647
+ */
648
+ export interface GenerateDataKeyWithoutPlaintextResponse {
649
+ /**
650
+ * 加密后的数据密钥。
651
+ */
652
+ CiphertextBlob: string;
653
+ /**
654
+ * 加密该数据密钥的密钥资源长 ID。
655
+ */
656
+ KeyId: string;
657
+ }
658
+ /**
659
+ * GenerateMac - 使用HMAC密钥管理服务(KMS)密钥和该密钥支持的MAC算法,为消息生成基于哈希的消息认证码(HMAC)。
660
+ */
661
+ export interface GenerateMacRequest {
662
+ /**
663
+ * 密钥ID
664
+ */
665
+ KeyId: string;
666
+ /**
667
+ * 待哈希的消息。
668
+ */
669
+ MacMessage: string;
670
+ }
671
+ /**
672
+ * GenerateMac - 使用HMAC密钥管理服务(KMS)密钥和该密钥支持的MAC算法,为消息生成基于哈希的消息认证码(HMAC)。
673
+ */
674
+ export interface GenerateMacResponse {
675
+ }
676
+ /**
677
+ * GenerateRandom - 生成随机数
678
+ */
679
+ export interface GenerateRandomRequest {
680
+ /**
681
+ * 随机数长度,最大1024
682
+ */
683
+ NumberOfBytes: number;
684
+ }
685
+ /**
686
+ * GenerateRandom - 生成随机数
687
+ */
688
+ export interface GenerateRandomResponse {
689
+ }
690
+ /**
691
+ * GetKeyRotationStatus - 查询密钥自动轮转状态。
692
+ */
693
+ export interface GetKeyRotationStatusRequest {
694
+ /**
695
+ * 密钥资源长 ID、ARN 或别名。
696
+ */
697
+ KeyId: string;
698
+ /**
699
+ * UKMS 实例资源 ID。
700
+ */
701
+ ResourceId?: string;
702
+ }
703
+ /**
704
+ * GetKeyRotationStatus - 查询密钥自动轮转状态。
705
+ */
706
+ export interface GetKeyRotationStatusResponse {
707
+ /**
708
+ * 是否开启自动轮转。取值:true、false。
709
+ */
710
+ KeyRotationEnabled: boolean;
711
+ /**
712
+ * 密钥资源长 ID。
713
+ */
714
+ KeyId: string;
715
+ /**
716
+ * 轮转周期,单位天;未开启时返回 0。
717
+ */
718
+ RotationPeriodInDays: number;
719
+ /**
720
+ * 下次轮转时间,Unix 时间戳。
721
+ */
722
+ NextRotationDate?: number;
723
+ /**
724
+ * 按需轮转开始时间,Unix 时间戳。
725
+ */
726
+ OnDemandRotationStartDate?: number;
727
+ }
728
+ /**
729
+ * GetPublicKey - 获取非对称密钥的公钥。
730
+ */
731
+ export interface GetPublicKeyRequest {
732
+ /**
733
+ * 密钥 ID、ARN 或别名。
734
+ */
735
+ KeyId: string;
736
+ /**
737
+ * UKMS 实例资源 ID。
738
+ */
739
+ ResourceId?: string;
740
+ }
741
+ /**
742
+ * GetPublicKey - 获取非对称密钥的公钥。
743
+ */
744
+ export interface GetPublicKeyResponse {
745
+ /**
746
+ * 密钥 ID。
747
+ */
748
+ KeyId: string;
749
+ /**
750
+ * PEM 或 DER 编码的公钥。
751
+ */
752
+ KmsPublicKey: string;
753
+ /**
754
+ * 密钥规格。取值:SYMMETRIC_DEFAULT、RSA_2048、RSA_3072、RSA_4096、ECC_NIST_P256、ECC_NIST_P384、ECC_NIST_P521、HMAC_256、HMAC_384、HMAC_512。
755
+ */
756
+ KeySpec: string;
757
+ /**
758
+ * 密钥用途。取值:ENCRYPT_DECRYPT、SIGN_VERIFY、GENERATE_VERIFY_MAC、KEY_AGREEMENT。
759
+ */
760
+ KeyUsage: string[];
761
+ /**
762
+ * 支持的签名算法列表。取值范围:RSASSA_PSS_SHA_256、RSASSA_PSS_SHA_384、RSASSA_PSS_SHA_512、RSASSA_PKCS1_V1_5_SHA_256、RSASSA_PKCS1_V1_5_SHA_384、RSASSA_PKCS1_V1_5_SHA_512、ECDSA_SHA_256、ECDSA_SHA_384、ECDSA_SHA_512。
763
+ */
764
+ SigningAlgorithms?: string[];
765
+ /**
766
+ * 支持的加密算法列表。取值范围:RSAES_OAEP_SHA_1、RSAES_OAEP_SHA_256。
767
+ */
768
+ EncryptionAlgorithms?: string[];
769
+ }
770
+ /**
771
+ * ListAliases - 获取 UKMS 实例下的别名列表。
772
+ */
773
+ export interface ListAliasesRequest {
774
+ /**
775
+ * UKMS 实例资源 ID。
776
+ */
777
+ ResourceId?: string;
778
+ /**
779
+ * 可选:筛选指定密钥资源长 ID 的别名。
780
+ */
781
+ KeyId?: string;
782
+ /**
783
+ * 列表起始位置偏移量。
784
+ */
785
+ Offset?: number;
786
+ /**
787
+ * 返回数据长度。
788
+ */
789
+ Limit?: number;
790
+ }
791
+ /**
792
+ * ListAliases - 获取 UKMS 实例下的别名列表。
793
+ */
794
+ export interface ListAliasesResponse {
795
+ /**
796
+ * 别名总数。
797
+ */
798
+ TotalCount: number;
799
+ /**
800
+ * 别名列表,每项为 AliasInfo。
801
+ */
802
+ Aliases: {
803
+ /**
804
+ * 别名,含 alias/ 前缀。
805
+ */
806
+ AliasName: string;
807
+ /**
808
+ * 别名指向的密钥资源长 ID。
809
+ */
810
+ TargetKeyId: string;
811
+ /**
812
+ * 创建时间,Unix 时间戳。
813
+ */
814
+ CreationDate: number;
815
+ /**
816
+ * 最后更新时间,Unix 时间戳。
817
+ */
818
+ LastUpdatedDate: number;
819
+ }[];
820
+ }
821
+ /**
822
+ * ListKeys - 查询用户的主密钥信息列表。
823
+ */
824
+ export interface ListKeysRequest {
825
+ /**
826
+ * UKMS 实例资源 ID。
827
+ */
828
+ ResourceId?: string;
829
+ /**
830
+ * 按密钥 ID 或别名模糊过滤。
831
+ */
832
+ Alias?: string;
833
+ /**
834
+ * 列表起始位置偏移量。
835
+ */
836
+ Offset?: number;
837
+ /**
838
+ * 返回数据长度。最大1000
839
+ */
840
+ Limit?: number;
841
+ }
842
+ /**
843
+ * ListKeys - 查询用户的主密钥信息列表。
844
+ */
845
+ export interface ListKeysResponse {
846
+ /**
847
+ * 密钥信息数组,每项为 DEK/ListKeys item。
848
+ */
849
+ Data: {
850
+ /**
851
+ * 对外主密钥 ID(ukms_key_info.key_id)。
852
+ */
853
+ KeyId: string;
854
+ /**
855
+ * 密钥规格。取值:SYMMETRIC_DEFAULT、RSA_2048、RSA_3072、RSA_4096、ECC_NIST_P256、ECC_NIST_P384、ECC_NIST_P521、HMAC_256、HMAC_384、HMAC_512。
856
+ */
857
+ KeySpec: string;
858
+ /**
859
+ * 按 KeySpec 派生的密钥用途。取值:ENCRYPT_DECRYPT、SIGN_VERIFY、GENERATE_VERIFY_MAC、KEY_AGREEMENT。
860
+ */
861
+ KeyUsage: string[];
862
+ /**
863
+ * 密钥来源,由 Origin 派生。取值:ucloud、import。当前 CreateKey 仅支持 ucloud。
864
+ */
865
+ Origin: string;
866
+ /**
867
+ * 数据库密钥状态。常见取值:Active、Deactivated、PendingDeletion。
868
+ */
869
+ Status: string;
870
+ /**
871
+ * 创建时间,Unix 时间戳。
872
+ */
873
+ CreatedTime: number;
874
+ /**
875
+ * 更新时间,Unix 时间戳。
876
+ */
877
+ UpdateTime: number;
878
+ /**
879
+ * 是否已开启自动轮转;未配置或已关闭均为 false
880
+ */
881
+ KeyRotationEnabled: boolean;
882
+ /**
883
+ * 自动轮转周期(天);未开启时为 0
884
+ */
885
+ RotationPeriodInDays: number;
886
+ /**
887
+ * 密钥所属的 UKMS 实例资源 ID。
888
+ */
889
+ ResourceId: string;
890
+ /**
891
+ * 密钥描述。
892
+ */
893
+ Description?: string;
894
+ /**
895
+ * 计划删除时间,Unix 时间戳。
896
+ */
897
+ PlanDeleteTime?: number;
898
+ /**
899
+ * 下次自动轮转时间(Unix 时间戳,秒);仅在已开启自动轮转时返回。
900
+ */
901
+ NextRotationDate?: number;
902
+ }[];
903
+ /**
904
+ * 符合条件的总数,不同于 Limit。
905
+ */
906
+ TotalCount: number;
907
+ }
908
+ /**
909
+ * ListScheduleDeletionKeys - 获取计划删除密钥列表,调用ScheduleKeyDeletion命令后进入此列表, 默认30天后正式删除。正式删除前可调用CancelScheduleKeyDeletion恢复
910
+ */
911
+ export interface ListScheduleDeletionKeysRequest {
912
+ /**
913
+ * 输出列表起始位置,默认从0开始
914
+ */
915
+ Offset?: number;
916
+ /**
917
+ * 输出列表数量,默认返回200个
918
+ */
919
+ Limit?: number;
920
+ /**
921
+ * 列表排序方式, 可选项: "-created_time", "created_time","plan_delete_time","-plan_delete_time";默认按-plan_delete_time 计划删除时间升序返回
922
+ */
923
+ OrderBy?: string;
924
+ }
925
+ /**
926
+ * ListScheduleDeletionKeys - 获取计划删除密钥列表,调用ScheduleKeyDeletion命令后进入此列表, 默认30天后正式删除。正式删除前可调用CancelScheduleKeyDeletion恢复
927
+ */
928
+ export interface ListScheduleDeletionKeysResponse {
929
+ /**
930
+ * 主密钥信息组成的列表
931
+ */
932
+ Objects: {
933
+ /**
934
+ * CMK 的唯一标识符
935
+ */
936
+ KeyId: string;
937
+ /**
938
+ * 密钥类型,仅支持UCloudManagedKeys、CustomerManagedKeys。默认值CustomerManagedKeys
939
+ */
940
+ Type: string;
941
+ /**
942
+ * 对密钥的描述说明
943
+ */
944
+ Description: string;
945
+ /**
946
+ * 是否启用
947
+ */
948
+ Enabled: boolean;
949
+ /**
950
+ * 创建时间 时间戳
951
+ */
952
+ CreatedTime: number;
953
+ /**
954
+ * 最后修改时间 时间戳
955
+ */
956
+ LastModifiedTime: number;
957
+ /**
958
+ * 别名,与CMK一一对应
959
+ */
960
+ Alias?: string;
961
+ /**
962
+ * 计划删除时间 时间戳
963
+ */
964
+ PlanDeleteTime?: number;
965
+ }[];
966
+ /**
967
+ * 操作结果
968
+ */
969
+ Status?: string;
970
+ /**
971
+ * 请求唯一标识符
972
+ */
973
+ RequestUuid?: string;
974
+ /**
975
+ * 符合条件的总数, 不同于Limit
976
+ */
977
+ TotalCount?: number;
978
+ }
979
+ /**
980
+ * RotateKeyOnDemand - 立即触发一次密钥轮转。
981
+ */
982
+ export interface RotateKeyOnDemandRequest {
983
+ /**
984
+ * 密钥 ID、ARN 或别名。
985
+ */
986
+ KeyId: string;
987
+ /**
988
+ * UKMS 实例资源 ID。
989
+ */
990
+ ResourceId?: string;
991
+ }
992
+ /**
993
+ * RotateKeyOnDemand - 立即触发一次密钥轮转。
994
+ */
995
+ export interface RotateKeyOnDemandResponse {
996
+ /**
997
+ * 密钥 ID。
998
+ */
999
+ KeyId: string;
1000
+ }
1001
+ /**
1002
+ * ScheduleKeyDeletion - 计划删除指定密钥。
1003
+ */
1004
+ export interface ScheduleKeyDeletionRequest {
1005
+ /**
1006
+ * 密钥 DB 数字 ID。
1007
+ */
1008
+ KeyId: number;
1009
+ /**
1010
+ * UKMS 实例资源 ID。
1011
+ */
1012
+ ResourceId?: string;
1013
+ }
1014
+ /**
1015
+ * ScheduleKeyDeletion - 计划删除指定密钥。
1016
+ */
1017
+ export interface ScheduleKeyDeletionResponse {
1018
+ }
1019
+ /**
1020
+ * Sign - 使用非对称密钥对消息或消息摘要签名。
1021
+ */
1022
+ export interface SignRequest {
1023
+ /**
1024
+ * 密钥资源长 ID、ARN 或别名。
1025
+ */
1026
+ KeyId: string;
1027
+ /**
1028
+ * 待签名消息,Base64 编码,最大 4096 字节。
1029
+ */
1030
+ SigningMessage: string;
1031
+ /**
1032
+ * 签名算法。可选值:RSASSA_PSS_SHA_256、RSASSA_PSS_SHA_384、RSASSA_PSS_SHA_512、RSASSA_PKCS1_V1_5_SHA_256、RSASSA_PKCS1_V1_5_SHA_384、RSASSA_PKCS1_V1_5_SHA_512、ECDSA_SHA_256、ECDSA_SHA_384、ECDSA_SHA_512;须与密钥 KeySpec 匹配。
1033
+ */
1034
+ SigningAlgorithm: string;
1035
+ /**
1036
+ * UKMS 实例资源 ID。
1037
+ */
1038
+ ResourceId?: string;
1039
+ /**
1040
+ * 消息类型。可选值:RAW、DIGEST;默认 RAW。
1041
+ */
1042
+ MessageType?: string;
1043
+ }
1044
+ /**
1045
+ * Sign - 使用非对称密钥对消息或消息摘要签名。
1046
+ */
1047
+ export interface SignResponse {
1048
+ /**
1049
+ * 签名结果,Base64 编码。
1050
+ */
1051
+ SignatureResult: string;
1052
+ /**
1053
+ * 密钥资源长 ID。
1054
+ */
1055
+ KeyId: string;
1056
+ /**
1057
+ * 实际使用的签名算法。取值:RSASSA_PSS_SHA_256、RSASSA_PSS_SHA_384、RSASSA_PSS_SHA_512、RSASSA_PKCS1_V1_5_SHA_256、RSASSA_PKCS1_V1_5_SHA_384、RSASSA_PKCS1_V1_5_SHA_512、ECDSA_SHA_256、ECDSA_SHA_384、ECDSA_SHA_512。
1058
+ */
1059
+ SigningAlgorithm: string;
1060
+ }
1061
+ /**
1062
+ * UpdateAlias - 将别名更新到另一个密钥。
1063
+ */
1064
+ export interface UpdateAliasRequest {
1065
+ /**
1066
+ * 密钥别名,格式为 alias/name。
1067
+ */
1068
+ AliasName: string;
1069
+ /**
1070
+ * 密钥 ID、ARN 或别名。
1071
+ */
1072
+ KeyId: string;
1073
+ /**
1074
+ * UKMS 实例资源 ID。
1075
+ */
1076
+ ResourceId?: string;
1077
+ }
1078
+ /**
1079
+ * UpdateAlias - 将别名更新到另一个密钥。
1080
+ */
1081
+ export interface UpdateAliasResponse {
1082
+ }
1083
+ /**
1084
+ * UpdateKeyDescription - 更新指定密钥的描述信息。
1085
+ */
1086
+ export interface UpdateKeyDescriptionRequest {
1087
+ /**
1088
+ * 密钥资源长 ID、ARN 或别名。
1089
+ */
1090
+ KeyId: string;
1091
+ /**
1092
+ * 新的密钥描述,最多 8192 字符;空字符串表示清空描述。
1093
+ */
1094
+ Description: string;
1095
+ /**
1096
+ * UKMS 实例资源 ID。
1097
+ */
1098
+ ResourceId?: string;
1099
+ }
1100
+ /**
1101
+ * UpdateKeyDescription - 更新指定密钥的描述信息。
1102
+ */
1103
+ export interface UpdateKeyDescriptionResponse {
1104
+ /**
1105
+ * 返回状态。
1106
+ */
1107
+ Status?: string;
1108
+ /**
1109
+ * 此次请求唯一标识符。
1110
+ */
1111
+ RequestUuid?: string;
1112
+ }
1113
+ /**
1114
+ * Verify - 使用非对称密钥验证签名。
1115
+ */
1116
+ export interface VerifyRequest {
1117
+ /**
1118
+ * UKMS 实例资源 ID。
1119
+ */
1120
+ ResourceId: string;
1121
+ /**
1122
+ * 密钥 ID、ARN 或别名。
1123
+ */
1124
+ KeyId: string;
1125
+ /**
1126
+ * 待验签的消息或消息摘要,Base64 编码。
1127
+ */
1128
+ SigningMessage: string;
1129
+ /**
1130
+ * 待验证的签名,Base64 编码。
1131
+ */
1132
+ SignatureResult: string;
1133
+ /**
1134
+ * 签名时使用的算法。可选值:RSASSA_PSS_SHA_256、RSASSA_PSS_SHA_384、RSASSA_PSS_SHA_512、RSASSA_PKCS1_V1_5_SHA_256、RSASSA_PKCS1_V1_5_SHA_384、RSASSA_PKCS1_V1_5_SHA_512、ECDSA_SHA_256、ECDSA_SHA_384、ECDSA_SHA_512;须与密钥 KeySpec 匹配。
1135
+ */
1136
+ SigningAlgorithm: string;
1137
+ /**
1138
+ * 消息类型。可选值:RAW、DIGEST;默认 RAW。
1139
+ */
1140
+ MessageType?: string;
1141
+ }
1142
+ /**
1143
+ * Verify - 使用非对称密钥验证签名。
1144
+ */
1145
+ export interface VerifyResponse {
1146
+ /**
1147
+ * 密钥 ID。
1148
+ */
1149
+ KeyId: string;
1150
+ /**
1151
+ * 签名是否有效。
1152
+ */
1153
+ SignatureValid: boolean;
1154
+ /**
1155
+ * 使用的签名算法。取值:RSASSA_PSS_SHA_256、RSASSA_PSS_SHA_384、RSASSA_PSS_SHA_512、RSASSA_PKCS1_V1_5_SHA_256、RSASSA_PKCS1_V1_5_SHA_384、RSASSA_PKCS1_V1_5_SHA_512、ECDSA_SHA_256、ECDSA_SHA_384、ECDSA_SHA_512。
1156
+ */
1157
+ SigningAlgorithm: string;
1158
+ }
1159
+ /**
1160
+ * VerifyMac - 验证签名
1161
+ */
1162
+ export interface VerifyMacRequest {
1163
+ /**
1164
+ * 密钥ID
1165
+ */
1166
+ KeyId: string;
1167
+ /**
1168
+ * 用于验证的消息。请输入与生成 HMAC 时所用消息相同的消息。
1169
+ */
1170
+ MacMessage: string;
1171
+ /**
1172
+ * 要验证的 HMAC。请输入由 GenerateMac 操作生成的 HMAC,前提是您指定的消息、HMAC KMS 密钥和 MAC 算法与此请求中指定的值相同。
1173
+ */
1174
+ Mac: string;
1175
+ /**
1176
+ * 验证过程中将使用的 MAC 算法。请输入与计算 HMAC 时相同的 MAC 算法。此算法必须受 KeyId 参数标识的 HMAC KMS 密钥支持。
1177
+ */
1178
+ MacAlgorithm: string;
1179
+ }
1180
+ /**
1181
+ * VerifyMac - 验证签名
1182
+ */
1183
+ export interface VerifyMacResponse {
1184
+ }