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
SDK Method
gpgkey.List()
Return Object
[]*GpgKey
Authorization Requirement
Requires either a Site-Wide API key or User API key or session from a User with Folder Admin permissions.
GpgKeyListParams Fields
| Field | Description |
|---|---|
| UserId int64 | User ID. Provide a value of 0 to operate the current session's user. |
Additional Arguments
Show GPG Key
SDK Method
gpgkey.Find()
Return Object
GpgKey
Authorization Requirement
Requires either a Site-Wide API key or User API key or session from a User with Folder Admin permissions.
GpgKeyFindParams Fields
| Field | Description |
|---|---|
| Id int64 Required | Gpg Key ID. |
Create GPG Key
SDK Method
gpgkey.Create()
Return Object
GpgKey
Authorization Requirement
Requires either a Site-Wide API key or User API key or session from a User with Folder Admin permissions.
GpgKeyCreateParams Fields
| Field | Default | Description |
|---|---|---|
| UserId int64 | User ID. Provide a value of 0 to operate the current session's user. | |
| PartnerId int64 | Partner ID who owns this GPG Key, if applicable. | |
| PublicKey string | The GPG public key | |
| PrivateKey string | The GPG private key | |
| PrivateKeyPassword string | The GPG private key password | |
| Name string Required | GPG key name. | |
| WorkspaceId int64 | 0 | Workspace ID (0 for default workspace). |
| GenerateExpiresAt string | Expiration date of the key. Used for the generation of the key. Will be ignored if generate_keypair is false. | |
| GenerateKeypair boolean | If true, generate a new GPG key pair. Can not be used with public_key/private_key | |
| GenerateFullName string | Full name of the key owner. Used for the generation of the key. Will be ignored if generate_keypair is false. | |
| GenerateEmail string | Email address of the key owner. Used for the generation of the key. Will be ignored if generate_keypair is false. |
Update GPG Key
SDK Method
gpgkey.Update()
Return Object
GpgKey
Authorization Requirement
Requires either a Site-Wide API key or User API key or session from a User with Folder Admin permissions.
GpgKeyUpdateParams Fields
| Field | Description |
|---|---|
| Id int64 Required | Gpg Key ID. |
| PartnerId int64 | Partner ID who owns this GPG Key, if applicable. |
| PublicKey string | The GPG public key |
| PrivateKey string | The GPG private key |
| PrivateKeyPassword string | The GPG private key password |
| Name string | GPG key name. |
Delete GPG Key
SDK Method
gpgkey.Delete()
Return Object
No return value.
Authorization Requirement
Requires either a Site-Wide API key or User API key or session from a User with Folder Admin permissions.
GpgKeyDeleteParams Fields
| Field | Description |
|---|---|
| Id int64 Required | Gpg Key ID. |
The GpgKey Object
Some of the methods above return a GpgKey object. The attributes of this object are listed below.
| Attribute | Description |
|---|---|
| Id int64 | GPG key ID. |
| WorkspaceId int64 | Workspace ID (0 for default workspace). |
| ExpiresAt date-time | GPG key expiration date. |
| Name string | GPG key name. |
| PartnerId int64 | Partner ID who owns this GPG Key, if applicable. |
| PartnerName string | Name of the Partner who owns this GPG Key, if applicable. |
| UserId int64 | User ID who owns this GPG Key, if applicable. |
| PublicKeyMd5 string | MD5 hash of the GPG public key |
| PrivateKeyMd5 string | MD5 hash of the GPG private key. |
| GeneratedPublicKey string | GPG public key |
| GeneratedPrivateKey string | GPG private key. |
| PrivateKeyPasswordMd5 string | GPG private key password. Only required for password protected keys. |