pub struct PublicKey(_);
Expand description
This type should be used to deserialize a received public key
Implementations§
§impl PublicKey
impl PublicKey
pub fn from_ed25519_public_bytes(
ed25519_bytes: &[u8]
) -> Result<PublicKey, CryptoMaterialError>
pub fn from_ed25519_public_bytes( ed25519_bytes: &[u8] ) -> Result<PublicKey, CryptoMaterialError>
Deserialize an X25119 PublicKey from its representation as an Ed25519PublicKey, following the XEdDSA approach. This is meant to compensate for the poor key storage capabilities of key management solutions, and NOT to promote double usage of keys under several schemes, which would lead to BAD vulnerabilities.
Trait Implementations§
§impl Arbitrary for PublicKey
impl Arbitrary for PublicKey
§type Parameters = <[u8; 32] as Arbitrary>::Parameters
type Parameters = <[u8; 32] as Arbitrary>::Parameters
The type of parameters that
arbitrary_with
accepts for configuration
of the generated Strategy
. Parameters must implement Default
.§type Strategy = Map<<[u8; 32] as Arbitrary>::Strategy, fn(_: [u8; 32]) -> PublicKey>
type Strategy = Map<<[u8; 32] as Arbitrary>::Strategy, fn(_: [u8; 32]) -> PublicKey>
The type of
Strategy
used to generate values of type Self
.§fn arbitrary_with(
_top: <PublicKey as Arbitrary>::Parameters
) -> <PublicKey as Arbitrary>::Strategy
fn arbitrary_with( _top: <PublicKey as Arbitrary>::Parameters ) -> <PublicKey as Arbitrary>::Strategy
§impl<'de> Deserialize<'de> for PublicKey
impl<'de> Deserialize<'de> for PublicKey
§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
§impl From<&PrivateKey> for PublicKey
impl From<&PrivateKey> for PublicKey
§fn from(private_key: &PrivateKey) -> PublicKey
fn from(private_key: &PrivateKey) -> PublicKey
Converts to this type from the input type.
§impl Ord for PublicKey
impl Ord for PublicKey
§impl PartialOrd<PublicKey> for PublicKey
impl PartialOrd<PublicKey> for PublicKey
§fn partial_cmp(&self, other: &PublicKey) -> Option<Ordering>
fn partial_cmp(&self, other: &PublicKey) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read more§impl PublicKey for PublicKey
impl PublicKey for PublicKey
§type PrivateKeyMaterial = PrivateKey
type PrivateKeyMaterial = PrivateKey
We require public / private types to be coupled, i.e. their
associated type is each other.
§impl Serialize for PublicKey
impl Serialize for PublicKey
§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 ValidCryptoMaterial for PublicKey
impl ValidCryptoMaterial for PublicKey
impl Copy for PublicKey
impl Eq for PublicKey
impl StructuralEq for PublicKey
impl StructuralPartialEq for PublicKey
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§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.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>
§impl<T> TestOnlyHash for Twhere
T: Serialize + ?Sized,
impl<T> TestOnlyHash for Twhere T: Serialize + ?Sized,
§fn test_only_hash(&self) -> HashValue
fn test_only_hash(&self) -> HashValue
Generates a hash used only for tests.
§impl<T> ValidCryptoMaterialStringExt for Twhere
T: ValidCryptoMaterial,
impl<T> ValidCryptoMaterialStringExt for Twhere T: ValidCryptoMaterial,
§fn from_encoded_string(encoded_str: &str) -> Result<Self, CryptoMaterialError>
fn from_encoded_string(encoded_str: &str) -> Result<Self, CryptoMaterialError>
When trying to convert from bytes, we simply decode the string into
bytes before checking if we can convert.
§fn to_encoded_string(&self) -> Result<String, Error>
fn to_encoded_string(&self) -> Result<String, Error>
A function to encode into hex-string after serializing.