Struct diem_types::validator_signer::ValidatorSigner
source · pub struct ValidatorSigner { /* private fields */ }
Expand description
ValidatorSigner associates an author with public and private keys with helpers for signing and validating. This struct can be used for all signing operations including block and network signing, respectively.
Implementations§
source§impl ValidatorSigner
impl ValidatorSigner
pub fn new(author: AccountAddress, private_key: Ed25519PrivateKey) -> Self
sourcepub fn sign<T: Serialize + CryptoHash>(&self, message: &T) -> Ed25519Signature
pub fn sign<T: Serialize + CryptoHash>(&self, message: &T) -> Ed25519Signature
Constructs a signature for message
using private_key
.
Returns the author associated with this signer.
sourcepub fn public_key(&self) -> Ed25519PublicKey
pub fn public_key(&self) -> Ed25519PublicKey
Returns the public key associated with this signer.
sourcepub fn private_key(&self) -> &Ed25519PrivateKey
pub fn private_key(&self) -> &Ed25519PrivateKey
Returns the private key associated with this signer. Only available for testing purposes.
Trait Implementations§
source§impl Clone for ValidatorSigner
impl Clone for ValidatorSigner
source§fn clone(&self) -> ValidatorSigner
fn clone(&self) -> ValidatorSigner
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more