66 urlParams ,
77 validatePathParam ,
88} from '../../../bridge'
9- import type { Region } from '../../../bridge'
9+ import type { Region as ScwRegion } from '../../../bridge'
1010import {
1111 marshalCreateKeyRequest ,
1212 marshalDecryptRequest ,
@@ -55,13 +55,17 @@ const jsonContentHeaders = {
5555 */
5656export class API extends ParentAPI {
5757 /** Lists the available regions of the API. */
58- public static readonly LOCALITIES : Region [ ] = [ 'fr-par' , 'nl-ams' , 'pl-waw' ]
58+ public static readonly LOCALITIES : ScwRegion [ ] = [
59+ 'fr-par' ,
60+ 'nl-ams' ,
61+ 'pl-waw' ,
62+ ]
5963
6064 /**
6165 * Create a key. Create a key in a given region specified by the `region`
6266 * parameter. Keys only support symmetric encryption. You can use keys to
63- * encrypt or decrypt arbitrary payloads, or to generate data encryption keys
64- * that can be used without being stored in Key Manager.
67+ * encrypt or decrypt arbitrary payloads, or to generate data encryption keys.
68+ * **Data encryption keys are not stored in Key Manager** .
6569 *
6670 * @param request - The request {@link CreateKeyRequest}
6771 * @returns A Promise of Key
@@ -80,7 +84,7 @@ export class API extends ParentAPI {
8084 )
8185
8286 /**
83- * Get key metadata. Retrieve the metadata of a key specified by the `region`
87+ * Get key metadata. Retrieve metadata for a specified key using the `region`
8488 * and `key_id` parameters.
8589 *
8690 * @param request - The request {@link GetKeyRequest}
@@ -96,7 +100,7 @@ export class API extends ParentAPI {
96100 )
97101
98102 /**
99- * Update a key. Update a key's metadata ( name, description and tags) ,
103+ * Update a key. Modify a key's metadata including name, description and tags,
100104 * specified by the `key_id` and `region` parameters.
101105 *
102106 * @param request - The request {@link UpdateKeyRequest}
@@ -116,10 +120,9 @@ export class API extends ParentAPI {
116120 )
117121
118122 /**
119- * Delete a key. Delete an existing key specified by the `region` and `key_id`
120- * parameters. Deleting a key is permanent and cannot be undone. All data
121- * encrypted using this key, including data encryption keys, will become
122- * unusable.
123+ * Delete a key. Permanently delete a key specified by the `region` and
124+ * `key_id` parameters. This action is irreversible. Any data encrypted with
125+ * this key, including data encryption keys, will no longer be decipherable.
123126 *
124127 * @param request - The request {@link DeleteKeyRequest}
125128 */
@@ -130,10 +133,10 @@ export class API extends ParentAPI {
130133 } )
131134
132135 /**
133- * Rotate a key. Generate a new version of an existing key with randomly
134- * generated key material. Rotated keys can still be used to decrypt
135- * previously encrypted data. The key's new material will be used for
136- * subsequent encryption operations and data key generation.
136+ * Rotate a key. Generate a new version of an existing key with new key
137+ * material. Previous key versions remain usable to decrypt previously
138+ * encrypted data, but the key's new version will be used for subsequent
139+ * encryption operations and data key generation.
137140 *
138141 * @param request - The request {@link RotateKeyRequest}
139142 * @returns A Promise of Key
@@ -150,7 +153,7 @@ export class API extends ParentAPI {
150153 )
151154
152155 /**
153- * Apply key protection. Apply key protection to a given key specified by the
156+ * Apply key protection. Apply protection to a given key specified by the
154157 * `key_id` parameter. Applying key protection means that your key can be used
155158 * and modified, but it cannot be deleted.
156159 *
@@ -207,9 +210,9 @@ export class API extends ParentAPI {
207210 )
208211
209212 /**
210- * Disable key. Disable a given key to be used for cryptographic operations.
211- * Disabling a key renders it unusable. You must specify the `region` and
212- * `key_id` parameters.
213+ * Disable key. Disable a given key, preventing it to be used for
214+ * cryptographic operations. Disabling a key renders it unusable. You must
215+ * specify the `region` and `key_id` parameters.
213216 *
214217 * @param request - The request {@link DisableKeyRequest}
215218 * @returns A Promise of Key
@@ -247,9 +250,9 @@ export class API extends ParentAPI {
247250 )
248251
249252 /**
250- * List keys. Retrieve the list of keys created within all Projects of an
251- * Organization or in a given Project. You must specify the `region`, and
252- * either the `organization_id` or the `project_id`.
253+ * List keys. Retrieve a list of keys across all Projects in an Organization
254+ * or within a specific Project. You must specify the `region`, and either the
255+ * `organization_id` or the `project_id`.
253256 *
254257 * @param request - The request {@link ListKeysRequest}
255258 * @returns A Promise of ListKeysResponse
@@ -258,16 +261,15 @@ export class API extends ParentAPI {
258261 enrichForPagination ( 'keys' , this . pageOfListKeys , request )
259262
260263 /**
261- * Generate a data encryption key. Generate a new data encryption key to use
262- * for cryptographic operations outside of Key Manager. Note that Key Manager
263- * does not store your data encryption key. The data encryption key is
264+ * Create a data encryption key. Create a new data encryption key for
265+ * cryptographic operations outside of Key Manager. The data encryption key is
264266 * encrypted and must be decrypted using the key you have created in Key
265- * Manager. The data encryption key's plaintext is returned in the response
266- * object, for immediate usage.
267+ * Manager.
267268 *
268- * Always store the data encryption key's ciphertext, rather than its
269- * plaintext, which must not be stored. To retrieve your key's plaintext, call
270- * the Decrypt endpoint with your key's ID and ciphertext.
269+ * The data encryption key is returned in plaintext and ciphertext but it
270+ * should only be stored in its encrypted form (ciphertext). Key Manager does
271+ * not store your data encryption key. To retrieve your key's plaintext, use
272+ * the `Decrypt` method with your key's ID and ciphertext.
271273 *
272274 * @param request - The request {@link GenerateDataKeyRequest}
273275 * @returns A Promise of DataKey
@@ -286,10 +288,10 @@ export class API extends ParentAPI {
286288 )
287289
288290 /**
289- * Encrypt data . Encrypt data using an existing key, specified by the `key_id`
290- * parameter. Only keys with a usage set to **symmetric_encryption** are
291- * supported by this method. The maximum payload size that can be encrypted is
292- * 64KB of plaintext.
291+ * Encrypt a payload . Encrypt a payload using an existing key, specified by
292+ * the `key_id` parameter. Only keys with a usage set to
293+ * `symmetric_encryption` are supported by this method. The maximum payload
294+ * size that can be encrypted is 64 KB of plaintext.
293295 *
294296 * @param request - The request {@link EncryptRequest}
295297 * @returns A Promise of EncryptResponse
@@ -308,9 +310,10 @@ export class API extends ParentAPI {
308310 )
309311
310312 /**
311- * Decrypt data. Decrypt data using an existing key, specified by the `key_id`
312- * parameter. The maximum payload size that can be decrypted is the result of
313- * the encryption of 64KB of data (around 131KB).
313+ * Decrypt an encrypted payload. Decrypt an encrypted payload using an
314+ * existing key, specified by the `key_id` parameter. The maximum payload size
315+ * that can be decrypted is equivalent to the encrypted output of 64 KB of
316+ * data (around 131 KB).
314317 *
315318 * @param request - The request {@link DecryptRequest}
316319 * @returns A Promise of DecryptResponse
@@ -329,8 +332,9 @@ export class API extends ParentAPI {
329332 )
330333
331334 /**
332- * Import key material. Import key material to use to derive a new
333- * cryptographic key. The key's origin must be `external`.
335+ * Import key material. Import externally generated key material into Key
336+ * Manager to derive a new cryptographic key. The key's origin must be
337+ * `external`.
334338 *
335339 * @param request - The request {@link ImportKeyMaterialRequest}
336340 * @returns A Promise of Key
0 commit comments