Struct diem_crypto::x25519::PublicKey
source · pub struct PublicKey(_);
Expand description
This type should be used to deserialize a received public key
Implementations§
source§impl PublicKey
impl PublicKey
sourcepub fn from_ed25519_public_bytes(
ed25519_bytes: &[u8]
) -> Result<Self, CryptoMaterialError>
pub fn from_ed25519_public_bytes( ed25519_bytes: &[u8] ) -> Result<Self, 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§
source§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
.source§fn arbitrary_with(_top: Self::Parameters) -> Self::Strategy
fn arbitrary_with(_top: Self::Parameters) -> Self::Strategy
source§impl<'de> Deserialize<'de> for PublicKey
impl<'de> Deserialize<'de> for PublicKey
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
source§impl From<&PrivateKey> for PublicKey
impl From<&PrivateKey> for PublicKey
source§fn from(private_key: &PrivateKey) -> Self
fn from(private_key: &PrivateKey) -> Self
Converts to this type from the input type.
source§impl Ord for PublicKey
impl Ord for PublicKey
source§impl PartialEq<PublicKey> for PublicKey
impl PartialEq<PublicKey> for PublicKey
source§impl PartialOrd<PublicKey> for PublicKey
impl PartialOrd<PublicKey> for PublicKey
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 moresource§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.
source§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<T> TestOnlyHash for Twhere
T: Serialize + ?Sized,
impl<T> TestOnlyHash for Twhere T: Serialize + ?Sized,
source§fn test_only_hash(&self) -> HashValue
fn test_only_hash(&self) -> HashValue
Generates a hash used only for tests.
source§impl<T> ValidCryptoMaterialStringExt for Twhere
T: ValidCryptoMaterial,
impl<T> ValidCryptoMaterialStringExt for Twhere T: ValidCryptoMaterial,
source§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.
source§fn to_encoded_string(&self) -> Result<String>
fn to_encoded_string(&self) -> Result<String>
A function to encode into hex-string after serializing.