ckms 5.23.0

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
Documentation
#![allow(clippy::expect_used)]

use std::process;

use ckms::ckms_main;

fn main() {
    // Run the CLI in a dedicated thread with a large stack to avoid stack overflows
    // on Windows when processing deeply nested KMIP/TTLV structures.
    let handle = std::thread::Builder::new()
        .name("ckms-main".into())
        .stack_size(32 * 1024 * 1024)
        .spawn(|| {
            let rt = tokio::runtime::Builder::new_multi_thread()
                .enable_all()
                .thread_stack_size(16 * 1024 * 1024)
                .build()
                .expect("failed to build tokio runtime");
            rt.block_on(ckms_main())
        })
        .expect("failed to spawn ckms main thread");

    match handle.join() {
        Ok(Ok(())) => {}
        Ok(Err(err)) => {
            eprintln!("ERROR: {err}");
            process::exit(1);
        }
        Err(_) => {
            eprintln!("ERROR: panic in ckms main thread");
            process::exit(1);
        }
    }
}