Skip to content

Commit 60bbf26

Browse files
authored
KMS: Makes samples consistent across languages. (GoogleCloudPlatform#461)
This change, in particular: * Consistently names variables with the API (locationId, keyRingId, cryptoKeyId). * Displays the function name in the region tag. * Correctly writes decoded base64 to disk and encodes file contents before calling KMS. * Correctly loads decoded base64 from disk. * Labels parameters as plaintextFileName and ciphertextFileName, rather than inFile and outFile where applicable. * Makes test failure messages more readable.
1 parent 1df42ed commit 60bbf26

3 files changed

Lines changed: 210 additions & 208 deletions

File tree

kms/README.md

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,19 @@ __Usage:__ `node keys.js --help`
3939

4040
```
4141
Commands:
42-
create <keyRingName> <keyName> Creates a crypto key.
43-
decrypt <keyRingName> <keyName> <infile> <outfile> Decrypts a file.
44-
encrypt <keyRingName> <keyName> <infile> <outfile> Encrypts a file.
45-
get <keyRingName> <keyName> Gets a crypto key.
46-
get-policy <keyRingName> <keyName> Gets a crypto key's IAM policy.
47-
grant-access <keyRingName> <keyName> <member> <role> Adds a members to a crypto key's IAM policy.
48-
keyrings <command> Access key rings subcommands.
49-
list <keyRingName> Lists crypto keys.
50-
revoke-access <keyRingName> <keyName> <member> <role> Removes a member from a crypto key's IAM policy.
51-
set-primary <keyRingName> <keyName> <version> Sets a crypto key's primary version.
52-
versions <command> Access crypto key versions subcommands.
42+
create <keyRing> <cryptoKey> Creates a crypto key.
43+
decrypt <keyRing> <cryptoKey> <ciphertextFileName> Decrypts a file.
44+
<plaintextFileName>
45+
encrypt <keyRing> <cryptoKey> <plaintextFileName> Encrypts a file.
46+
<ciphertextFileName>
47+
get <keyRing> <cryptoKey> Gets a crypto key.
48+
get-policy <keyRing> <cryptoKey> Gets a crypto key's IAM policy.
49+
grant-access <keyRing> <cryptoKey> <member> <role> Adds a members to a crypto key's IAM policy.
50+
keyrings <command> Access key rings subcommands.
51+
list <keyRing> Lists crypto keys.
52+
revoke-access <keyRing> <cryptoKey> <member> <role> Removes a member from a crypto key's IAM policy.
53+
set-primary <keyRing> <cryptoKey> <version> Sets a crypto key's primary version.
54+
versions <command> Access crypto key versions subcommands.
5355
5456
Options:
5557
--help Show help [boolean]

0 commit comments

Comments
 (0)