Cosmian Command Line Interface (CLI)¶
Cosmian CLI is the Command Line Interface to drive KMS and Findex server.
Cosmian CLI provides a powerful interface to manage and secure your cryptographic keys and secrets using the Cosmian Key Management System KMS. The KMS offers a high-performance, scalable solution with unique features such as confidential execution in zero-trust environments, compliance with KMIP 2.1, and support for various cryptographic algorithms and protocols.
Additionally, the CLI facilitates interaction with the Findex server, which implements Searchable Symmetric Encryption (SSE) via the Findex protocol. This allows for secure and efficient search operations over encrypted data, ensuring that sensitive information remains protected even during search queries.
By leveraging Cosmian CLI, users can seamlessly integrate advanced cryptographic functionalities and secure search capabilities into their applications, enhancing data security and privacy.
Note: A graphical version of the CLI is also available as a separate tool called cosmian_gui
.
Download cosmian and cosmian_gui
Please download the latest versions for your Operating System from the Cosmian public packages repository See below for installation instructions.
Installation¶
Download package and install it:
Download package and install it:
Download package and install it:
Download package and install it:
On ARM MacOS, download the build archive and extract it:
wget https://package.cosmian.com/cli/0.1.1/macos_arm-release.zip
unzip macos_arm-release.zip
cp ./macos_arm-release/release/cosmian /usr/local/bin/
chmod u+x /usr/local/bin/cosmian
cosmian --version
cp ./macos_arm-release/release/cosmian_gui /usr/local/bin/
chmod u+x /usr/local/bin/cosmian_gui
On Intel MacOS, download the build archive and extract it:
wget https://package.cosmian.com/cli/0.1.1/macos_intel-release.zip
unzip macos_intel-release.zip
cp ./macos_intel-release/release/cosmian /usr/local/bin/
chmod u+x /usr/local/bin/cosmian
cosmian --version
cp ./macos_intel-release/release/cosmian_gui /usr/local/bin/
chmod u+x /usr/local/bin/cosmian_gui
On Windows, download the build archive:
Extract the cosmian from:
Copy it to a folder in your PATH and run it:
Configuration¶
To communicate with KMS and Findex server, the clients cosmian
and cosmian_gui
expect the same configuration file. Please read the configuration section.
KMS objects access rights¶
When authentication is enabled, each KMS object requires explicit authorization from its owner to be accessed or used by others. The Cosmian CLI then allows to manage the access rights of users to cryptographic objects stored in the KMS.
Usage¶
Usage¶
CLI used to manage the Cosmian KMS.
Usage: cosmian [OPTIONS] <COMMAND>
Commands:
kms Handle KMS actions
findex-server Handle Findex server actions
help Print this message or the help of the given subcommand(s)
Options:
-c, --conf-path <CONF_PATH> Configuration file location [env: COSMIAN_CLI_CONF_PATH=]
--kms-url <KMS_URL> The URL of the KMS [env: KMS_DEFAULT_URL=]
--kms-accept-invalid-certs Allow to connect using a self-signed cert or untrusted cert chain
--kms-print-json Output the KMS JSON KMIP request and response. This is useful to understand JSON POST requests and responses required to programmatically call the KMS on the `/kmip/2_1` endpoint
--findex-url <FINDEX_URL> The URL of the Findex server [env: FINDEX_SERVER_DEFAULT_URL=]
--findex-accept-invalid-certs Allow to connect using a self-signed cert or untrusted cert chain
-h, --help Print help (see more with '--help')
-V, --version Print version
KMS commands¶
Handle KMS actions
Usage: cosmian kms <COMMAND>
Commands:
access-rights Manage the users' access rights to the cryptographic objects
attributes Get/Set/Delete the KMIP object attributes
cc Manage Covercrypt keys and policies. Rotate attributes. Encrypt and decrypt data
certificates Manage certificates. Create, import, destroy and revoke. Encrypt and decrypt data
ec Manage elliptic curve keys. Encrypt and decrypt data using ECIES
google Manage google elements. Handle key pairs and identities from Gmail API
locate Locate cryptographic objects inside the KMS
login Login to the Identity Provider of the KMS server using the `OAuth2` authorization code flow.
logout Logout from the Identity Provider.
new-database Initialize a new user encrypted database and return the secret (`SQLCipher` only).
rsa Manage RSA keys. Encrypt and decrypt data using RSA keys
server-version Print the version of the server
sym Manage symmetric keys. Encrypt and decrypt data
help Print this message or the help of the given subcommand(s)
Options:
-h, --help Print help
Findex server commands¶
Handle Findex server actions
Usage: cosmian findex-server <COMMAND>
Commands:
encrypt-and-index Encrypt entries and index the corresponding database UUIDs with the Findex.
search-and-decrypt Search keywords and decrypt the content of corresponding UUIDs.
delete-dataset Delete encrypted entries. (Indexes are not deleted)
datasets Manage encrypted datasets
delete Delete indexed keywords
index Index new keywords
login Login to the Identity Provider of the Findex server using the `OAuth2`
authorization code flow.
logout Logout from the Identity Provider.
permissions Manage the users permissions to the indexes
search Findex: Search keywords.
server-version Print the version of the server
help Print this message or the help of the given subcommand(s)
Options:
-h, --help Print help