# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
#
# When uploading crates to the registry Cargo will automatically
# "normalize" Cargo.toml files for maximal compatibility
# with all versions of Cargo and also rewrite `path` dependencies
# to registry (e.g., crates.io) dependencies.
#
# If you are reading this file be aware that the original Cargo.toml
# will likely look very different (and much more reasonable).
# See Cargo.toml.orig for the original contents.

[package]
edition = "2024"
rust-version = "1.87.0"
name = "ckms"
version = "5.19.0"
authors = [
    "Bruno Grieder <bruno.grieder@cosmian.com>",
    "Emmanuel Coste <emmanuel.coste@cosmian.com>",
]
build = false
autolib = false
autobins = false
autoexamples = false
autotests = false
autobenches = false
description = """
Command Line Interface used to manage the Cosmian KMS server.

If any assistance is needed, please either visit the Cosmian technical documentation at https://docs.cosmian.com
or contact the Cosmian support team on Discord https://discord.com/invite/7kPMNtHpnz
"""
readme = "README.md"
keywords = [
    "ckms",
    "kms",
    "cosmian",
]
categories = ["security"]
license = "BUSL-1.1"
repository = "https://github.com/Cosmian/kms"
resolver = "2"

[package.metadata.deb]
maintainer = "Cosmian support team <tech@cosmian.com>"
copyright = "2026, Cosmian Tech SAS <tech@cosmian.com>"
license-file = [
    "../../../LICENSE",
    "0",
]
changelog = "../../../CHANGELOG.md"
section = "security"
priority = "optional"
assets = [
    [
    "target/release/ckms",
    "usr/local/bin/",
    "755",
],
    [
    "target/release/libcosmian_pkcs11.so",
    "usr/local/lib/",
    "555",
],
]
features = ["non-fips"]

[package.metadata.deb.variants.fips]
features = []
assets = [
    [
    "target/release/ckms",
    "usr/local/bin/",
    "755",
],
    [
    "target/release/libcosmian_pkcs11.so",
    "usr/local/lib/",
    "555",
],
]

[package.metadata.deb.variants.fips-dynamic]
features = []
depends = ""
assets = [
    [
    "target/release/ckms",
    "usr/local/bin/",
    "755",
],
    [
    "target/release/libcosmian_pkcs11.so",
    "usr/local/lib/",
    "555",
],
    [
    "target/openssl-3.6.0-linux/lib/libssl.so.3",
    "usr/local/cosmian/ckms/lib/libssl.so.3",
    "555",
],
    [
    "target/openssl-3.6.0-linux/lib/libcrypto.so.3",
    "usr/local/cosmian/ckms/lib/libcrypto.so.3",
    "555",
],
    [
    "target/openssl-3.6.0-linux/lib/ossl-modules/fips.so",
    "usr/local/cosmian/ckms/lib/ossl-modules/fips.so",
    "555",
],
    [
    "target/openssl-3.6.0-linux/ssl/openssl.cnf",
    "usr/local/cosmian/ckms/lib/ssl/openssl.cnf",
    "644",
],
    [
    "target/openssl-3.6.0-linux/ssl/fipsmodule.cnf",
    "usr/local/cosmian/ckms/lib/ssl/fipsmodule.cnf",
    "644",
],
]

[package.metadata.deb.variants.non-fips-dynamic]
features = ["non-fips"]
depends = ""
assets = [
    [
    "target/release/ckms",
    "usr/local/bin/",
    "755",
],
    [
    "target/release/libcosmian_pkcs11.so",
    "usr/local/lib/",
    "555",
],
    [
    "target/openssl-non-fips-3.6.0-linux/lib/libssl.so.3",
    "usr/local/cosmian/ckms/lib/libssl.so.3",
    "555",
],
    [
    "target/openssl-non-fips-3.6.0-linux/lib/libcrypto.so.3",
    "usr/local/cosmian/ckms/lib/libcrypto.so.3",
    "555",
],
    [
    "target/openssl-non-fips-3.6.0-linux/lib/ossl-modules/legacy.so",
    "usr/local/cosmian/ckms/lib/ossl-modules/legacy.so",
    "555",
],
]

[package.metadata.generate-rpm]
license = "BUSL-1.1"
auto-req = "no"
require-sh = true
features = ["non-fips"]

[[package.metadata.generate-rpm.assets]]
source = "target/release/ckms"
dest = "/usr/local/bin/ckms"
mode = "755"

[[package.metadata.generate-rpm.assets]]
source = "target/release/libcosmian_pkcs11.so"
dest = "/usr/local/lib/libcosmian_pkcs11.so"
mode = "555"

[package.metadata.generate-rpm.variants.fips]
license = "BUSL-1.1"
auto-req = "no"
require-sh = true
features = []

[[package.metadata.generate-rpm.variants.fips.assets]]
source = "target/release/ckms"
dest = "/usr/local/bin/ckms"
mode = "755"

[[package.metadata.generate-rpm.variants.fips.assets]]
source = "target/release/libcosmian_pkcs11.so"
dest = "/usr/local/lib/libcosmian_pkcs11.so"
mode = "555"

[package.metadata.generate-rpm.variants.fips-dynamic]
license = "BUSL-1.1"
auto-req = "no"
require-sh = true
features = []

[[package.metadata.generate-rpm.variants.fips-dynamic.assets]]
source = "target/release/ckms"
dest = "/usr/local/bin/ckms"
mode = "755"

[[package.metadata.generate-rpm.variants.fips-dynamic.assets]]
source = "target/release/libcosmian_pkcs11.so"
dest = "/usr/local/lib/libcosmian_pkcs11.so"
mode = "555"

[[package.metadata.generate-rpm.variants.fips-dynamic.assets]]
source = "target/openssl-3.6.0-linux/lib/libssl.so.3"
dest = "/usr/local/cosmian/ckms/lib/libssl.so.3"
mode = "555"

[[package.metadata.generate-rpm.variants.fips-dynamic.assets]]
source = "target/openssl-3.6.0-linux/lib/libcrypto.so.3"
dest = "/usr/local/cosmian/ckms/lib/libcrypto.so.3"
mode = "555"

[[package.metadata.generate-rpm.variants.fips-dynamic.assets]]
source = "target/openssl-3.6.0-linux/lib/ossl-modules/fips.so"
dest = "/usr/local/cosmian/ckms/lib/ossl-modules/fips.so"
mode = "555"

[[package.metadata.generate-rpm.variants.fips-dynamic.assets]]
source = "target/openssl-3.6.0-linux/ssl/openssl.cnf"
dest = "/usr/local/cosmian/ckms/lib/ssl/openssl.cnf"
mode = "644"

[[package.metadata.generate-rpm.variants.fips-dynamic.assets]]
source = "target/openssl-3.6.0-linux/ssl/fipsmodule.cnf"
dest = "/usr/local/cosmian/ckms/lib/ssl/fipsmodule.cnf"
mode = "644"

[package.metadata.generate-rpm.variants.non-fips-dynamic]
license = "BUSL-1.1"
auto-req = "no"
require-sh = true
features = ["non-fips"]

[[package.metadata.generate-rpm.variants.non-fips-dynamic.assets]]
source = "target/release/ckms"
dest = "/usr/local/bin/ckms"
mode = "755"

[[package.metadata.generate-rpm.variants.non-fips-dynamic.assets]]
source = "target/release/libcosmian_pkcs11.so"
dest = "/usr/local/lib/libcosmian_pkcs11.so"
mode = "555"

[[package.metadata.generate-rpm.variants.non-fips-dynamic.assets]]
source = "target/openssl-non-fips-3.6.0-linux/lib/libssl.so.3"
dest = "/usr/local/cosmian/ckms/lib/libssl.so.3"
mode = "555"

[[package.metadata.generate-rpm.variants.non-fips-dynamic.assets]]
source = "target/openssl-non-fips-3.6.0-linux/lib/libcrypto.so.3"
dest = "/usr/local/cosmian/ckms/lib/libcrypto.so.3"
mode = "555"

[[package.metadata.generate-rpm.variants.non-fips-dynamic.assets]]
source = "target/openssl-non-fips-3.6.0-linux/lib/ossl-modules/legacy.so"
dest = "/usr/local/cosmian/ckms/lib/ossl-modules/legacy.so"
mode = "555"

[package.metadata.packager]
product-name = "Cosmian KMS CLI"
long-description = "Command-line interface to manage the Cosmian KMS server, including a PKCS#11 provider."
license-file = "../../../LICENSE"
identifier = "com.cosmian.kms.cli"
formats = [
    "nsis",
    "dmg",
]

[[package.metadata.packager.resources]]
src = "../../../README.md"
target = "README.md"

[[package.metadata.packager.resources]]
src = "target/release/cosmian_pkcs11.dll"
target = "cosmian_pkcs11.dll"

[package.metadata.packager.nsis]
display-language-selector = false
installer-mode = "currentUser"
languages = ["English"]

[features]
non-fips = ["cosmian_kms_cli/non-fips"]

[lib]
name = "ckms"
path = "src/lib.rs"
doctest = false

[[bin]]
name = "ckms"
path = "src/main.rs"

[dependencies.base64]
version = "0.22"

[dependencies.clap]
version = "4.5"
features = [
    "help",
    "env",
    "std",
    "usage",
    "error-context",
    "derive",
    "cargo",
]
default-features = false

[dependencies.cosmian_config_utils]
version = "0.3.1"

[dependencies.cosmian_kms_cli]
version = "5.19.0"

[dependencies.cosmian_logger]
version = "0.5"

[dependencies.csv]
version = "1.3"

[dependencies.der]
version = "0.7"
features = ["pem"]
default-features = false

[dependencies.dialoguer]
version = "0.11"
features = [
    "fuzzy-select",
    "password",
    "editor",
]
default-features = false

[dependencies.hex]
version = "0.4"
default-features = false

[dependencies.serde]
version = "1.0"

[dependencies.serde_json]
version = "1.0"

[dependencies.strum]
version = "0.27"
default-features = false

[dependencies.thiserror]
version = "2.0"

[dependencies.tokio]
version = "1.44"
features = ["full"]
default-features = false

[dependencies.url]
version = "2.5"

[dependencies.uuid]
version = "=1.11.1"

[dev-dependencies.assert_cmd]
version = "2.0"

[dev-dependencies.openssl]
version = "0.10"
default-features = false

[dev-dependencies.predicates]
version = "3.1"

[dev-dependencies.regex]
version = "1.11"
default-features = false

[dev-dependencies.tempfile]
version = "3.19"

[dev-dependencies.x509-parser]
version = "0.17"
features = ["verify"]

[lints.clippy]
as_conversions = "deny"
assertions_on_result_states = "deny"
empty_structs_with_brackets = "deny"
expect_used = "deny"
get_unwrap = "deny"
implicit_clone = "deny"
indexing_slicing = "deny"
map_err_ignore = "deny"
missing_asserts_for_indexing = "deny"
module_name_repetitions = "allow"
panic = "deny"
panic_in_result_fn = "deny"
print_stdout = "deny"
redundant_clone = "deny"
renamed_function_params = "deny"
str_to_string = "deny"
unreachable = "deny"
unseparated_literal_suffix = "deny"
unwrap_in_result = "deny"
unwrap_used = "deny"
verbose_file_reads = "deny"

[lints.clippy.all]
level = "deny"
priority = 80

[lints.clippy.cargo]
level = "deny"
priority = 30

[lints.clippy.cognitive_complexity]
level = "allow"
priority = 21

[lints.clippy.complexity]
level = "deny"
priority = 60

[lints.clippy.future_not_send]
level = "allow"
priority = 21

[lints.clippy.iter_with_drain]
level = "allow"
priority = 21

[lints.clippy.missing_errors_doc]
level = "allow"
priority = 91

[lints.clippy.multiple_crate_versions]
level = "allow"
priority = 31

[lints.clippy.nursery]
level = "deny"
priority = 20

[lints.clippy.pedantic]
level = "deny"
priority = 90

[lints.clippy.perf]
level = "deny"
priority = 50

[lints.clippy.redundant_pub_crate]
level = "allow"
priority = 21

[lints.clippy.ref_option]
level = "allow"
priority = 91

[lints.clippy.significant_drop_tightening]
level = "allow"
priority = 21

[lints.clippy.similar_names]
level = "allow"
priority = 91

[lints.clippy.style]
level = "deny"
priority = 40

[lints.clippy.suspicious]
level = "deny"
priority = 70

[lints.clippy.too_long_first_doc_paragraph]
level = "allow"
priority = 21

[lints.clippy.too_many_lines]
level = "allow"
priority = 91

[lints.rust]
future_incompatible = "deny"
keyword_idents = "deny"
let_underscore = "deny"
nonstandard_style = "deny"
refining_impl_trait = "deny"
unreachable_pub = "deny"
unsafe_code = "deny"
unused = "deny"
