@scaleway/sdk-key-manager 2.17.0 → 2.18.0

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.
@@ -1,609 +1,624 @@
1
- import type { Region as ScwRegion } from '@scaleway/sdk-client';
1
+ import { Region } from "@scaleway/sdk-client";
2
+ //#region src/v1alpha1/types.gen.d.ts
2
3
  export type DataKeyAlgorithmSymmetricEncryption = 'unknown_symmetric_encryption' | 'aes_256_gcm';
3
4
  export type KeyAlgorithmAsymmetricEncryption = 'unknown_asymmetric_encryption' | 'rsa_oaep_2048_sha256' | 'rsa_oaep_3072_sha256' | 'rsa_oaep_4096_sha256';
4
5
  export type KeyAlgorithmAsymmetricSigning = 'unknown_asymmetric_signing' | 'ec_p256_sha256' | 'ec_p384_sha384' | 'rsa_pss_2048_sha256' | 'rsa_pss_3072_sha256' | 'rsa_pss_4096_sha256' | 'rsa_pkcs1_2048_sha256' | 'rsa_pkcs1_3072_sha256' | 'rsa_pkcs1_4096_sha256' | 'ml_dsa_44' | 'ml_dsa_65' | 'ml_dsa_87' | 'ec_secp256k1_sha256';
5
6
  export type KeyAlgorithmKeyEncapsulation = 'unknown_key_encapsulation' | 'ml_kem_768' | 'ml_kem_1024';
6
7
  export type KeyAlgorithmSymmetricEncryption = 'unknown_symmetric_encryption' | 'aes_256_gcm';
7
8
  export type KeyOrigin = 'unknown_origin' | 'scaleway_kms' | 'external';
9
+ export type KeyProtectionLevel = 'unknown_protection_level' | 'software' | 'hsm';
8
10
  export type KeyRotationStatus = 'unknown_status' | 'enabled' | 'deleted';
9
11
  export type KeyState = 'unknown_state' | 'enabled' | 'disabled' | 'pending_key_material' | 'scheduled_for_deletion';
10
12
  export type ListAlgorithmsRequestUsage = 'unknown_usage' | 'symmetric_encryption' | 'asymmetric_encryption' | 'asymmetric_signing' | 'key_encapsulation';
11
13
  export type ListKeyRotationsRequestOrderBy = 'created_at_asc' | 'created_at_desc';
12
14
  export type ListKeysRequestOrderBy = 'name_asc' | 'name_desc' | 'created_at_asc' | 'created_at_desc' | 'updated_at_asc' | 'updated_at_desc';
13
- export type ListKeysRequestUsage = 'unknown_usage' | 'symmetric_encryption' | 'asymmetric_encryption' | 'asymmetric_signing';
15
+ export type ListKeysRequestUsage = 'unknown_usage' | 'symmetric_encryption' | 'asymmetric_encryption' | 'asymmetric_signing' | 'key_encapsulation';
14
16
  export interface KeyRotationPolicy {
15
- /**
16
- * Time interval between two key rotations. The minimum duration is 24 hours and the maximum duration is 1 year (876000 hours).
17
- */
18
- rotationPeriod?: string;
19
- /**
20
- * Timestamp indicating the next scheduled rotation.
21
- */
22
- nextRotationAt?: Date;
17
+ /**
18
+ * Time interval between two key rotations. The minimum duration is 24 hours and the maximum duration is 1 year (876000 hours).
19
+ */
20
+ rotationPeriod?: string;
21
+ /**
22
+ * Timestamp indicating the next scheduled rotation.
23
+ */
24
+ nextRotationAt?: Date;
23
25
  }
24
26
  export interface KeyUsage {
25
- /**
26
- * See the `Key.Algorithm.SymmetricEncryption` enum for a description of values.
27
- *
28
- * One-of ('usage'): at most one of 'symmetricEncryption', 'asymmetricEncryption', 'asymmetricSigning', 'keyEncapsulation' could be set.
29
- */
30
- symmetricEncryption?: KeyAlgorithmSymmetricEncryption;
31
- /**
32
- * See the `Key.Algorithm.AsymmetricEncryption` enum for a description of values.
33
- *
34
- * One-of ('usage'): at most one of 'symmetricEncryption', 'asymmetricEncryption', 'asymmetricSigning', 'keyEncapsulation' could be set.
35
- */
36
- asymmetricEncryption?: KeyAlgorithmAsymmetricEncryption;
37
- /**
38
- * See the `Key.Algorithm.AsymmetricSigning` enum for a description of values.
39
- *
40
- * One-of ('usage'): at most one of 'symmetricEncryption', 'asymmetricEncryption', 'asymmetricSigning', 'keyEncapsulation' could be set.
41
- */
42
- asymmetricSigning?: KeyAlgorithmAsymmetricSigning;
43
- /**
44
- * See the `Key.Algorithm.KeyEncapulation` enum for a description of values.
45
- *
46
- * One-of ('usage'): at most one of 'symmetricEncryption', 'asymmetricEncryption', 'asymmetricSigning', 'keyEncapsulation' could be set.
47
- */
48
- keyEncapsulation?: KeyAlgorithmKeyEncapsulation;
27
+ /**
28
+ * See the `Key.Algorithm.SymmetricEncryption` enum for a description of values.
29
+ *
30
+ * One-of ('usage'): at most one of 'symmetricEncryption', 'asymmetricEncryption', 'asymmetricSigning', 'keyEncapsulation' could be set.
31
+ */
32
+ symmetricEncryption?: KeyAlgorithmSymmetricEncryption;
33
+ /**
34
+ * See the `Key.Algorithm.AsymmetricEncryption` enum for a description of values.
35
+ *
36
+ * One-of ('usage'): at most one of 'symmetricEncryption', 'asymmetricEncryption', 'asymmetricSigning', 'keyEncapsulation' could be set.
37
+ */
38
+ asymmetricEncryption?: KeyAlgorithmAsymmetricEncryption;
39
+ /**
40
+ * See the `Key.Algorithm.AsymmetricSigning` enum for a description of values.
41
+ *
42
+ * One-of ('usage'): at most one of 'symmetricEncryption', 'asymmetricEncryption', 'asymmetricSigning', 'keyEncapsulation' could be set.
43
+ */
44
+ asymmetricSigning?: KeyAlgorithmAsymmetricSigning;
45
+ /**
46
+ * See the `Key.Algorithm.KeyEncapulation` enum for a description of values.
47
+ *
48
+ * One-of ('usage'): at most one of 'symmetricEncryption', 'asymmetricEncryption', 'asymmetricSigning', 'keyEncapsulation' could be set.
49
+ */
50
+ keyEncapsulation?: KeyAlgorithmKeyEncapsulation;
49
51
  }
50
52
  export interface ListAlgorithmsResponseAlgorithm {
51
- usage: string;
52
- name: string;
53
- recommended: boolean;
53
+ usage: string;
54
+ name: string;
55
+ recommended: boolean;
54
56
  }
55
57
  export interface KeyRotation {
56
- /**
57
- * ID of the associated key.
58
- */
59
- keyId: string;
60
- /**
61
- * The rotation index tracks the specific version of the key material.
62
- */
63
- index: number;
64
- /**
65
- * See the `KeyRotation.Status` enum for a description of possible values.
66
- */
67
- status: KeyRotationStatus;
68
- /**
69
- * Returns `true` if the key was rotated manually, or `false` if it was rotated automatically by a rotation policy.
70
- */
71
- manuallyRotated: boolean;
72
- /**
73
- * Key rotation creation date.
74
- */
75
- createdAt?: Date;
76
- /**
77
- * Key rotation last modification date.
78
- */
79
- updatedAt?: Date;
80
- /**
81
- * Key rotation deletion date.
82
- */
83
- deletedAt?: Date;
58
+ /**
59
+ * ID of the associated key.
60
+ */
61
+ keyId: string;
62
+ /**
63
+ * The rotation index tracks the specific version of the key material.
64
+ */
65
+ index: number;
66
+ /**
67
+ * See the `KeyRotation.Status` enum for a description of possible values.
68
+ */
69
+ status: KeyRotationStatus;
70
+ /**
71
+ * Returns `true` if the key was rotated manually, or `false` if it was rotated automatically by a rotation policy.
72
+ */
73
+ manuallyRotated: boolean;
74
+ /**
75
+ * Key rotation creation date.
76
+ */
77
+ createdAt?: Date;
78
+ /**
79
+ * Key rotation last modification date.
80
+ */
81
+ updatedAt?: Date;
82
+ /**
83
+ * Key rotation deletion date.
84
+ */
85
+ deletedAt?: Date;
84
86
  }
85
87
  export interface Key {
86
- /**
87
- * ID of the key.
88
- */
89
- id: string;
90
- /**
91
- * The SRN of the key.
92
- */
93
- srn: string;
94
- /**
95
- * ID of the Project containing the key.
96
- */
97
- projectId: string;
98
- /**
99
- * Name of the key.
100
- */
101
- name: string;
102
- /**
103
- * See the `Key.Usage` enum for a description of possible values.
104
- */
105
- usage?: KeyUsage;
106
- /**
107
- * See the `Key.State` enum for a description of possible values.
108
- */
109
- state: KeyState;
110
- /**
111
- * The rotation count tracks the number of times the key has been rotated.
112
- */
113
- rotationCount: number;
114
- /**
115
- * Key creation date.
116
- */
117
- createdAt?: Date;
118
- /**
119
- * Key last modification date.
120
- */
121
- updatedAt?: Date;
122
- /**
123
- * Returns `true` if key protection is applied to the key.
124
- */
125
- protected: boolean;
126
- /**
127
- * Returns `true` if the key is locked.
128
- */
129
- locked: boolean;
130
- /**
131
- * Description of the key.
132
- */
133
- description?: string;
134
- /**
135
- * List of the key's tags.
136
- */
137
- tags: string[];
138
- /**
139
- * Key last rotation date.
140
- */
141
- rotatedAt?: Date;
142
- /**
143
- * Key rotation policy.
144
- */
145
- rotationPolicy?: KeyRotationPolicy;
146
- /**
147
- * Refer to the `Key.Origin` enum for a description of values.
148
- */
149
- origin: KeyOrigin;
150
- /**
151
- * Returns the time at which deletion was requested.
152
- */
153
- deletionRequestedAt?: Date;
154
- /**
155
- * Region where the key is stored.
156
- */
157
- region: ScwRegion;
88
+ /**
89
+ * ID of the key.
90
+ */
91
+ id: string;
92
+ /**
93
+ * The SRN of the key.
94
+ */
95
+ srn: string;
96
+ /**
97
+ * ID of the Project containing the key.
98
+ */
99
+ projectId: string;
100
+ /**
101
+ * Name of the key.
102
+ */
103
+ name: string;
104
+ /**
105
+ * See the `Key.Usage` enum for a description of possible values.
106
+ */
107
+ usage?: KeyUsage;
108
+ /**
109
+ * See the `Key.State` enum for a description of possible values.
110
+ */
111
+ state: KeyState;
112
+ /**
113
+ * The rotation count tracks the number of times the key has been rotated.
114
+ */
115
+ rotationCount: number;
116
+ /**
117
+ * Key creation date.
118
+ */
119
+ createdAt?: Date;
120
+ /**
121
+ * Key last modification date.
122
+ */
123
+ updatedAt?: Date;
124
+ /**
125
+ * Returns `true` if key protection is applied to the key.
126
+ */
127
+ protected: boolean;
128
+ /**
129
+ * Returns `true` if the key is locked.
130
+ */
131
+ locked: boolean;
132
+ /**
133
+ * Description of the key.
134
+ */
135
+ description?: string;
136
+ /**
137
+ * List of the key's tags.
138
+ */
139
+ tags: string[];
140
+ /**
141
+ * Key last rotation date.
142
+ */
143
+ rotatedAt?: Date;
144
+ /**
145
+ * Key rotation policy.
146
+ */
147
+ rotationPolicy?: KeyRotationPolicy;
148
+ /**
149
+ * Refer to the `Key.Origin` enum for a description of values.
150
+ */
151
+ origin: KeyOrigin;
152
+ /**
153
+ * Returns the time at which deletion was requested.
154
+ */
155
+ deletionRequestedAt?: Date;
156
+ /**
157
+ * Refer to the `Key.ProtectionLevel` enum for a description of values.
158
+ */
159
+ protectionLevel: KeyProtectionLevel;
160
+ /**
161
+ * Region where the key is stored.
162
+ */
163
+ region: Region;
158
164
  }
159
165
  export type CreateKeyRequest = {
160
- /**
161
- * Region to target. If none is passed will use default region from the config.
162
- */
163
- region?: ScwRegion;
164
- /**
165
- * ID of the Project containing the key.
166
- */
167
- projectId?: string;
168
- /**
169
- * (Optional) Name of the key.
170
- */
171
- name?: string;
172
- /**
173
- * See the `Key.Usage` enum for a description of possible values.
174
- */
175
- usage?: KeyUsage;
176
- /**
177
- * (Optional) Description of the key.
178
- */
179
- description?: string;
180
- /**
181
- * (Optional) List of the key's tags.
182
- */
183
- tags?: string[];
184
- /**
185
- * If not specified, no rotation policy will be applied to the key.
186
- */
187
- rotationPolicy?: KeyRotationPolicy;
188
- /**
189
- * Default value is `false`.
190
- */
191
- unprotected: boolean;
192
- /**
193
- * Refer to the `Key.Origin` enum for a description of values.
194
- */
195
- origin?: KeyOrigin;
166
+ /**
167
+ * Region to target. If none is passed will use default region from the config.
168
+ */
169
+ region?: Region;
170
+ /**
171
+ * ID of the Project containing the key.
172
+ */
173
+ projectId?: string;
174
+ /**
175
+ * (Optional) Name of the key.
176
+ */
177
+ name?: string;
178
+ /**
179
+ * See the `Key.Usage` enum for a description of possible values.
180
+ */
181
+ usage?: KeyUsage;
182
+ /**
183
+ * (Optional) Description of the key.
184
+ */
185
+ description?: string;
186
+ /**
187
+ * (Optional) List of the key's tags.
188
+ */
189
+ tags?: string[];
190
+ /**
191
+ * If not specified, no rotation policy will be applied to the key.
192
+ */
193
+ rotationPolicy?: KeyRotationPolicy;
194
+ /**
195
+ * Default value is `false`.
196
+ */
197
+ unprotected: boolean;
198
+ /**
199
+ * Refer to the `Key.Origin` enum for a description of values.
200
+ */
201
+ origin?: KeyOrigin;
202
+ /**
203
+ * Refer to the `Key.Protection` enum for a description of values.
204
+ */
205
+ protectionLevel?: KeyProtectionLevel;
196
206
  };
197
207
  export interface DataKey {
198
- /**
199
- * ID of the data encryption key.
200
- */
201
- keyId: string;
202
- /**
203
- * Symmetric encryption algorithm of the data encryption key (`AES-256-GCM`).
204
- */
205
- algorithm: DataKeyAlgorithmSymmetricEncryption;
206
- /**
207
- * Your data encryption key's ciphertext can be stored safely. It can only be decrypted through the keys you create in Key Manager, using the relevant key ID.
208
- */
209
- ciphertext: string;
210
- /**
211
- * (Optional) Your data encryption key's plaintext allows you to use the key immediately upon creation. It must neither be stored or shared.
212
- */
213
- plaintext?: string;
214
- /**
215
- * Data encryption key creation date.
216
- */
217
- createdAt?: Date;
208
+ /**
209
+ * ID of the data encryption key.
210
+ */
211
+ keyId: string;
212
+ /**
213
+ * Symmetric encryption algorithm of the data encryption key (`AES-256-GCM`).
214
+ */
215
+ algorithm: DataKeyAlgorithmSymmetricEncryption;
216
+ /**
217
+ * Your data encryption key's ciphertext can be stored safely. It can only be decrypted through the keys you create in Key Manager, using the relevant key ID.
218
+ */
219
+ ciphertext: string;
220
+ /**
221
+ * (Optional) Your data encryption key's plaintext allows you to use the key immediately upon creation. It must neither be stored or shared.
222
+ */
223
+ plaintext?: string;
224
+ /**
225
+ * Data encryption key creation date.
226
+ */
227
+ createdAt?: Date;
218
228
  }
219
229
  export type DecryptRequest = {
220
- /**
221
- * Region to target. If none is passed will use default region from the config.
222
- */
223
- region?: ScwRegion;
224
- /**
225
- * The key must have an usage set to `symmetric_encryption` or `asymmetric_encryption`.
226
- */
227
- keyId: string;
228
- /**
229
- * Data size must be between 1 and 131071 bytes.
230
- */
231
- ciphertext: string;
232
- /**
233
- * The additional data must match the value passed in the encryption request. Only supported by keys with a usage set to `symmetric_encryption`.
234
- */
235
- associatedData?: string;
230
+ /**
231
+ * Region to target. If none is passed will use default region from the config.
232
+ */
233
+ region?: Region;
234
+ /**
235
+ * The key must have an usage set to `symmetric_encryption` or `asymmetric_encryption`.
236
+ */
237
+ keyId: string;
238
+ /**
239
+ * Data size must be between 1 and 131071 bytes.
240
+ */
241
+ ciphertext: string;
242
+ /**
243
+ * The additional data must match the value passed in the encryption request. Only supported by keys with a usage set to `symmetric_encryption`.
244
+ */
245
+ associatedData?: string;
236
246
  };
237
247
  export interface DecryptResponse {
238
- /**
239
- * ID of the key used for decryption.
240
- */
241
- keyId: string;
242
- /**
243
- * Key's decrypted data.
244
- */
245
- plaintext: string;
246
- /**
247
- * If the data was already encrypted with the latest key rotation, no output will be returned in the response object.
248
- */
249
- ciphertext?: string;
248
+ /**
249
+ * ID of the key used for decryption.
250
+ */
251
+ keyId: string;
252
+ /**
253
+ * Key's decrypted data.
254
+ */
255
+ plaintext: string;
256
+ /**
257
+ * If the data was already encrypted with the latest key rotation, no output will be returned in the response object.
258
+ */
259
+ ciphertext?: string;
250
260
  }
251
261
  export type DeleteKeyMaterialRequest = {
252
- /**
253
- * Region to target. If none is passed will use default region from the config.
254
- */
255
- region?: ScwRegion;
256
- /**
257
- * ID of the key of which to delete the key material.
258
- */
259
- keyId: string;
260
- /**
261
- * Default to latest rotation if not set.
262
- */
263
- keyRotationIndex?: number;
262
+ /**
263
+ * Region to target. If none is passed will use default region from the config.
264
+ */
265
+ region?: Region;
266
+ /**
267
+ * ID of the key of which to delete the key material.
268
+ */
269
+ keyId: string;
270
+ /**
271
+ * Default to latest rotation if not set.
272
+ */
273
+ keyRotationIndex?: number;
264
274
  };
265
275
  export type DeleteKeyRequest = {
266
- /**
267
- * Region to target. If none is passed will use default region from the config.
268
- */
269
- region?: ScwRegion;
270
- /**
271
- * ID of the key to delete.
272
- */
273
- keyId: string;
276
+ /**
277
+ * Region to target. If none is passed will use default region from the config.
278
+ */
279
+ region?: Region;
280
+ /**
281
+ * ID of the key to delete.
282
+ */
283
+ keyId: string;
274
284
  };
275
285
  export type DisableKeyRequest = {
276
- /**
277
- * Region to target. If none is passed will use default region from the config.
278
- */
279
- region?: ScwRegion;
280
- /**
281
- * ID of the key to disable.
282
- */
283
- keyId: string;
286
+ /**
287
+ * Region to target. If none is passed will use default region from the config.
288
+ */
289
+ region?: Region;
290
+ /**
291
+ * ID of the key to disable.
292
+ */
293
+ keyId: string;
284
294
  };
285
295
  export type EnableKeyRequest = {
286
- /**
287
- * Region to target. If none is passed will use default region from the config.
288
- */
289
- region?: ScwRegion;
290
- /**
291
- * ID of the key to enable.
292
- */
293
- keyId: string;
296
+ /**
297
+ * Region to target. If none is passed will use default region from the config.
298
+ */
299
+ region?: Region;
300
+ /**
301
+ * ID of the key to enable.
302
+ */
303
+ keyId: string;
294
304
  };
295
305
  export type EncryptRequest = {
296
- /**
297
- * Region to target. If none is passed will use default region from the config.
298
- */
299
- region?: ScwRegion;
300
- /**
301
- * The key must have an usage set to `symmetric_encryption` or `asymmetric_encryption`.
302
- */
303
- keyId: string;
304
- /**
305
- * Data size must be between 1 and 65535 bytes.
306
- */
307
- plaintext: string;
308
- /**
309
- * Additional data which will not be encrypted, but authenticated and appended to the encrypted payload. Only supported by keys with a usage set to `symmetric_encryption`.
310
- */
311
- associatedData?: string;
306
+ /**
307
+ * Region to target. If none is passed will use default region from the config.
308
+ */
309
+ region?: Region;
310
+ /**
311
+ * The key must have an usage set to `symmetric_encryption` or `asymmetric_encryption`.
312
+ */
313
+ keyId: string;
314
+ /**
315
+ * Data size must be between 1 and 65535 bytes.
316
+ */
317
+ plaintext: string;
318
+ /**
319
+ * Additional data which will not be encrypted, but authenticated and appended to the encrypted payload. Only supported by keys with a usage set to `symmetric_encryption`.
320
+ */
321
+ associatedData?: string;
312
322
  };
313
323
  export interface EncryptResponse {
314
- /**
315
- * ID of the key used for encryption.
316
- */
317
- keyId: string;
318
- /**
319
- * Key's encrypted data.
320
- */
321
- ciphertext: string;
324
+ /**
325
+ * ID of the key used for encryption.
326
+ */
327
+ keyId: string;
328
+ /**
329
+ * Key's encrypted data.
330
+ */
331
+ ciphertext: string;
322
332
  }
323
333
  export type GenerateDataKeyRequest = {
324
- /**
325
- * Region to target. If none is passed will use default region from the config.
326
- */
327
- region?: ScwRegion;
328
- /**
329
- * ID of the key.
330
- */
331
- keyId: string;
332
- /**
333
- * See the `DataKey.Algorithm.SymmetricEncryption` enum for a description of values.
334
- */
335
- algorithm?: DataKeyAlgorithmSymmetricEncryption;
336
- /**
334
+ /**
335
+ * Region to target. If none is passed will use default region from the config.
336
+ */
337
+ region?: Region;
338
+ /**
339
+ * ID of the key.
340
+ */
341
+ keyId: string;
342
+ /**
343
+ * See the `DataKey.Algorithm.SymmetricEncryption` enum for a description of values.
344
+ */
345
+ algorithm?: DataKeyAlgorithmSymmetricEncryption;
346
+ /**
337
347
  * Default value is `false`, meaning that the plaintext is returned.
338
348
  Set it to `true` if you do not wish the plaintext to be returned in the response object.
339
349
  */
340
- withoutPlaintext: boolean;
350
+ withoutPlaintext: boolean;
341
351
  };
342
352
  export type GetKeyRequest = {
343
- /**
344
- * Region to target. If none is passed will use default region from the config.
345
- */
346
- region?: ScwRegion;
347
- /**
348
- * ID of the key to target.
349
- */
350
- keyId: string;
353
+ /**
354
+ * Region to target. If none is passed will use default region from the config.
355
+ */
356
+ region?: Region;
357
+ /**
358
+ * ID of the key to target.
359
+ */
360
+ keyId: string;
351
361
  };
352
362
  export type GetPublicKeyRequest = {
353
- /**
354
- * Region to target. If none is passed will use default region from the config.
355
- */
356
- region?: ScwRegion;
357
- /**
358
- * ID of the key.
359
- */
360
- keyId: string;
363
+ /**
364
+ * Region to target. If none is passed will use default region from the config.
365
+ */
366
+ region?: Region;
367
+ /**
368
+ * ID of the key.
369
+ */
370
+ keyId: string;
361
371
  };
362
372
  export type ImportKeyMaterialRequest = {
363
- /**
364
- * Region to target. If none is passed will use default region from the config.
365
- */
366
- region?: ScwRegion;
367
- /**
368
- * The key's origin must be `external`.
369
- */
370
- keyId: string;
371
- /**
372
- * The key material is a random sequence of bytes used to derive a cryptographic key.
373
- */
374
- keyMaterial: string;
375
- /**
376
- * A salt is random data added to key material to ensure unique derived keys, even if the input is similar. It helps strengthen security when the key material has low randomness (low entropy).
377
- */
378
- salt?: string;
373
+ /**
374
+ * Region to target. If none is passed will use default region from the config.
375
+ */
376
+ region?: Region;
377
+ /**
378
+ * The key's origin must be `external`.
379
+ */
380
+ keyId: string;
381
+ /**
382
+ * The key material is a random sequence of bytes used to derive a cryptographic key.
383
+ */
384
+ keyMaterial: string;
385
+ /**
386
+ * A salt is random data added to key material to ensure unique derived keys, even if the input is similar. It helps strengthen security when the key material has low randomness (low entropy).
387
+ */
388
+ salt?: string;
379
389
  };
380
390
  export type ListAlgorithmsRequest = {
381
- /**
382
- * Region to target. If none is passed will use default region from the config.
383
- */
384
- region?: ScwRegion;
385
- /**
386
- * Filter by key usage.
387
- */
388
- usages?: ListAlgorithmsRequestUsage[];
391
+ /**
392
+ * Region to target. If none is passed will use default region from the config.
393
+ */
394
+ region?: Region;
395
+ /**
396
+ * Filter by key usage.
397
+ */
398
+ usages?: ListAlgorithmsRequestUsage[];
389
399
  };
390
400
  export interface ListAlgorithmsResponse {
391
- /**
392
- * Returns a list of algorithms matching the requested criteria.
393
- */
394
- algorithms: ListAlgorithmsResponseAlgorithm[];
401
+ /**
402
+ * Returns a list of algorithms matching the requested criteria.
403
+ */
404
+ algorithms: ListAlgorithmsResponseAlgorithm[];
395
405
  }
396
406
  export type ListKeyRotationsRequest = {
397
- /**
398
- * Region to target. If none is passed will use default region from the config.
399
- */
400
- region?: ScwRegion;
401
- /**
402
- * ID of the key to list rotations for.
403
- */
404
- keyId: string;
405
- orderBy?: ListKeyRotationsRequestOrderBy;
406
- page?: number;
407
- pageSize?: number;
408
- /**
409
- * See the `KeyRotation.Status` enum for a description of possible values.
410
- */
411
- status?: KeyRotationStatus[];
407
+ /**
408
+ * Region to target. If none is passed will use default region from the config.
409
+ */
410
+ region?: Region;
411
+ /**
412
+ * ID of the key to list rotations for.
413
+ */
414
+ keyId: string;
415
+ orderBy?: ListKeyRotationsRequestOrderBy;
416
+ page?: number;
417
+ pageSize?: number;
418
+ /**
419
+ * See the `KeyRotation.Status` enum for a description of possible values.
420
+ */
421
+ status?: KeyRotationStatus[];
412
422
  };
413
423
  export interface ListKeyRotationsResponse {
414
- /**
415
- * Single page of key rotations matching the requested criteria.
416
- */
417
- rotations: KeyRotation[];
418
- /**
419
- * Total count of key rotations matching the requested criteria.
420
- */
421
- totalCount: number;
424
+ /**
425
+ * Single page of key rotations matching the requested criteria.
426
+ */
427
+ rotations: KeyRotation[];
428
+ /**
429
+ * Total count of key rotations matching the requested criteria.
430
+ */
431
+ totalCount: number;
422
432
  }
423
433
  export type ListKeysRequest = {
424
- /**
425
- * Region to target. If none is passed will use default region from the config.
426
- */
427
- region?: ScwRegion;
428
- /**
429
- * (Optional) Filter by Organization ID.
430
- */
431
- organizationId?: string;
432
- /**
433
- * (Optional) Filter by Project ID.
434
- */
435
- projectId?: string;
436
- orderBy?: ListKeysRequestOrderBy;
437
- page?: number;
438
- pageSize?: number;
439
- /**
440
- * (Optional) List of tags to filter on.
441
- */
442
- tags?: string[];
443
- /**
444
- * (Optional) Filter by key name.
445
- */
446
- name?: string;
447
- /**
448
- * Select from symmetric encryption, asymmetric encryption, or asymmetric signing.
449
- */
450
- usage?: ListKeysRequestUsage;
451
- /**
452
- * Filter keys based on their deletion status. By default, only keys not scheduled for deletion are returned in the output.
453
- */
454
- scheduledForDeletion: boolean;
434
+ /**
435
+ * Region to target. If none is passed will use default region from the config.
436
+ */
437
+ region?: Region;
438
+ /**
439
+ * (Optional) Filter by Organization ID.
440
+ */
441
+ organizationId?: string;
442
+ /**
443
+ * (Optional) Filter by Project ID.
444
+ */
445
+ projectId?: string;
446
+ orderBy?: ListKeysRequestOrderBy;
447
+ page?: number;
448
+ pageSize?: number;
449
+ /**
450
+ * (Optional) List of tags to filter on.
451
+ */
452
+ tags?: string[];
453
+ /**
454
+ * (Optional) Filter by key name.
455
+ */
456
+ name?: string;
457
+ /**
458
+ * Select from symmetric encryption, asymmetric encryption, asymmetric signing or key_encapsulation.
459
+ */
460
+ usage?: ListKeysRequestUsage;
461
+ /**
462
+ * Filter keys based on their deletion status. By default, only keys not scheduled for deletion are returned in the output.
463
+ */
464
+ scheduledForDeletion: boolean;
465
+ /**
466
+ * Select from software or hsm.
467
+ */
468
+ protectionLevel?: KeyProtectionLevel;
455
469
  };
456
470
  export interface ListKeysResponse {
457
- /**
458
- * Single page of keys matching the requested criteria.
459
- */
460
- keys: Key[];
461
- /**
462
- * Total count of keys matching the requested criteria.
463
- */
464
- totalCount: number;
471
+ /**
472
+ * Single page of keys matching the requested criteria.
473
+ */
474
+ keys: Key[];
475
+ /**
476
+ * Total count of keys matching the requested criteria.
477
+ */
478
+ totalCount: number;
465
479
  }
466
480
  export type ProtectKeyRequest = {
467
- /**
468
- * Region to target. If none is passed will use default region from the config.
469
- */
470
- region?: ScwRegion;
471
- /**
472
- * ID of the key to apply key protection to.
473
- */
474
- keyId: string;
481
+ /**
482
+ * Region to target. If none is passed will use default region from the config.
483
+ */
484
+ region?: Region;
485
+ /**
486
+ * ID of the key to apply key protection to.
487
+ */
488
+ keyId: string;
475
489
  };
476
490
  export interface PublicKey {
477
- pem: string;
491
+ pem: string;
478
492
  }
479
493
  export type RestoreKeyRequest = {
480
- /**
481
- * Region to target. If none is passed will use default region from the config.
482
- */
483
- region?: ScwRegion;
484
- keyId: string;
494
+ /**
495
+ * Region to target. If none is passed will use default region from the config.
496
+ */
497
+ region?: Region;
498
+ keyId: string;
485
499
  };
486
500
  export type RotateKeyRequest = {
487
- /**
488
- * Region to target. If none is passed will use default region from the config.
489
- */
490
- region?: ScwRegion;
491
- /**
492
- * ID of the key to rotate.
493
- */
494
- keyId: string;
501
+ /**
502
+ * Region to target. If none is passed will use default region from the config.
503
+ */
504
+ region?: Region;
505
+ /**
506
+ * ID of the key to rotate.
507
+ */
508
+ keyId: string;
495
509
  };
496
510
  export type SignRequest = {
497
- /**
498
- * Region to target. If none is passed will use default region from the config.
499
- */
500
- region?: ScwRegion;
501
- /**
502
- * ID of the key to use for signing.
503
- */
504
- keyId: string;
505
- /**
506
- * The digest must be generated using the same algorithm defined in the key’s algorithm settings.
507
- */
508
- digest: string;
511
+ /**
512
+ * Region to target. If none is passed will use default region from the config.
513
+ */
514
+ region?: Region;
515
+ /**
516
+ * ID of the key to use for signing.
517
+ */
518
+ keyId: string;
519
+ /**
520
+ * The digest must be generated using the same algorithm defined in the key’s algorithm settings.
521
+ */
522
+ digest: string;
509
523
  };
510
524
  export interface SignResponse {
511
- /**
512
- * ID of the key used to generate the signature.
513
- */
514
- keyId: string;
515
- /**
516
- * The message signature.
517
- */
518
- signature: string;
525
+ /**
526
+ * ID of the key used to generate the signature.
527
+ */
528
+ keyId: string;
529
+ /**
530
+ * The message signature.
531
+ */
532
+ signature: string;
519
533
  }
520
534
  export type UnprotectKeyRequest = {
521
- /**
522
- * Region to target. If none is passed will use default region from the config.
523
- */
524
- region?: ScwRegion;
525
- /**
526
- * ID of the key to remove key protection from.
527
- */
528
- keyId: string;
535
+ /**
536
+ * Region to target. If none is passed will use default region from the config.
537
+ */
538
+ region?: Region;
539
+ /**
540
+ * ID of the key to remove key protection from.
541
+ */
542
+ keyId: string;
529
543
  };
530
544
  export type UnwrapKeyRequest = {
531
- /**
532
- * Region to target. If none is passed will use default region from the config.
533
- */
534
- region?: ScwRegion;
535
- keyId: string;
536
- ciphertext: string;
537
- associatedData?: string;
545
+ /**
546
+ * Region to target. If none is passed will use default region from the config.
547
+ */
548
+ region?: Region;
549
+ keyId: string;
550
+ ciphertext: string;
551
+ associatedData?: string;
538
552
  };
539
553
  export interface UnwrapKeyResponse {
540
- keyId: string;
541
- plaintext: string;
554
+ keyId: string;
555
+ plaintext: string;
542
556
  }
543
557
  export type UpdateKeyRequest = {
544
- /**
545
- * Region to target. If none is passed will use default region from the config.
546
- */
547
- region?: ScwRegion;
548
- /**
549
- * ID of the key to update.
550
- */
551
- keyId: string;
552
- /**
553
- * (Optional) Updated name of the key.
554
- */
555
- name?: string;
556
- /**
557
- * (Optional) Updated description of the key.
558
- */
559
- description?: string;
560
- /**
561
- * (Optional) Updated list of the key's tags.
562
- */
563
- tags?: string[];
564
- /**
565
- * If not specified, the key's existing rotation policy applies.
566
- */
567
- rotationPolicy?: KeyRotationPolicy;
558
+ /**
559
+ * Region to target. If none is passed will use default region from the config.
560
+ */
561
+ region?: Region;
562
+ /**
563
+ * ID of the key to update.
564
+ */
565
+ keyId: string;
566
+ /**
567
+ * (Optional) Updated name of the key.
568
+ */
569
+ name?: string;
570
+ /**
571
+ * (Optional) Updated description of the key.
572
+ */
573
+ description?: string;
574
+ /**
575
+ * (Optional) Updated list of the key's tags.
576
+ */
577
+ tags?: string[];
578
+ /**
579
+ * If not specified, the key's existing rotation policy applies.
580
+ */
581
+ rotationPolicy?: KeyRotationPolicy;
568
582
  };
569
583
  export type VerifyRequest = {
570
- /**
571
- * Region to target. If none is passed will use default region from the config.
572
- */
573
- region?: ScwRegion;
574
- /**
575
- * ID of the key to use for signature verification.
576
- */
577
- keyId: string;
578
- /**
579
- * Must be generated using the same algorithm specified in the key’s configuration.
580
- */
581
- digest: string;
582
- /**
583
- * The message signature to verify.
584
- */
585
- signature: string;
584
+ /**
585
+ * Region to target. If none is passed will use default region from the config.
586
+ */
587
+ region?: Region;
588
+ /**
589
+ * ID of the key to use for signature verification.
590
+ */
591
+ keyId: string;
592
+ /**
593
+ * Must be generated using the same algorithm specified in the key’s configuration.
594
+ */
595
+ digest: string;
596
+ /**
597
+ * The message signature to verify.
598
+ */
599
+ signature: string;
586
600
  };
587
601
  export interface VerifyResponse {
588
- /**
589
- * ID of the key used for verification.
590
- */
591
- keyId: string;
592
- /**
593
- * Returns `true` if the signature is valid for the digest and key, and `false` otherwise.
594
- */
595
- valid: boolean;
602
+ /**
603
+ * ID of the key used for verification.
604
+ */
605
+ keyId: string;
606
+ /**
607
+ * Returns `true` if the signature is valid for the digest and key, and `false` otherwise.
608
+ */
609
+ valid: boolean;
596
610
  }
597
611
  export type WrapKeyRequest = {
598
- /**
599
- * Region to target. If none is passed will use default region from the config.
600
- */
601
- region?: ScwRegion;
602
- keyId: string;
603
- plaintext: string;
604
- associatedData?: string;
612
+ /**
613
+ * Region to target. If none is passed will use default region from the config.
614
+ */
615
+ region?: Region;
616
+ keyId: string;
617
+ plaintext: string;
618
+ associatedData?: string;
605
619
  };
606
620
  export interface WrapKeyResponse {
607
- keyId: string;
608
- ciphertext: string;
621
+ keyId: string;
622
+ ciphertext: string;
609
623
  }
624
+ //#endregion