pub struct PublicKey(/* private fields */);Expand description
Ed25519 public key to verify a signature over dns Packets.
It can formatted to and parsed from a z-base32 string.
Implementations§
Source§impl PublicKey
impl PublicKey
Sourcepub fn to_public_key_der(&self) -> Document
pub fn to_public_key_der(&self) -> Document
Converts the public key to a DER-encoded document.
Source§impl PublicKey
impl PublicKey
Sourcepub fn to_uri_string(&self) -> String
pub fn to_uri_string(&self) -> String
Format the public key as pk: URI string.
Sourcepub fn verify(&self, message: &[u8], signature: &Signature) -> Result<(), Error>
pub fn verify(&self, message: &[u8], signature: &Signature) -> Result<(), Error>
Verify a signature over a message.
Sourcepub fn verifying_key(&self) -> &VerifyingKey
pub fn verifying_key(&self) -> &VerifyingKey
Return a reference to the underlying VerifyingKey
Trait Implementations§
Source§impl<'de> Deserialize<'de> for PublicKey
impl<'de> Deserialize<'de> for PublicKey
Source§fn deserialize<D>(
deserializer: D,
) -> Result<PublicKey, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<PublicKey, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<VerifyingKey> for PublicKey
impl From<VerifyingKey> for PublicKey
Source§fn from(verifying_key: VerifyingKey) -> PublicKey
fn from(verifying_key: VerifyingKey) -> PublicKey
Converts to this type from the input type.
Source§impl FromStr for PublicKey
impl FromStr for PublicKey
Source§fn from_str(s: &str) -> Result<PublicKey, <PublicKey as FromStr>::Err>
fn from_str(s: &str) -> Result<PublicKey, <PublicKey as FromStr>::Err>
Convert the TLD in a &str to a PublicKey.
§Examples
o4dksfbqk85ogzdb5osziw6befigbuxmuxkuxq8434q89uj56uyypk:o4dksfbqk85ogzdb5osziw6befigbuxmuxkuxq8434q89uj56uyyhttp://o4dksfbqk85ogzdb5osziw6befigbuxmuxkuxq8434q89uj56uyyhttps://o4dksfbqk85ogzdb5osziw6befigbuxmuxkuxq8434q89uj56uyyhttps://o4dksfbqk85ogzdb5osziw6befigbuxmuxkuxq8434q89uj56uyy/foo/barhttps://foo.o4dksfbqk85ogzdb5osziw6befigbuxmuxkuxq8434q89uj56uyy.https://foo.o4dksfbqk85ogzdb5osziw6befigbuxmuxkuxq8434q89uj56uyy.#hashhttps://foo@bar.o4dksfbqk85ogzdb5osziw6befigbuxmuxkuxq8434q89uj56uyy.?q=vhttps://foo@bar.o4dksfbqk85ogzdb5osziw6befigbuxmuxkuxq8434q89uj56uyy.:8888?q=vhttps://yg4gxe7z1r7mr6orids9fh95y7gxhdsxjqi6nngsxxtakqaxr5no.o4dksfbqk85ogzdb5osziw6befigbuxmuxkuxq8434q89uj56uyy
Source§type Err = PublicKeyError
type Err = PublicKeyError
The associated error which can be returned from parsing.
Source§impl Serialize for PublicKey
impl Serialize for PublicKey
Source§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
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,
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> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.