pub enum PublicKey {
Ed25519(PublicKey),
Secp256k1(PublicKey),
Secp256r1(PublicKey),
Secp384r1(PublicKey),
Sr25519(PublicKey),
}
Expand description
A public key used for signing.
Variants§
Ed25519(PublicKey)
Secp256k1(PublicKey)
Secp256r1(PublicKey)
Secp384r1(PublicKey)
Sr25519(PublicKey)
Implementations§
Source§impl PublicKey
impl PublicKey
Sourcepub fn from_bytes(sig_type: SignatureType, bytes: &[u8]) -> Result<Self, Error>
pub fn from_bytes(sig_type: SignatureType, bytes: &[u8]) -> Result<Self, Error>
Construct a public key from a slice of bytes.
Sourcepub fn verify(
&self,
context: &[u8],
message: &[u8],
signature: &Signature,
) -> Result<(), Error>
pub fn verify( &self, context: &[u8], message: &[u8], signature: &Signature, ) -> Result<(), Error>
Verify a signature.
Sourcepub fn verify_raw(
&self,
message: &[u8],
signature: &Signature,
) -> Result<(), Error>
pub fn verify_raw( &self, message: &[u8], signature: &Signature, ) -> Result<(), Error>
Verify signature raw using the underlying method, without the domain separation schema.
Sourcepub fn verify_by_type(
&self,
signature_type: SignatureType,
context_or_hash: &[u8],
message: &[u8],
signature: &Signature,
) -> Result<(), Error>
pub fn verify_by_type( &self, signature_type: SignatureType, context_or_hash: &[u8], message: &[u8], signature: &Signature, ) -> Result<(), Error>
Verify the signature of a message.
Trait Implementations§
Source§impl Decode for PublicKey
impl Decode for PublicKey
Source§fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>
fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>
Try to decode from a given CBOR value.
§fn try_default() -> Result<Self, DecodeError>where
Self: Sized,
fn try_default() -> Result<Self, DecodeError>where
Self: Sized,
Try to decode from a missing/null/undefined value.
§fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>where
Self: Sized,
fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>where
Self: Sized,
Try to decode from a given CBOR value, calling
try_default
in case the value is null or
undefined.Source§impl EncodeAsMap for PublicKey
impl EncodeAsMap for PublicKey
§fn into_cbor_value_map(self) -> Valuewhere
Self: Sized,
fn into_cbor_value_map(self) -> Valuewhere
Self: Sized,
Encode the type into a CBOR Map.
§fn into_cbor_map(self) -> Vec<(Value, Value)>where
Self: Sized,
fn into_cbor_map(self) -> Vec<(Value, Value)>where
Self: Sized,
Encode the type into a CBOR Map, returning the map items.
Source§impl From<PublicKey> for PublicKey
impl From<PublicKey> for PublicKey
Source§fn from(pk: CorePublicKey) -> Self
fn from(pk: CorePublicKey) -> Self
Converts to this type from the input type.
Source§impl Ord for PublicKey
impl Ord for PublicKey
Source§impl PartialOrd for PublicKey
impl PartialOrd for PublicKey
impl Eq for PublicKey
impl StructuralPartialEq for PublicKey
Auto Trait Implementations§
impl Freeze for PublicKey
impl RefUnwindSafe for PublicKey
impl Send for PublicKey
impl Sync for PublicKey
impl Unpin for PublicKey
impl UnwindSafe for PublicKey
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> ToHex for T
impl<T> ToHex for T
Source§fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
Encode the hex strict representing
self
into the result. Lower case
letters are used (e.g. f9b4ca
)Source§fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
Encode the hex strict representing
self
into the result. Upper case
letters are used (e.g. F9B4CA
)