Enum PublicKey
pub enum PublicKey {
Ed25519(PublicKey),
P256(PublicKey),
}
Expand description
the public part of a KeyPair
Variants§
Implementations§
§impl PublicKey
impl PublicKey
pub fn to_bytes_hex(&self) -> String
pub fn to_bytes_hex(&self) -> String
serializes to an hex-encoded string
pub fn from_bytes(
bytes: &[u8],
algorithm: Algorithm,
) -> Result<PublicKey, Format>
pub fn from_bytes( bytes: &[u8], algorithm: Algorithm, ) -> Result<PublicKey, Format>
deserializes from a byte array
pub fn from_bytes_hex(
str: &str,
algorithm: Algorithm,
) -> Result<PublicKey, Format>
pub fn from_bytes_hex( str: &str, algorithm: Algorithm, ) -> Result<PublicKey, Format>
deserializes from an hex-encoded string
pub fn from_proto(key: &PublicKey) -> Result<PublicKey, Format>
pub fn to_proto(&self) -> PublicKey
pub fn from_der_with_algorithm( bytes: &[u8], algorithm: Algorithm, ) -> Result<PublicKey, Format>
pub fn from_der(bytes: &[u8]) -> Result<PublicKey, Format>
pub fn from_pem_with_algorithm( str: &str, algorithm: Algorithm, ) -> Result<PublicKey, Format>
pub fn from_pem(str: &str) -> Result<PublicKey, Format>
pub fn to_der(&self) -> Result<Vec<u8>, Format>
pub fn to_pem(&self) -> Result<String, Format>
pub fn verify_signature( &self, data: &[u8], signature: &Signature, ) -> Result<(), Format>
pub fn algorithm(&self) -> Algorithm
pub fn algorithm_string(&self) -> &str
pub fn print(&self) -> String
Trait Implementations§
§impl ToAnyParam for PublicKey
impl ToAnyParam for PublicKey
fn to_any_param(&self) -> AnyParam
impl Copy 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§
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> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§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.