pub fn new(
        config: &CryptoConfig,
        registry_client: Arc<dyn RegistryClient>,
        logger: ReplicaLogger,
        metrics_registry: Option<&MetricsRegistry>,
    ) -> Self {
        let metrics = Arc::new(CryptoMetrics::new(metrics_registry));
        let csp = Csp::new(config, Some(new_logger!(&logger)), Arc::clone(&metrics));
        let node_pks = csp.node_public_keys();
        let node_signing_pk = node_pks
            .node_signing_pk
            .as_ref()
            .expect("Missing node signing public key");
        let node_id = derive_node_id(node_signing_pk);
        CryptoComponentFatClient {
            lockable_threshold_sig_data_store: LockableThresholdSigDataStore::new(),
            csp,
            registry_client,
            node_id,
            logger,
            metrics,
        }
    }
/// Creates a new crypto component.
///
/// This is the constructor to use to create the replica's / node's crypto
/// component.
///
/// Multiple crypto components must share the same state to avoid problems
/// due to concurrent state access. To achieve this, we recommend to
/// instantiate multiple components as in the example below.
///
/// WARNING: Multiple crypto componets must be instantiated with
/// `Arc::clone` as in the example. Do not create multiple crypto
/// componets with the same config (as opposed to using `Arc::clone`),
/// as this will lead to concurrency issues e.g. when the components
/// access the secret key store simultaneously.
///
/// ```
/// use ic_config::crypto::CryptoConfig;
/// use ic_crypto::CryptoComponent;
/// use ic_logger::replica_logger::no_op_logger;
/// use std::sync::Arc;
/// use ic_registry_client::fake::FakeRegistryClient;
/// use ic_registry_common::proto_registry_data_provider::ProtoRegistryDataProvider;
/// use ic_crypto::utils::get_node_keys_or_generate_if_missing;
/// use ic_metrics::MetricsRegistry;
///
/// CryptoConfig::run_with_temp_config(|config| {
///     // instantiate a registry somehow
///     let registry_client = FakeRegistryClient::new(Arc::new(ProtoRegistryDataProvider::new()));
///
///     // get a logger and metrics registry
///     let logger = no_op_logger();
///     let metrics_registry = MetricsRegistry::new();
///
///     # // generate the node keys in the secret key store needed for this example to work:
///     # get_node_keys_or_generate_if_missing(config.crypto_root.as_path());
///     let first_crypto_component = Arc::new(CryptoComponent::new(&config, Arc::new(registry_client), logger, Some(&metrics_registry)));
///     let second_crypto_component = Arc::clone(&first_crypto_component);
/// });
/// ```
Creates a new crypto component.
This is the constructor to use to create the replica's / node's crypto
component.

Multiple crypto components must share the same state to avoid problems
due to concurrent state access. To achieve this, we recommend to
instantiate multiple components as in the example below.

Multiple crypto componets must be instantiated with
`Arc::clone` as in the example. Do not create multiple crypto
componets with the same config (as opposed to using `Arc::clone`),
as this will lead to concurrency issues e.g. when the components
access the secret key store simultaneously.





get a logger and metrics registry
let logger = no_op_logger();
let metrics_registry = MetricsRegistry::new().


Creates a new crypto component . This is the constructor to use to create the replica ' s / node ' s crypto component . Multiple crypto components must share the same state to avoid problems due to concurrent state access . To achieve this we recommend to instantiate multiple components as in the example below . Multiple crypto componets must be instantiated with ` Arc :: clone ` as in the example . Do not create multiple crypto componets with the same config ( as opposed to using ` Arc :: clone ` ) as this will lead to concurrency issues e . g . when the components access the secret key store simultaneously . get a logger and metrics registry let logger = no_op_logger () ; let metrics_registry = MetricsRegistry :: new () .
pub fn new(
        config: &CryptoConfig,
        registry_client: Arc<dyn RegistryClient>,
        logger: ReplicaLogger,
        metrics_registry: Option<&MetricsRegistry>,
    ) -> Self {
        let metrics = Arc::new(CryptoMetrics::new(metrics_registry));
        let csp = Csp::new(config, Some(new_logger!(&logger)), Arc::clone(&metrics));
        let node_pks = csp.node_public_keys();
        let node_signing_pk = node_pks
            .node_signing_pk
            .as_ref()
            .expect("Missing node signing public key");
        let node_id = derive_node_id(node_signing_pk);
        CryptoComponentFatClient {
            lockable_threshold_sig_data_store: LockableThresholdSigDataStore::new(),
            csp,
            registry_client,
            node_id,
            logger,
            metrics,
        }
    }
pub fn new ( config : & CryptoConfig , registry_client : Arc < dyn RegistryClient > , logger : ReplicaLogger , metrics_registry : Option < & MetricsRegistry > , ) -> Self { let metrics = Arc :: new ( CryptoMetrics :: new ( metrics_registry ) ) ; let csp = Csp :: new ( config , Some ( new_logger ! ( logger ) ) , Arc :: clone ( & metrics ) ) ; let node_pks = csp . node_public_keys ( ) ; let node_signing_pk = node_pks . node_signing_pk . as_ref ( ) . expect ( " " ) ; let node_id = derive_node_id ( node_signing_pk ) ; CryptoComponentFatClient { lockable_threshold_sig_data_store : LockableThresholdSigDataStore :: new ( ) , csp , registry_client , node_id , logger , metrics , } }
Creates a new crypto component.
Creates a new crypto component .
config
&CryptoConfig
registry_client
Arc<dyn RegistryClient>
logger
ReplicaLogger
metrics_registry
Option<&MetricsRegistry>
config
&CryptoConfig
registry_client
Arc<dyn RegistryClient>
logger
ReplicaLogger
metrics_registry
Option<&MetricsRegistry>