GPG Keys

A GPGKey object on Files.com is used to securely store both the private and public keys associated with a GPG (GNU Privacy Guard) encryption key pair. This object enables the encryption and decryption of data using GPG, allowing you to protect sensitive information.

The private key is kept confidential and is used for decrypting data or signing messages to prove authenticity, while the public key is used to encrypt messages that only the owner of the private key can decrypt.

By storing both keys together in a GPGKey object, Files.com makes it easier to understand encryption operations, ensuring secure and efficient handling of encrypted data within the platform.

List GPG Keys

Command

files-cli gpg-keys list

Output

Outputs a list of GpgKey objects according to the output format.

Authorization Requirement

Requires either a Site-Wide API key or User API key or session from a User with Folder Admin permissions.

Flags

FlagDescription
--user-id=
int64
User ID. Provide a value of 0 to operate the current session's user.

Additional Arguments

Example Request

files-cli gpg-keys list \
  --user-id=1

Show GPG Key

Command

files-cli gpg-keys find

Output

Outputs a GpgKey object according to the output format.

Authorization Requirement

Requires either a Site-Wide API key or User API key or session from a User with Folder Admin permissions.

Flags

FlagDescription
--id=
int64
Required
Gpg Key ID.

Example Request

files-cli gpg-keys find \
  --id=1

Create GPG Key

Command

files-cli gpg-keys create

Output

Outputs a GpgKey object according to the output format.

Authorization Requirement

Requires either a Site-Wide API key or User API key or session from a User with Folder Admin permissions.

Flags

FlagDefaultDescription
--user-id=
int64
User ID. Provide a value of 0 to operate the current session's user.
--partner-id=
int64
Partner ID who owns this GPG Key, if applicable.
--public-key=
string
The GPG public key
--private-key=
string
The GPG private key
--private-key-password=
string
The GPG private key password
--name=
string
Required
GPG key name.
--workspace-id=
int64
0Workspace ID (0 for default workspace).
--generate-expires-at=
string
Expiration date of the key. Used for the generation of the key. Will be ignored if generate_keypair is false.
--generate-keypair
boolean
If true, generate a new GPG key pair. Can not be used with public_key/private_key
--generate-full-name=
string
Full name of the key owner. Used for the generation of the key. Will be ignored if generate_keypair is false.
--generate-email=
string
Email address of the key owner. Used for the generation of the key. Will be ignored if generate_keypair is false.

Example Request

files-cli gpg-keys create \
  --name="key name"

Update GPG Key

Command

files-cli gpg-keys update

Output

Outputs a GpgKey object according to the output format.

Authorization Requirement

Requires either a Site-Wide API key or User API key or session from a User with Folder Admin permissions.

Flags

FlagDescription
--id=
int64
Required
Gpg Key ID.
--partner-id=
int64
Partner ID who owns this GPG Key, if applicable.
--public-key=
string
The GPG public key
--private-key=
string
The GPG private key
--private-key-password=
string
The GPG private key password
--name=
string
GPG key name.

Example Request

files-cli gpg-keys update \
  --id=1 \
  --partner-id=1

Delete GPG Key

Command

files-cli gpg-keys delete

Output

No output is returned.

Authorization Requirement

Requires either a Site-Wide API key or User API key or session from a User with Folder Admin permissions.

Flags

FlagDescription
--id=
int64
Required
Gpg Key ID.

Example Request

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

The GpgKey Object

Some of the commands above return a GpgKey object. The attributes of this object are listed below.

AttributeDescription
id
int64
GPG key ID.
workspace_id
int64
Workspace ID (0 for default workspace).
expires_at
date-time
GPG key expiration date.
name
string
GPG key name.
partner_id
int64
Partner ID who owns this GPG Key, if applicable.
partner_name
string
Name of the Partner who owns this GPG Key, if applicable.
user_id
int64
User ID who owns this GPG Key, if applicable.
public_key_md5
string
MD5 hash of the GPG public key
private_key_md5
string
MD5 hash of the GPG private key.
generated_public_key
string
GPG public key
generated_private_key
string
GPG private key.
private_key_password_md5
string
GPG private key password. Only required for password protected keys.