Struct exonum::crypto::PublicKey
[−]
[src]
pub struct PublicKey(_);
Public key used for verifying signatures.
Examples
use exonum::crypto; let (public_key, _) = crypto::gen_keypair();
Methods
impl PublicKey
[src]
fn zero() -> Self
Creates a new instance filled with zeros.
impl PublicKey
[src]
fn new(ba: [u8; 32]) -> Self
Creates a new instance from bytes array.
fn from_slice(bs: &[u8]) -> Option<Self>
Creates a new instance from bytes slice.
Trait Implementations
impl<'a> ExonumJson for &'a PublicKey
[src]
fn deserialize_field<B: WriteBufferWrapper>(
value: &Value,
buffer: &mut B,
from: Offset,
to: Offset
) -> Result<(), Box<Error>>
value: &Value,
buffer: &mut B,
from: Offset,
to: Offset
) -> Result<(), Box<Error>>
write deserialized field in buffer on place.
fn serialize_field(&self) -> Result<Value, Box<Error>>
serialize field as json::Value
impl ExonumJsonDeserialize for PublicKey
[src]
fn deserialize(value: &Value) -> Result<Self, Box<Error>>
deserialize json
value.
impl<'a> Field<'a> for &'a PublicKey
[src]
fn field_size() -> Offset
Field's header size
unsafe fn read(buffer: &'a [u8], from: Offset, _: Offset) -> &'a PublicKey
Read Field from buffer, with given position, beware of memory unsafety, you should check
Field
before read
. Read more
fn write(&self, buffer: &mut Vec<u8>, from: Offset, to: Offset)
Write Field to buffer, in given position write
doesn't lead to memory unsafety. Read more
fn check(
_: &'a [u8],
from: CheckedOffset,
to: CheckedOffset,
latest_segment: CheckedOffset
) -> Result
_: &'a [u8],
from: CheckedOffset,
to: CheckedOffset,
latest_segment: CheckedOffset
) -> Result
Checks if data in the buffer could be deserialized. Returns an index of latest data seen. Read more
impl PartialEq for PublicKey
[src]
fn eq(&self, __arg_0: &PublicKey) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &PublicKey) -> bool
This method tests for !=
.
impl Eq for PublicKey
[src]
impl Clone for PublicKey
[src]
fn clone(&self) -> PublicKey
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Copy for PublicKey
[src]
impl PartialOrd for PublicKey
[src]
fn partial_cmp(&self, __arg_0: &PublicKey) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, __arg_0: &PublicKey) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, __arg_0: &PublicKey) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, __arg_0: &PublicKey) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, __arg_0: &PublicKey) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Ord for PublicKey
[src]
fn cmp(&self, __arg_0: &PublicKey) -> Ordering
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
ord_max_min
)Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
ord_max_min
)Compares and returns the minimum of two values. Read more
impl Hash for PublicKey
[src]
fn hash<__H: Hasher>(&self, __arg_0: &mut __H)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl AsRef<[u8]> for PublicKey
[src]
impl Debug for PublicKey
[src]
impl HexValue for PublicKey
[src]
fn to_hex(&self) -> String
Format value as hex representation.
fn from_hex<T: AsRef<str>>(v: T) -> Result<Self, FromHexError>
Convert value from hex representation.
impl Serialize for PublicKey
[src]
fn serialize<S>(&self, ser: S) -> Result<S::Ok, S::Error> where
S: Serializer,
S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl<'de> Deserialize<'de> for PublicKey
[src]
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Index<Range<usize>> for PublicKey
[src]
type Output = [u8]
The returned type after indexing
fn index(&self, _index: Range<usize>) -> &[u8]
The method for the indexing (container[index]
) operation
impl Index<RangeTo<usize>> for PublicKey
[src]
type Output = [u8]
The returned type after indexing
fn index(&self, _index: RangeTo<usize>) -> &[u8]
The method for the indexing (container[index]
) operation
impl Index<RangeFrom<usize>> for PublicKey
[src]
type Output = [u8]
The returned type after indexing
fn index(&self, _index: RangeFrom<usize>) -> &[u8]
The method for the indexing (container[index]
) operation
impl Index<RangeFull> for PublicKey
[src]
type Output = [u8]
The returned type after indexing
fn index(&self, _index: RangeFull) -> &[u8]
The method for the indexing (container[index]
) operation
impl StorageKey for PublicKey
[src]
fn size(&self) -> usize
Returns the size of the serialized key in bytes.
fn write(&self, buffer: &mut [u8])
Serialize a key into the specified buffer of bytes. Read more
fn read(buffer: &[u8]) -> Self
Deserialize a key from the specified buffer of bytes.
impl StorageValue for PublicKey
[src]
fn into_bytes(self) -> Vec<u8>
Serialize a value into a vector of bytes.
fn from_bytes(value: Cow<[u8]>) -> Self
Deserialize a value from bytes.
fn hash(&self) -> Hash
Returns a hash of the value. Read more