Cosmian KMS is a high-performance, open-source FIPS 140-3 compliant Key Management System written in Rust.
# Initialize git submodules (required after clone)
git submodule update --init --recursive
# Build the project (FIPS mode is default)
cargo build --release
# Run tests (FIPS mode is default)
cargo test
# For non-FIPS mode (includes additional algorithms)
cargo build --release --features non-fips
cargo test --features non-fips# Run all tests (FIPS mode is default)
cargo test
# Run tests for a specific package
cargo test -p cosmian_kms_server
cargo test -p cosmian_kms_cli
# Run specific test suites
cargo test sqlite # SQLite tests
cargo test postgres # PostgreSQL tests (requires local PostgreSQL)
cargo test redis # Redis tests
# Run tests in non-FIPS mode (includes additional algorithms)
cargo test --features non-fips
cargo test --features non-fips sqliteEnvironment variables for DB tests:
KMS_POSTGRES_URL=postgresql://kms:kms@127.0.0.1:5432/kmsKMS_MYSQL_URL=mysql://kms:kms@localhost:3306/kmsKMS_SQLITE_PATH=data/shared
Notes:
- MySQL tests are currently disabled in CI
- Redis-findex tests are skipped in FIPS mode
- FIPS mode is the default; use
--features non-fipsfor non-approved algorithms - Start database backends with
docker compose up -dbefore running DB tests
After building, you can run the server manually:
cargo run --release --bin cosmian_kms -- --database-type sqlite --sqlite-path /tmp/kms-dataOr run the compiled binary directly:
./target/release/cosmian_kms --database-type sqlite --sqlite-path /tmp/kms-dataBasic API probe:
curl -s -X POST -H "Content-Type: application/json" -d '{}' http://localhost:9998/kmip/2_1Expected response is a KMIP validation error, confirming the server is alive.
.github/ # CI workflows and scripts
crate/ # Rust workspace crates (server, cli, crypto, …)
pkg/ # Packaging metadata (deb/rpm service files, configs)
documentation/ # Documentation and guides
resources/ # Configuration files and resources
test_data/ # Test fixtures and data
ui/ # Web UI source
- Format/lints: run
cargo fmt --checkandcargo clippyto check code style - Use
cargo build --releasefor optimized builds - Run
cargo testfrequently to ensure changes don't break functionality
docker pull ghcr.io/cosmian/kms:latest
docker run -p 9998:9998 --name kms ghcr.io/cosmian/kms:latestImages include the UI at http://localhost:9998/ui.