Struct avalanche_types::key::bls::private_key::Key
source · pub struct Key(_);
Expand description
Represents “k256::SecretKey” and “k256::ecdsa::SigningKey”.
Implementations§
source§impl Key
impl Key
sourcepub fn generate_to_file(key_path: &str) -> Result<Self>
pub fn generate_to_file(key_path: &str) -> Result<Self>
Generates and writes the key to a file.
sourcepub fn load_or_generate(key_path: &str) -> Result<(Self, bool)>
pub fn load_or_generate(key_path: &str) -> Result<(Self, bool)>
Loads the existing staking certificates if exists, and returns the loaded or generated the key. Returns “true” if generated.
sourcepub fn from_bytes(raw: &[u8]) -> Result<Self>
pub fn from_bytes(raw: &[u8]) -> Result<Self>
Loads the private key from the raw scalar bytes (in big endian).
sourcepub fn to_public_key(&self) -> PublicKey
pub fn to_public_key(&self) -> PublicKey
Derives the public key from this private key.
sourcepub fn sign_proof_of_possession(&self, msg: &[u8]) -> Signature
pub fn sign_proof_of_possession(&self, msg: &[u8]) -> Signature
ref. “avalanchego/utils/crypto/bls.SecretKey.SignProofOfPossession”
sourcepub fn to_proof_of_possession(&self) -> ProofOfPossession
pub fn to_proof_of_possession(&self) -> ProofOfPossession
ref. “avalanchego”/vms/platformvm/signer.NewProofOfPossession“
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Key
impl Send for Key
impl Sync for Key
impl Unpin for Key
impl UnwindSafe for Key
Blanket Implementations§
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request