pub struct Signature(/* private fields */);Expand description
Store sign and verify ed25519
Implementations§
Source§impl Signature
impl Signature
Sourcepub fn new_signature(private: &mut Private, data: &[u8]) -> Self
pub fn new_signature(private: &mut Private, data: &[u8]) -> Self
Create a signature by signing some data
Sourcepub fn new_from_buf(signature: &[u8; 64]) -> Self
pub fn new_from_buf(signature: &[u8; 64]) -> Self
Create a signature with the raw signature bytes (no signing)
Sourcepub fn validate_with_public(
&self,
public: &Public,
data: &[u8],
) -> Result<bool, Error>
pub fn validate_with_public( &self, public: &Public, data: &[u8], ) -> Result<bool, Error>
Validate a signature and return true if valid
Sourcepub fn validate_with_private(
&self,
private: &Private,
data: &[u8],
) -> Result<bool, Error>
pub fn validate_with_private( &self, private: &Private, data: &[u8], ) -> Result<bool, Error>
Validate a signature and return true if valid
Sourcepub fn new_from_base36(s: &str) -> Option<Self>
pub fn new_from_base36(s: &str) -> Option<Self>
Create a signature from a base 36 string
pub fn dump_base36(&self) -> String
pub fn dump_buf(&self) -> [u8; 64]
Trait Implementations§
Source§impl<'__de, __Context> BorrowDecode<'__de, __Context> for Signature
impl<'__de, __Context> BorrowDecode<'__de, __Context> for Signature
Source§fn borrow_decode<__D: BorrowDecoder<'__de, Context = __Context>>(
decoder: &mut __D,
) -> Result<Self, DecodeError>
fn borrow_decode<__D: BorrowDecoder<'__de, Context = __Context>>( decoder: &mut __D, ) -> Result<Self, DecodeError>
Attempt to decode this type with the given BorrowDecode.
Source§impl<'de> Deserialize<'de> for Signature
impl<'de> Deserialize<'de> for Signature
Source§fn 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 Copy for Signature
impl Eq for Signature
impl StructuralPartialEq for Signature
Auto Trait Implementations§
impl Freeze for Signature
impl RefUnwindSafe for Signature
impl Send for Signature
impl Sync for Signature
impl Unpin for Signature
impl UnwindSafe for Signature
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