Skip to content

Commit 321fffa

Browse files
authored
feat(key_manager): review wording (scaleway#2413)
1 parent f6fc755 commit 321fffa

File tree

1 file changed

+26
-26
lines changed

1 file changed

+26
-26
lines changed

api/key_manager/v1alpha1/key_manager_sdk.go

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ type DataKeyAlgorithmSymmetricEncryption string
4343

4444
const (
4545
DataKeyAlgorithmSymmetricEncryptionUnknownSymmetricEncryption = DataKeyAlgorithmSymmetricEncryption("unknown_symmetric_encryption")
46-
// AES-GCM (256-bits) is the only data key algorithm currently supported by Key Manager.
46+
// Key Manager currently only supports the `AES-GCM` (256-bits) data key algorithm.
4747
DataKeyAlgorithmSymmetricEncryptionAes256Gcm = DataKeyAlgorithmSymmetricEncryption("aes_256_gcm")
4848
)
4949

@@ -81,7 +81,7 @@ type KeyAlgorithmSymmetricEncryption string
8181

8282
const (
8383
KeyAlgorithmSymmetricEncryptionUnknownSymmetricEncryption = KeyAlgorithmSymmetricEncryption("unknown_symmetric_encryption")
84-
// AES-GCM (256-bits) is the only key algorithm currently supported by Key Manager.
84+
// Key Manager currently only supports the `AES-GCM` (256-bits) key algorithm.
8585
KeyAlgorithmSymmetricEncryptionAes256Gcm = KeyAlgorithmSymmetricEncryption("aes_256_gcm")
8686
)
8787

@@ -119,9 +119,9 @@ type KeyOrigin string
119119

120120
const (
121121
KeyOriginUnknownOrigin = KeyOrigin("unknown_origin")
122-
// Scaleway Key Manager generates the key material upon key creation.
122+
// Key Manager generates the key material upon key creation.
123123
KeyOriginScalewayKms = KeyOrigin("scaleway_kms")
124-
// Scaleway Key Manager creates a key with key material coming from an external source.
124+
// Key Manager creates a key with key material coming from an external source.
125125
KeyOriginExternal = KeyOrigin("external")
126126
)
127127

@@ -247,10 +247,10 @@ func (enum *ListKeysRequestOrderBy) UnmarshalJSON(data []byte) error {
247247

248248
// KeyRotationPolicy: key rotation policy.
249249
type KeyRotationPolicy struct {
250-
// RotationPeriod: duration between two key rotations. The minimum duration is 24 hours and the maximum duration is 876000 hours (1 year).
250+
// RotationPeriod: time interval between two key rotations. The minimum duration is 24 hours and the maximum duration is 1 year (876000 hours).
251251
RotationPeriod *scw.Duration `json:"rotation_period"`
252252

253-
// NextRotationAt: date at which the key will be rotated next.
253+
// NextRotationAt: timestamp indicating the next scheduled rotation.
254254
NextRotationAt *time.Time `json:"next_rotation_at"`
255255
}
256256

@@ -273,14 +273,14 @@ type Key struct {
273273
// Name: name of the key.
274274
Name string `json:"name"`
275275

276-
// Usage: keys with a usage set to `symmetric_encryption` are used to encrypt and decrypt data. The only key algorithm currently supported by Key Manager is AES-256-GCM.
276+
// Usage: keys with a usage set to `symmetric_encryption` can encrypt and decrypt data using the `AES-256-GCM` key algorithm. Key Manager currently only supports `AES-256-GCM`.
277277
Usage *KeyUsage `json:"usage"`
278278

279-
// State: see the `Key.State` enum for a description of values.
279+
// State: see the `Key.State` enum for a description of possible values.
280280
// Default value: unknown_state
281281
State KeyState `json:"state"`
282282

283-
// RotationCount: the rotation count tracks the amount of times that the key was rotated.
283+
// RotationCount: the rotation count tracks the number of times the key has been rotated.
284284
RotationCount uint32 `json:"rotation_count"`
285285

286286
// CreatedAt: key creation date.
@@ -311,7 +311,7 @@ type Key struct {
311311
// Default value: unknown_origin
312312
Origin KeyOrigin `json:"origin"`
313313

314-
// Region: region of the key.
314+
// Region: region where the key is stored.
315315
Region scw.Region `json:"region"`
316316
}
317317

@@ -351,7 +351,7 @@ type DataKey struct {
351351
// KeyID: ID of the data encryption key.
352352
KeyID string `json:"key_id"`
353353

354-
// Algorithm: symmetric encryption algorithm of the data encryption key.
354+
// Algorithm: symmetric encryption algorithm of the data encryption key (`AES-256-GCM`).
355355
// Default value: unknown_symmetric_encryption
356356
Algorithm DataKeyAlgorithmSymmetricEncryption `json:"algorithm"`
357357

@@ -483,13 +483,13 @@ type ImportKeyMaterialRequest struct {
483483
// Region: region to target. If none is passed will use default region from the config.
484484
Region scw.Region `json:"-"`
485485

486-
// KeyID: the key's origin must be 'external'.
486+
// KeyID: the key's origin must be `external`.
487487
KeyID string `json:"-"`
488488

489489
// KeyMaterial: the key material The key material is a random sequence of bytes used to derive a cryptographic key.
490490
KeyMaterial []byte `json:"key_material"`
491491

492-
// Salt: a salt can be used to improve the quality of randomness when the key material is generated from a low entropy source.
492+
// Salt: 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).
493493
Salt *[]byte `json:"salt,omitempty"`
494494
}
495495

@@ -609,7 +609,7 @@ func (s *API) Regions() []scw.Region {
609609
return []scw.Region{scw.RegionFrPar, scw.RegionNlAms, scw.RegionPlWaw}
610610
}
611611

612-
// CreateKey: Create a key in a given region specified by the `region` parameter. Keys only support symmetric encryption. You can use keys to encrypt or decrypt arbitrary payloads, or to generate data encryption keys that can be used without being stored in Key Manager.
612+
// CreateKey: Create a key in a given region specified by the `region` parameter. Keys only support symmetric encryption. You can use keys to encrypt or decrypt arbitrary payloads, or to generate data encryption keys. **Data encryption keys are not stored in Key Manager**.
613613
func (s *API) CreateKey(req *CreateKeyRequest, opts ...scw.RequestOption) (*Key, error) {
614614
var err error
615615

@@ -646,7 +646,7 @@ func (s *API) CreateKey(req *CreateKeyRequest, opts ...scw.RequestOption) (*Key,
646646
return &resp, nil
647647
}
648648

649-
// GetKey: Retrieve the metadata of a key specified by the `region` and `key_id` parameters.
649+
// GetKey: Retrieve metadata for a specified key using the `region` and `key_id` parameters.
650650
func (s *API) GetKey(req *GetKeyRequest, opts ...scw.RequestOption) (*Key, error) {
651651
var err error
652652

@@ -677,7 +677,7 @@ func (s *API) GetKey(req *GetKeyRequest, opts ...scw.RequestOption) (*Key, error
677677
return &resp, nil
678678
}
679679

680-
// UpdateKey: Update a key's metadata (name, description and tags), specified by the `key_id` and `region` parameters.
680+
// UpdateKey: Modify a key's metadata including name, description and tags, specified by the `key_id` and `region` parameters.
681681
func (s *API) UpdateKey(req *UpdateKeyRequest, opts ...scw.RequestOption) (*Key, error) {
682682
var err error
683683

@@ -713,7 +713,7 @@ func (s *API) UpdateKey(req *UpdateKeyRequest, opts ...scw.RequestOption) (*Key,
713713
return &resp, nil
714714
}
715715

716-
// DeleteKey: Delete an existing key specified by the `region` and `key_id` parameters. Deleting a key is permanent and cannot be undone. All data encrypted using this key, including data encryption keys, will become unusable.
716+
// DeleteKey: Permanently delete a key specified by the `region` and `key_id` parameters. This action is irreversible. Any data encrypted with this key, including data encryption keys, will no longer be decipherable.
717717
func (s *API) DeleteKey(req *DeleteKeyRequest, opts ...scw.RequestOption) error {
718718
var err error
719719

@@ -742,7 +742,7 @@ func (s *API) DeleteKey(req *DeleteKeyRequest, opts ...scw.RequestOption) error
742742
return nil
743743
}
744744

745-
// RotateKey: Generate a new version of an existing key with randomly generated key material. Rotated keys can still be used to decrypt previously encrypted data. The key's new material will be used for subsequent encryption operations and data key generation.
745+
// RotateKey: Generate a new version of an existing key with new key material. Previous key versions remain usable to decrypt previously encrypted data, but the key's new version will be used for subsequent encryption operations and data key generation.
746746
func (s *API) RotateKey(req *RotateKeyRequest, opts ...scw.RequestOption) (*Key, error) {
747747
var err error
748748

@@ -778,7 +778,7 @@ func (s *API) RotateKey(req *RotateKeyRequest, opts ...scw.RequestOption) (*Key,
778778
return &resp, nil
779779
}
780780

781-
// ProtectKey: Apply key protection to a given key specified by the `key_id` parameter. Applying key protection means that your key can be used and modified, but it cannot be deleted.
781+
// ProtectKey: Apply protection to a given key specified by the `key_id` parameter. Applying key protection means that your key can be used and modified, but it cannot be deleted.
782782
func (s *API) ProtectKey(req *ProtectKeyRequest, opts ...scw.RequestOption) (*Key, error) {
783783
var err error
784784

@@ -886,7 +886,7 @@ func (s *API) EnableKey(req *EnableKeyRequest, opts ...scw.RequestOption) (*Key,
886886
return &resp, nil
887887
}
888888

889-
// DisableKey: Disable a given key to be used for cryptographic operations. Disabling a key renders it unusable. You must specify the `region` and `key_id` parameters.
889+
// DisableKey: Disable a given key, preventing it to be used for cryptographic operations. Disabling a key renders it unusable. You must specify the `region` and `key_id` parameters.
890890
func (s *API) DisableKey(req *DisableKeyRequest, opts ...scw.RequestOption) (*Key, error) {
891891
var err error
892892

@@ -922,7 +922,7 @@ func (s *API) DisableKey(req *DisableKeyRequest, opts ...scw.RequestOption) (*Ke
922922
return &resp, nil
923923
}
924924

925-
// ListKeys: Retrieve the list of keys created within all Projects of an Organization or in a given Project. You must specify the `region`, and either the `organization_id` or the `project_id`.
925+
// ListKeys: Retrieve a list of keys across all Projects in an Organization or within a specific Project. You must specify the `region`, and either the `organization_id` or the `project_id`.
926926
func (s *API) ListKeys(req *ListKeysRequest, opts ...scw.RequestOption) (*ListKeysResponse, error) {
927927
var err error
928928

@@ -964,9 +964,9 @@ func (s *API) ListKeys(req *ListKeysRequest, opts ...scw.RequestOption) (*ListKe
964964
return &resp, nil
965965
}
966966

967-
// GenerateDataKey: Generate a new data encryption key to use for cryptographic operations outside of Key Manager. Note that Key Manager does not store your data encryption key. The data encryption key is encrypted and must be decrypted using the key you have created in Key Manager. The data encryption key's plaintext is returned in the response object, for immediate usage.
967+
// GenerateDataKey: Create a new data encryption key for cryptographic operations outside of Key Manager. The data encryption key is encrypted and must be decrypted using the key you have created in Key Manager.
968968
//
969-
// Always store the data encryption key's ciphertext, rather than its plaintext, which must not be stored. To retrieve your key's plaintext, call the Decrypt endpoint with your key's ID and ciphertext.
969+
// The data encryption key is returned in plaintext and ciphertext but it should only be stored in its encrypted form (ciphertext). Key Manager does not store your data encryption key. To retrieve your key's plaintext, use the `Decrypt` method with your key's ID and ciphertext.
970970
func (s *API) GenerateDataKey(req *GenerateDataKeyRequest, opts ...scw.RequestOption) (*DataKey, error) {
971971
var err error
972972

@@ -1002,7 +1002,7 @@ func (s *API) GenerateDataKey(req *GenerateDataKeyRequest, opts ...scw.RequestOp
10021002
return &resp, nil
10031003
}
10041004

1005-
// Encrypt: Encrypt data using an existing key, specified by the `key_id` parameter. Only keys with a usage set to **symmetric_encryption** are supported by this method. The maximum payload size that can be encrypted is 64KB of plaintext.
1005+
// Encrypt: Encrypt a payload using an existing key, specified by the `key_id` parameter. Only keys with a usage set to `symmetric_encryption` are supported by this method. The maximum payload size that can be encrypted is 64 KB of plaintext.
10061006
func (s *API) Encrypt(req *EncryptRequest, opts ...scw.RequestOption) (*EncryptResponse, error) {
10071007
var err error
10081008

@@ -1038,7 +1038,7 @@ func (s *API) Encrypt(req *EncryptRequest, opts ...scw.RequestOption) (*EncryptR
10381038
return &resp, nil
10391039
}
10401040

1041-
// Decrypt: Decrypt data using an existing key, specified by the `key_id` parameter. The maximum payload size that can be decrypted is the result of the encryption of 64KB of data (around 131KB).
1041+
// Decrypt: Decrypt an encrypted payload using an existing key, specified by the `key_id` parameter. The maximum payload size that can be decrypted is equivalent to the encrypted output of 64 KB of data (around 131 KB).
10421042
func (s *API) Decrypt(req *DecryptRequest, opts ...scw.RequestOption) (*DecryptResponse, error) {
10431043
var err error
10441044

@@ -1074,7 +1074,7 @@ func (s *API) Decrypt(req *DecryptRequest, opts ...scw.RequestOption) (*DecryptR
10741074
return &resp, nil
10751075
}
10761076

1077-
// ImportKeyMaterial: Import key material to use to derive a new cryptographic key. The key's origin must be `external`.
1077+
// ImportKeyMaterial: Import externally generated key material into Key Manager to derive a new cryptographic key. The key's origin must be `external`.
10781078
func (s *API) ImportKeyMaterial(req *ImportKeyMaterialRequest, opts ...scw.RequestOption) (*Key, error) {
10791079
var err error
10801080

0 commit comments

Comments
 (0)