[−][src]Struct exonum_crypto::Signature
Ed25519 digital signature. This structure creates a signature over data using a secret key. Later it is possible to verify, using the corresponding public key, that the data have indeed been signed with that secret key.
Ed25519 is a signature system that ensures fast signing and key generation, as well as security and collision resilience.
Examples
The example below generates a pair of random public and secret keys, adds certain data, signs the data using the secret key and verifies that the data have been signed with that secret key.
let (public_key, secret_key) = exonum_crypto::gen_keypair(); let data = [1, 2, 3]; let signature = exonum_crypto::sign(&data, &secret_key); assert!(exonum_crypto::verify(&signature, &data, &public_key));
Methods
impl Signature
[src]
impl Signature
[src]
pub fn new(bytes_array: [u8; 64]) -> Self
[src]
Creates a new instance from bytes array.
pub fn from_slice(bytes_slice: &[u8]) -> Option<Self>
[src]
Creates a new instance from bytes slice.
pub fn to_hex(&self) -> String
[src]
Returns a hex representation of binary data. Lower case letters are used (e.g. f9b4ca).
Trait Implementations
impl PartialOrd<Signature> for Signature
[src]
fn partial_cmp(&self, other: &Signature) -> Option<Ordering>
[src]
fn lt(&self, other: &Signature) -> bool
[src]
fn le(&self, other: &Signature) -> bool
[src]
fn gt(&self, other: &Signature) -> bool
[src]
fn ge(&self, other: &Signature) -> bool
[src]
impl Copy for Signature
[src]
impl AsRef<[u8]> for Signature
[src]
impl PartialEq<Signature> for Signature
[src]
impl Clone for Signature
[src]
fn clone(&self) -> Signature
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Ord for Signature
[src]
fn cmp(&self, other: &Signature) -> Ordering
[src]
fn max(self, other: Self) -> Self
1.21.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
Compares and returns the minimum of two values. Read more
impl Eq for Signature
[src]
impl Display for Signature
[src]
impl Debug for Signature
[src]
impl Hash for Signature
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl Index<Range<usize>> for Signature
[src]
type Output = [u8]
The returned type after indexing.
fn index(&self, _index: Range<usize>) -> &[u8]
[src]
impl Index<RangeTo<usize>> for Signature
[src]
type Output = [u8]
The returned type after indexing.
fn index(&self, _index: RangeTo<usize>) -> &[u8]
[src]
impl Index<RangeFrom<usize>> for Signature
[src]
type Output = [u8]
The returned type after indexing.
fn index(&self, _index: RangeFrom<usize>) -> &[u8]
[src]
impl Index<RangeFull> for Signature
[src]
type Output = [u8]
The returned type after indexing.
fn index(&self, _index: RangeFull) -> &[u8]
[src]
impl Serialize for Signature
[src]
impl<'de> Deserialize<'de> for Signature
[src]
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
[src]
D: Deserializer<'de>,
impl FromHex for Signature
[src]
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
impl<T> ToHex for T where
T: AsRef<[u8]>,
[src]
T: AsRef<[u8]>,