fn validate_public_key_against_caller(
    public_key: &PublicKey,
    caller: &PrincipalId,
) -> Result<(), String> {
    let public_key_principal = public_key_to_principal(public_key);

    if caller != &public_key_principal {
        Err("Public key does not match caller".to_string())
    } else {
        Ok(())
    }
}
/// Return an error if the principal ID derived from `public_key` does not
/// equal `caller`
Return an error if the principal ID derived from `public_key` does not
equal `caller`
Return an error if the principal ID derived from ` public_key ` does not equal ` caller `
fn validate_public_key_against_caller(
    public_key: &PublicKey,
    caller: &PrincipalId,
) -> Result<(), String> {
    let public_key_principal = public_key_to_principal(public_key);
    if caller != &public_key_principal {
        Err("Public key does not match caller".to_string())
    } else {
        Ok(())
    }
}
fn validate_public_key_against_caller ( public_key : & PublicKey , caller : & PrincipalId , ) -> Result < ( ) , String > { let public_key_principal = public_key_to_principal ( public_key ) ; if caller != & public_key_principal { Err ( " " . to_string ( ) ) } else { Ok ( ( ) ) } }
Return an error if the principal ID derived from `public_key` does not
equal `caller`
Return an error if the principal ID derived from ` public_key ` does not equal ` caller `
public_key
&PublicKey
caller
&PrincipalId
public_key
&PublicKey
caller
&PrincipalId