Skip to main content

Managing GPG Keys

The GPG Keys within the GPG Key Manager can be managed using the CLI App.

List All GPG Keys

files-cli gpg-keys list

Import a GPG Key

files-cli gpg-keys create --user-id=12345 --name="MY FULL KEY NAME" --public-key="PUBLIC_KEY_TEXT" --private-key="PRIVATE_KEY_TEXT" --private-key-password="PASSWORD"

When using the CLI with a user session (your username and password), or an API Key that belongs to a user, you can specify 0 (zero) for the --user-id option and it will automatically determine the user ID of your username.

When using the CLI with a site-wide API Key, you must enter a valid user ID. You can find a user id by using the files-cli users list command.

Here is an example of importing a Public Key:

files-cli gpg-keys create --user-id=521581 --name="Acme Corp. Public Key" --public-key="-----BEGIN PGP PUBLIC KEY BLOCK-----

mQENBGUA5egBCADJCOH3Jng1QTHI+7ETosi80BwPh+p7AC+id7l1ibximJYzwlOW
wuR7+xgr0474MYOKvKTI3iLCPDEWonY4IV8rUhiww/n4mzdobqz+bOU1cZM657vm
xoINa+VpB00NOTYKHHqnkoKUJpBNzS7SjliQ8j07rcEsJaaijuaa7a6LqXR8vJPZ
8f+c6mHmMYosoG45IcBElY9oKApKMARm9ZZ3hRe5Squ3FtuXA9PrBaQwHU+JFS4c
1iqZZeUHKi258xZ4dHrZN4p//eQgCnSY7lumwnfvO6Hm2UgSG+eRosbe+7fRc7+Z
91TaDZr0ced9SpIvb26jYVnHcEaVFpa3p2GjABEBAAG0U0FjbWUgQ29ycC4gKFRo
aXMgaXMgZm9yIEZpbGVzLmNvbSBkZW1vbnN0cmF0aW9uIHB1cnBvc2VzIG9ubHku
KSA8YWNtZUBtb29ubGlmZS5jb20+iQFOBBMBCAA4FiEEi3/UZ0g0e0uZ0ioqNiIQ
h29xRo0FAmUA5egCGwMFCwkIBwIGFQoJCAsCBBYCAwECHgECF4AACgkQNiIQh29x
Ro3LIgf+PUCaMnVSFuJ0vdC6HjgIuJ27ThEd2NhoqAhy6Y5TrtOoz5IWDwqcQwiM
5a1vbt14hOfgXz73TvEvN5djsrwkVHsjzpdGslezRGsq3fkC2+Rk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g-keys update --id=1 --name="MY FULL KEY NAME" --public-key="PUBLIC_KEY_TEXT" --private-key="PRIVATE_KEY_TEXT" --private-key-password="PASSWORD"

Replace the --id value with the id that corresponds to the stored key that you wish to update.

You can find a stored key's ID by using the files-cli gpg-keys list command.

Here is an example of updating a public key:

files-cli gpg-keys update --id=4 --name="Acme Corp. Updated Public Key" --public-key="-----BEGIN PGP PUBLIC KEY BLOCK-----

mQENBGUA5egBCADJCOH3Jng1QTHI+7ETosi80BwPh+p7AC+id7l1ibximJYzwlOW
wuR7+xgr0474MYOKvKTI3iLCPDEWonY4IV8rUhiww/n4mzdobqz+bOU1cZM657vm
xoINa+VpB00NOTYKHHqnkoKUJpBNzS7SjliQ8j07rcEsJaaijuaa7a6LqXR8vJPZ
8f+c6mHmMYosoG45IcBElY9oKApKMARm9ZZ3hRe5Squ3FtuXA9PrBaQwHU+JFS4c
1iqZZeUHKi258xZ4dHrZN4p//eQgCnSY7lumwnfvO6Hm2UgSG+eRosbe+7fRc7+Z
91TaDZr0ced9SpIvb26jYVnHcEaVFpa3p2GjABEBAAG0U0FjbWUgQ29ycC4gKFRo
aXMgaXMgZm9yIEZpbGVzLmNvbSBkZW1vbnN0cmF0aW9uIHB1cnBvc2VzIG9ubHku
KSA8YWNtZUBtb29ubGlmZS5jb20+iQFOBBMBCAA4FiEEi3/UZ0g0e0uZ0ioqNiIQ
h29xRo0FAmUA5egCGwMFCwkIBwIGFQoJCAsCBBYCAwECHgECF4AACgkQNiIQh29x
Ro3LIgf+PUCaMnVSFuJ0vdC6HjgIuJ27ThEd2NhoqAhy6Y5TrtOoz5IWDwqcQwiM
5a1vbt14hOfgXz73TvEvN5djsrwkVHsjzpdGslezRGsq3fkC2+RkuVmKPzrmdvba
HqOp2FNQU5y4W99wWBnudqD1HlzY7BfADsHZ1L4MY0Ehf4E5ZZFqfpn07egLlH8v
JwZUL2hsyS8yKPmr9y0lp8goiqBdm74pHCyFtrPXSOsVYqpiUQ9jeNYju8KLBcsT
sG13akn9j+x7e8RMQjAogtdURBz2Q69SqcvW2vJ+y9gBRoFNzttwSrslJW0Z5tUn
aVgkknP0m6OBFffZcMUUUyb721OIHLkBDQRlAOXoAQgAy3QhrwaSaWC3nE2dAcwJ
0PxZLK0B2OUe8DZ/XlgcJblUaIbQDSLpTockQYlqJFV6ho5RCueUT42/HIsVfpnN
4dOYYUDXtSBw6xDgYGWHcJ/Au0f06qPUQY84zfMydBm5f6bY2Y9L1q4OISp85ekp
pGGSSDWqE4PanICmMTZV/kaqIhgwoRwOpKdDVW4upJIKSP9/rBCnxtArDf3OIkT/
Jf97+/4Fvt6fQtIRhzuiTdBglmiKZLNhvu3b/47cTtkuNwe/6viMcyh45PmlKFMP
mngMoZ9qO0BkqfytdO1XcnPfpJhyFYpljYyq9g2LIW5JlnXqIwddKo7txgb+XNEQ
owARAQABiQE2BBgBCAAgFiEEi3/UZ0g0e0uZ0ioqNiIQh29xRo0FAmUA5egCGwwA
CgkQNiIQh29xRo09wwf/SpM/g/gsAhgr4nWVXP2q6IaKy/iaX/BARkpDRgbptO9/
pBWmt/R8p8TxWD1itKR+gVO1TCQXig1gwyhr3cVWvM5+1ezTi1R08wcczyaXpItp
GjouWcS/z5Awr/XePpO7GIsfGE+HspsmXFDwOAIiKsmqGHF/NDwascxKhHsrhlSt
CZi9iI0LR6V9waAGomJ7qsd9kG6BrLPZFLXsFcLF3STrZSZqAhMRO0CAxanIt0JA
mq92THGN42lnu/HM7J15Z/FxAqE/srarMy3Qpfb54YHQHzVeI9hIoW+qRMFzqHJx
sTR7e//Sqk6HH+xzklRi/gYQz4KBLp7A9iVo9CZ3Vg==
=1DlG
-----END PGP PUBLIC KEY BLOCK-----"

Delete a GPG Key

Keys that are in use for encryption or decryption cannot be deleted. Remove the key from use prior to attempting to delete it.

files-cli gpg-keys delete --id=1

Replace the --id value with the id that corresponds to the stored key that you wish to update.

You can find a stored key's ID by using the files-cli gpg-keys list command.

Get Instant Access to Files.com

The button below will take you to our Free Trial signup page. Click on the white "Start My Free Trial" button, then fill out the short form on the next page. Your account will be activated instantly. You can dive in and start yourself or let us help. The choice is yours.