Struct aleo_rust::snarkvm_types::PrivateKey
pub struct PrivateKey<N>where
N: Network,{ /* private fields */ }
Implementations§
§impl<N> PrivateKey<N>where
N: Network,
impl<N> PrivateKey<N>where N: Network,
pub fn try_from(seed: Field<N>) -> Result<PrivateKey<N>, Error>
pub fn try_from(seed: Field<N>) -> Result<PrivateKey<N>, Error>
Returns the account private key from an account seed.
§impl<N> PrivateKey<N>where
N: Network,
impl<N> PrivateKey<N>where N: Network,
pub fn sign<R>(
&self,
message: &[Field<N>],
rng: &mut R
) -> Result<Signature<N>, Error>where
R: Rng + CryptoRng,
pub fn sign<R>( &self, message: &[Field<N>], rng: &mut R ) -> Result<Signature<N>, Error>where R: Rng + CryptoRng,
Returns a signature for the given message (as field elements) using the private key.
§impl<N> PrivateKey<N>where
N: Network,
impl<N> PrivateKey<N>where N: Network,
Trait Implementations§
§impl<N> Clone for PrivateKey<N>where
N: Clone + Network,
impl<N> Clone for PrivateKey<N>where N: Clone + Network,
§fn clone(&self) -> PrivateKey<N>
fn clone(&self) -> PrivateKey<N>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more§impl<N> Debug for PrivateKey<N>where
N: Debug + Network,
impl<N> Debug for PrivateKey<N>where N: Debug + Network,
§impl<'de, N> Deserialize<'de> for PrivateKey<N>where
N: Network,
impl<'de, N> Deserialize<'de> for PrivateKey<N>where N: Network,
§fn deserialize<D>(
deserializer: D
) -> Result<PrivateKey<N>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>( deserializer: D ) -> Result<PrivateKey<N>, <D as Deserializer<'de>>::Error>where D: Deserializer<'de>,
Deserializes an account private key from a string or bytes.
§impl<N> Display for PrivateKey<N>where
N: Network,
impl<N> Display for PrivateKey<N>where N: Network,
§impl<N> FromBytes for PrivateKey<N>where
N: Network,
impl<N> FromBytes for PrivateKey<N>where N: Network,
§impl<N> FromStr for PrivateKey<N>where
N: Network,
impl<N> FromStr for PrivateKey<N>where N: Network,
§impl<N> Hash for PrivateKey<N>where
N: Hash + Network,
impl<N> Hash for PrivateKey<N>where N: Hash + Network,
§impl<N> PartialEq<PrivateKey<N>> for PrivateKey<N>where
N: PartialEq<N> + Network,
impl<N> PartialEq<PrivateKey<N>> for PrivateKey<N>where N: PartialEq<N> + Network,
§fn eq(&self, other: &PrivateKey<N>) -> bool
fn eq(&self, other: &PrivateKey<N>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.§impl<N> Serialize for PrivateKey<N>where
N: Network,
impl<N> Serialize for PrivateKey<N>where N: Network,
§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,
Serializes an account private key into string or bytes.
§impl<N> ToBytes for PrivateKey<N>where
N: Network,
impl<N> ToBytes for PrivateKey<N>where N: Network,
§impl<N> TryFrom<&PrivateKey<N>> for Address<N>where
N: Network,
impl<N> TryFrom<&PrivateKey<N>> for Address<N>where N: Network,
§impl<N> TryFrom<&PrivateKey<N>> for ViewKey<N>where
N: Network,
impl<N> TryFrom<&PrivateKey<N>> for ViewKey<N>where N: Network,
§impl<N> TryFrom<PrivateKey<N>> for Address<N>where
N: Network,
impl<N> TryFrom<PrivateKey<N>> for Address<N>where N: Network,
§impl<N> TryFrom<PrivateKey<N>> for ViewKey<N>where
N: Network,
impl<N> TryFrom<PrivateKey<N>> for ViewKey<N>where N: Network,
impl<N> Copy for PrivateKey<N>where N: Copy + Network,
impl<N> Eq for PrivateKey<N>where N: Eq + Network,
impl<N> StructuralEq for PrivateKey<N>where N: Network,
impl<N> StructuralPartialEq for PrivateKey<N>where N: Network,
Auto Trait Implementations§
impl<N> RefUnwindSafe for PrivateKey<N>where <N as Environment>::Field: RefUnwindSafe, <N as Environment>::Scalar: RefUnwindSafe,
impl<N> Send for PrivateKey<N>
impl<N> Sync for PrivateKey<N>
impl<N> Unpin for PrivateKey<N>where <N as Environment>::Field: Unpin, <N as Environment>::Scalar: Unpin,
impl<N> UnwindSafe for PrivateKey<N>where <N as Environment>::Field: UnwindSafe, <N as Environment>::Scalar: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<'de, T> DeserializeExt<'de> for Twhere
T: DeserializeOwned,
impl<'de, T> DeserializeExt<'de> for Twhere T: DeserializeOwned,
fn take_from_value<D>( value: &mut Value, field: &str ) -> Result<T, <D as Deserializer<'de>>::Error>where D: Deserializer<'de>,
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.§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,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§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,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.