| Crates.io | keytool |
| lib.rs | keytool |
| version | 0.1.0 |
| created_at | 2025-11-18 12:47:41.391854+00 |
| updated_at | 2025-11-18 12:47:41.391854+00 |
| description | A command-line tool for managing certificates, similar to Java keytool. |
| homepage | |
| repository | https://github.com/llp/keytool |
| max_upload_size | |
| id | 1938403 |
| size | 59,688 |
keytool is a command-line tool for managing certificates and keys, inspired by the Java keytool utility. It provides
functionalities to create, list, import, export, and print certificates stored in keystores such as PKCS#12 files.
This tool is implemented in Rust for performance, safety, and cross-platform support.
keytoolYou can build from source using Cargo:
cargo build --release
Or install directly with Cargo:
cargo install keytool
keytool <command> [options]
Commands:
-genkeypair Generate a new key pair and self-signed certificate-list List all entries in the keystore-importcert Import a certificate into the keystore-exportcert Export a certificate from the keystore-delete Delete an entry from the keystore-printcert Print certificate information (similar to Java keytool)-help Display help informationkeytool -printcert -alias mycert -keystore keystore.p12 -storepass mypassword -v
Prints detailed information about the certificate associated with alias mycert in the specified PKCS#12 keystore.
Options:
-alias <alias> Specify the alias name of the certificate-keystore <file> Specify the keystore file (default: keystore.p12)-storepass <pass> Password for the keystore-rfc Output the certificate in PEM (Base64) format-v Verbose output showing full certificate details-genkeypair)Generate a new public/private key pair along with a self-signed certificate.
Options:
-alias <alias> Alias name for the new key pair-keyalg <algorithm> Key algorithm (e.g., RSA, EC)-keysize <size> Key size in bits (e.g., 2048)-validity <days> Validity period in days-keystore <file> Keystore file to store the key pair-storepass <pass> Keystore password-list)Lists all entries (aliases) stored in the keystore.
Options:
-keystore <file>-storepass <pass>-importcert)Imports a certificate into the keystore under a given alias.
Options:
-alias <alias>-file <certfile> Certificate file to import (DER or PEM)-keystore <file>-storepass <pass>-exportcert)Exports a certificate from the keystore to a file.
Options:
-alias <alias>-file <outputfile>-keystore <file>-storepass <pass>-rfc Export in PEM format-delete)Deletes an entry from the keystore.
Options:
-alias <alias>-keystore <file>-storepass <pass>Currently, keytool supports the PKCS#12 keystore format (.p12 or .pfx files), which is widely compatible with
various platforms and tools.
Support for Java KeyStore (JKS) format may be added in future releases.
This project is licensed under the Apache License 2.0. See the LICENSE file for details.
Contributions, issues, and feature requests are welcome! Feel free to check issues and submit pull requests.
This tool is inspired by Java's keytool and aims to provide a compatible command-line interface for certificate
management in Rust. However, it is a separate implementation and may have differences or limitations.