/// Instantiates the secret key store in `node_path` and generates key-pairs
/// for this node.
Instantiates the secret key store in `node_path` and generates key-pairs
for this node.
Instantiates the secret key store in ` node_path ` and generates key - pairs for this node .
pub fn initialize<P: AsRef<Path>>(
        self,
        node_path: P,
    ) -> Result<InitializedNode, InitializeNodeError> {
        let crypto_path = InitializedNode::build_crypto_path(node_path.as_ref());
        std::fs::create_dir_all(node_path.as_ref()).map_err(|source| {
            InitializeNodeError::CreateNodePathFailed {
                path: node_path.as_ref().to_string_lossy().to_string(),
                source,
            }
        })?;
        let (node_pks, node_id) = get_node_keys_or_generate_if_missing(&crypto_path);
        // CRP-1273: Remove the following call when the encryption keys are generated
        // together with the rest of the node keys.
        let idkg_mega_encryption_pubkey = generate_idkg_dealing_encryption_keys(&crypto_path);
        Ok(InitializedNode {
            node_id,
            pk_committee_signing: node_pks.committee_signing_pk.unwrap(),
            pk_node_signing: node_pks.node_signing_pk.unwrap(),
            tls_certificate: node_pks.tls_certificate.unwrap(),
            node_path: PathBuf::from(node_path.as_ref()),
            node_config: self,
            dkg_dealing_encryption_pubkey: node_pks.dkg_dealing_encryption_pk.unwrap(),
            idkg_mega_encryption_pubkey,
        })
    }
pub fn initialize < P : AsRef < Path > > ( self , node_path : P , ) -> Result < InitializedNode , InitializeNodeError > { let crypto_path = InitializedNode :: build_crypto_path ( node_path . as_ref ( ) ) ; std :: fs :: create_dir_all ( node_path . as_ref ( ) ) . map_err ( | source | { InitializeNodeError :: CreateNodePathFailed { path : node_path . as_ref ( ) . to_string_lossy ( ) . to_string ( ) , source , } } ) ? ; let ( node_pks , node_id ) = get_node_keys_or_generate_if_missing ( & crypto_path ) ; // CRP-1273: Remove the following call when the encryption keys are generated // together with the rest of the node keys. let idkg_mega_encryption_pubkey = generate_idkg_dealing_encryption_keys ( & crypto_path ) ; Ok ( InitializedNode { node_id , pk_committee_signing : node_pks . committee_signing_pk . unwrap ( ) , pk_node_signing : node_pks . node_signing_pk . unwrap ( ) , tls_certificate : node_pks . tls_certificate . unwrap ( ) , node_path : PathBuf :: from ( node_path . as_ref ( ) ) , node_config : self , dkg_dealing_encryption_pubkey : node_pks . dkg_dealing_encryption_pk . unwrap ( ) , idkg_mega_encryption_pubkey , } ) }
Instantiates the secret key store in `node_path` and generates key-pairs
for this node.
Instantiates the secret key store in ` node_path ` and generates key - pairs for this node .
self
node_path
P