I want to encrypt a key file with the gcloud
command line tool.
The command I am running is:
gcloud kms encrypt --project=pname --location=global --keyring=keyring \
--key=key-credential \
--plaintext-file=/Users/macuser/Desktop/test/keys/testkey.json.decrypted \
--ciphertext-file=testkey.json.encrypted
but I keep getting the error
ERROR: (gcloud.kms.encrypt) Failed to read plaintext file
[/Users/macuser/Desktop/test/keys/testkey.json.decrypted]:
Unable to read file [/Users/macuser/Desktop/test/keys/testkey.json.decrypted]:
[Errno 2] No such file or directory:
'/Users/macuser/Desktop/test/keys/testkey.json.decrypted'
The file
/Users/macuser/Desktop/test/keys/testkey.json.decrypted
exists. I tried it with absolute and relative path, and with and without quotes, but I keep getting the same error.
Why is gcloud not seeing the file?