Enum fluence_keypair::public_key::PublicKey
source · [−]pub enum PublicKey {
Ed25519(PublicKey),
Rsa(PublicKey),
Secp256k1(PublicKey),
}Expand description
The public key of a node’s identity keypair.
Variants
Ed25519(PublicKey)
A public Ed25519 key.
Rsa(PublicKey)
A public RSA key.
Secp256k1(PublicKey)
A public Secp256k1 key.
Implementations
sourceimpl PublicKey
impl PublicKey
sourcepub fn verify(&self, msg: &[u8], sig: &Signature) -> Result<(), VerificationError>
pub fn verify(&self, msg: &[u8], sig: &Signature) -> Result<(), VerificationError>
Verify a signature for a message using this public key, i.e. check that the signature has been produced by the corresponding private key (authenticity), and that the message has not been tampered with (integrity).
pub fn encode(&self) -> Vec<u8>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
A: Allocator,
pub fn decode(bytes: &[u8]) -> Result<PublicKey, DecodingError>
pub fn from_base58(str: &str) -> Result<PublicKey, DecodingError>
pub fn to_vec(&self) -> Vec<u8>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
A: Allocator,
pub fn to_peer_id(&self) -> PeerId
pub fn get_key_format(&self) -> KeyFormat
Trait Implementations
sourceimpl<'de> Deserialize<'de> for PublicKey
impl<'de> Deserialize<'de> for PublicKey
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for PublicKey
impl StructuralEq for PublicKey
impl StructuralPartialEq for PublicKey
Auto Trait Implementations
impl RefUnwindSafe for PublicKey
impl Send for PublicKey
impl Sync for PublicKey
impl Unpin for PublicKey
impl UnwindSafe for PublicKey
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more