[−][src]Struct exonum_crypto::PublicKey
Ed25519 public key used to verify digital signatures.
In public-key cryptography, the system uses a a mathematically related pair of keys: a public key, which is openly distributed, and a secret key, which should remain confidential. For more information, refer to Public-key cryptography.
Ed25519 is a signature system that ensures fast signing and key generation, as well as security and collision resilience.
Examples
In the example below, the function generates a pair of random public and secret keys.
let (public_key, _) = exonum_crypto::gen_keypair();
Methods
impl PublicKey
[src]
impl PublicKey
[src]
pub fn new(bytes_array: [u8; 32]) -> 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 as_bytes(&self) -> [u8; 32]
[src]
Copies bytes from this instance.
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 AsRef<[u8]> for PublicKey
[src]
impl Clone for PublicKey
[src]
impl Copy for PublicKey
[src]
impl Debug for PublicKey
[src]
impl Default for PublicKey
[src]
impl<'de> Deserialize<'de> for PublicKey
[src]
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
[src]
D: Deserializer<'de>,
impl Display for PublicKey
[src]
impl Eq for PublicKey
[src]
impl FromHex for PublicKey
[src]
impl Hash for PublicKey
[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,
impl Index<Range<usize>> for PublicKey
[src]
type Output = [u8]
The returned type after indexing.
fn index(&self, _index: Range<usize>) -> &[u8]
[src]
impl Index<RangeFrom<usize>> for PublicKey
[src]
type Output = [u8]
The returned type after indexing.
fn index(&self, _index: RangeFrom<usize>) -> &[u8]
[src]
impl Index<RangeFull> for PublicKey
[src]
type Output = [u8]
The returned type after indexing.
fn index(&self, _index: RangeFull) -> &[u8]
[src]
impl Index<RangeTo<usize>> for PublicKey
[src]
type Output = [u8]
The returned type after indexing.
fn index(&self, _index: RangeTo<usize>) -> &[u8]
[src]
impl Ord for PublicKey
[src]
fn cmp(&self, other: &PublicKey) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<PublicKey> for PublicKey
[src]
impl PartialOrd<PublicKey> for PublicKey
[src]
fn partial_cmp(&self, other: &PublicKey) -> Option<Ordering>
[src]
fn lt(&self, other: &PublicKey) -> bool
[src]
fn le(&self, other: &PublicKey) -> bool
[src]
fn gt(&self, other: &PublicKey) -> bool
[src]
fn ge(&self, other: &PublicKey) -> bool
[src]
impl ProtobufConvert for PublicKey
[src]
type ProtoStruct = PublicKey
Type generated from the Protobuf definition.
fn to_pb(&self) -> PublicKey
[src]
fn from_pb(pb: PublicKey) -> Result<Self, Error>
[src]
impl Serialize for PublicKey
[src]
impl StructuralEq for PublicKey
[src]
impl StructuralPartialEq for PublicKey
[src]
Auto Trait Implementations
impl RefUnwindSafe for PublicKey
impl Send for PublicKey
impl Sync for PublicKey
impl Unpin for PublicKey
impl UnwindSafe for PublicKey
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToHex for T where
T: AsRef<[u8]>,
[src]
T: AsRef<[u8]>,
fn encode_hex<U>(&self) -> U where
U: FromIterator<char>,
[src]
U: FromIterator<char>,
fn encode_hex_upper<U>(&self) -> U where
U: FromIterator<char>,
[src]
U: FromIterator<char>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> 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, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,