Struct diem_sdk::crypto::multi_ed25519::MultiEd25519PublicKey
pub struct MultiEd25519PublicKey { /* private fields */ }
Expand description
Vector of public keys in the multi-key Ed25519 structure along with the threshold.
Implementations§
§impl MultiEd25519PublicKey
impl MultiEd25519PublicKey
pub fn new(
public_keys: Vec<Ed25519PublicKey, Global>,
threshold: u8
) -> Result<MultiEd25519PublicKey, CryptoMaterialError>
pub fn new( public_keys: Vec<Ed25519PublicKey, Global>, threshold: u8 ) -> Result<MultiEd25519PublicKey, CryptoMaterialError>
Construct a new MultiEd25519PublicKey. — Rules — a) threshold cannot be zero. b) public_keys.len() should be equal to or larger than threshold. c) support up to MAX_NUM_OF_KEYS public keys.
pub fn public_keys(&self) -> &Vec<Ed25519PublicKey, Global> ⓘ
pub fn public_keys(&self) -> &Vec<Ed25519PublicKey, Global> ⓘ
Getter public_keys
Trait Implementations§
§impl Clone for MultiEd25519PublicKey
impl Clone for MultiEd25519PublicKey
§fn clone(&self) -> MultiEd25519PublicKey
fn clone(&self) -> MultiEd25519PublicKey
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more§impl Debug for MultiEd25519PublicKey
impl Debug for MultiEd25519PublicKey
§impl<'de> Deserialize<'de> for MultiEd25519PublicKey
impl<'de> Deserialize<'de> for MultiEd25519PublicKey
§fn deserialize<D>(
deserializer: D
) -> Result<MultiEd25519PublicKey, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>( deserializer: D ) -> Result<MultiEd25519PublicKey, <D as Deserializer<'de>>::Error>where D: Deserializer<'de>,
§impl Display for MultiEd25519PublicKey
impl Display for MultiEd25519PublicKey
§impl From<&MultiEd25519PrivateKey> for MultiEd25519PublicKey
impl From<&MultiEd25519PrivateKey> for MultiEd25519PublicKey
Implementing From<&PrivateKey<…>> allows to derive a public key in a more elegant fashion.
§fn from(private_key: &MultiEd25519PrivateKey) -> MultiEd25519PublicKey
fn from(private_key: &MultiEd25519PrivateKey) -> MultiEd25519PublicKey
§impl From<Ed25519PublicKey> for MultiEd25519PublicKey
impl From<Ed25519PublicKey> for MultiEd25519PublicKey
Convenient method to create a MultiEd25519PublicKey from a single Ed25519PublicKey.
§fn from(ed_public_key: Ed25519PublicKey) -> MultiEd25519PublicKey
fn from(ed_public_key: Ed25519PublicKey) -> MultiEd25519PublicKey
§impl Hash for MultiEd25519PublicKey
impl Hash for MultiEd25519PublicKey
§impl PartialEq<MultiEd25519PublicKey> for MultiEd25519PublicKey
impl PartialEq<MultiEd25519PublicKey> for MultiEd25519PublicKey
§fn eq(&self, other: &MultiEd25519PublicKey) -> bool
fn eq(&self, other: &MultiEd25519PublicKey) -> bool
self
and other
values to be equal, and is used
by ==
.§impl PublicKey for MultiEd25519PublicKey
impl PublicKey for MultiEd25519PublicKey
We deduce PublicKey from this.
§type PrivateKeyMaterial = MultiEd25519PrivateKey
type PrivateKeyMaterial = MultiEd25519PrivateKey
§impl Serialize for MultiEd25519PublicKey
impl Serialize for MultiEd25519PublicKey
§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,
§impl TryFrom<&[u8]> for MultiEd25519PublicKey
impl TryFrom<&[u8]> for MultiEd25519PublicKey
§fn try_from(bytes: &[u8]) -> Result<MultiEd25519PublicKey, CryptoMaterialError>
fn try_from(bytes: &[u8]) -> Result<MultiEd25519PublicKey, CryptoMaterialError>
Deserialize a MultiEd25519PublicKey. This method will also check for key and threshold validity, and will only deserialize keys that are safe against small subgroup attacks.
§type Error = CryptoMaterialError
type Error = CryptoMaterialError
§impl VerifyingKey for MultiEd25519PublicKey
impl VerifyingKey for MultiEd25519PublicKey
We deduce VerifyingKey from pointing to the signature material
we get the ability to do pubkey.validate(msg, signature)
§type SigningKeyMaterial = MultiEd25519PrivateKey
type SigningKeyMaterial = MultiEd25519PrivateKey
§type SignatureMaterial = MultiEd25519Signature
type SignatureMaterial = MultiEd25519Signature
§fn verify_struct_signature<T>(
&self,
message: &T,
signature: &Self::SignatureMaterial
) -> Result<(), Error>where
T: CryptoHash + Serialize,
fn verify_struct_signature<T>( &self, message: &T, signature: &Self::SignatureMaterial ) -> Result<(), Error>where T: CryptoHash + Serialize,
§fn batch_verify<T>(
message: &T,
keys_and_signatures: Vec<(Self, Self::SignatureMaterial), Global>
) -> Result<(), Error>where
T: CryptoHash + Serialize,
fn batch_verify<T>( message: &T, keys_and_signatures: Vec<(Self, Self::SignatureMaterial), Global> ) -> Result<(), Error>where T: CryptoHash + Serialize,
impl Eq for MultiEd25519PublicKey
impl StructuralEq for MultiEd25519PublicKey
impl StructuralPartialEq for MultiEd25519PublicKey
Auto Trait Implementations§
impl RefUnwindSafe for MultiEd25519PublicKey
impl Send for MultiEd25519PublicKey
impl Sync for MultiEd25519PublicKey
impl Unpin for MultiEd25519PublicKey
impl UnwindSafe for MultiEd25519PublicKey
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
key
and return true
if they are equal.