pub enum PublicKey {
Ed25519(PublicKey),
P256(PublicKey),
}
Expand description
the public part of a KeyPair
Variants§
Implementations§
Source§impl PublicKey
impl PublicKey
Sourcepub fn to_bytes_hex(&self) -> String
pub fn to_bytes_hex(&self) -> String
serializes to an hex-encoded string
Sourcepub 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
Sourcepub 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§
Source§impl RootKeyProvider for &PublicKey
impl RootKeyProvider for &PublicKey
Source§impl RootKeyProvider for PublicKey
impl RootKeyProvider for PublicKey
Source§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