pub fn try_from(keys: &NodePublicKeys, node_id: NodeId) -> Result<Self, KeyValidationError> {
        validate_node_signing_key(&keys.node_signing_pk, node_id)?;
        validate_committee_signing_key(&keys.committee_signing_pk)?;
        validate_dkg_dealing_encryption_key(&keys.dkg_dealing_encryption_pk, node_id)?;
        validate_tls_certificate(&keys.tls_certificate, node_id)?;

        let node_signing_pubkey = keys
            .node_signing_pk
            .as_ref()
            .expect("Value missing")
            .clone();
        let committee_signing_pubkey = keys
            .committee_signing_pk
            .as_ref()
            .expect("Value missing")
            .clone();
        let dkg_dealing_encryption_pubkey = keys
            .dkg_dealing_encryption_pk
            .as_ref()
            .expect("Value missing")
            .clone();
        let tls_certificate = keys
            .tls_certificate
            .as_ref()
            .expect("Value missing")
            .clone();

        Ok(ValidNodePublicKeys {
            node_id,
            node_signing_pubkey,
            committee_signing_pubkey,
            dkg_dealing_encryption_pubkey,
            tls_certificate,
        })
    }
/// Determines if the given node public key material is valid.
///
/// Returns `ValidNodePublicKeys` iff the `keys` are valid and iff they
/// are valid for `node_id`. After successful validation, callers should
/// only work with `ValidNodePublicKeys` in their API and not with
/// the possibly invalid `NodePublicKeys` so as to avoid confusion about
/// whether key material is validated or not.
Determines if the given node public key material is valid.
Determines if the given node public key material is valid .
pub fn try_from(keys: &NodePublicKeys, node_id: NodeId) -> Result<Self, KeyValidationError> {
        validate_node_signing_key(&keys.node_signing_pk, node_id)?;
        validate_committee_signing_key(&keys.committee_signing_pk)?;
        validate_dkg_dealing_encryption_key(&keys.dkg_dealing_encryption_pk, node_id)?;
        validate_tls_certificate(&keys.tls_certificate, node_id)?;
        let node_signing_pubkey = keys
            .node_signing_pk
            .as_ref()
            .expect("Value missing")
            .clone();
        let committee_signing_pubkey = keys
            .committee_signing_pk
            .as_ref()
            .expect("Value missing")
            .clone();
        let dkg_dealing_encryption_pubkey = keys
            .dkg_dealing_encryption_pk
            .as_ref()
            .expect("Value missing")
            .clone();
        let tls_certificate = keys
            .tls_certificate
            .as_ref()
            .expect("Value missing")
            .clone();
        Ok(ValidNodePublicKeys {
            node_id,
            node_signing_pubkey,
            committee_signing_pubkey,
            dkg_dealing_encryption_pubkey,
            tls_certificate,
        })
    }
pub fn try_from ( keys : & NodePublicKeys , node_id : NodeId ) -> Result < Self , KeyValidationError > { validate_node_signing_key ( & keys . node_signing_pk , node_id ) ? ; validate_committee_signing_key ( & keys . committee_signing_pk ) ? ; validate_dkg_dealing_encryption_key ( & keys . dkg_dealing_encryption_pk , node_id ) ? ; validate_tls_certificate ( & keys . tls_certificate , node_id ) ? ; let node_signing_pubkey = keys . node_signing_pk . as_ref ( ) . expect ( " " ) . clone ( ) ; let committee_signing_pubkey = keys . committee_signing_pk . as_ref ( ) . expect ( " " ) . clone ( ) ; let dkg_dealing_encryption_pubkey = keys . dkg_dealing_encryption_pk . as_ref ( ) . expect ( " " ) . clone ( ) ; let tls_certificate = keys . tls_certificate . as_ref ( ) . expect ( " " ) . clone ( ) ; Ok ( ValidNodePublicKeys { node_id , node_signing_pubkey , committee_signing_pubkey , dkg_dealing_encryption_pubkey , tls_certificate , } ) }
Determines if the given node public key material is valid.
Determines if the given node public key material is valid .
keys
&NodePublicKeys
node_id
NodeId
keys
&NodePublicKeys
node_id
NodeId