Struct snarkos_account::Account
source · pub struct Account<N: Network> { /* private fields */ }
Expand description
A helper struct for an Aleo account.
Implementations§
source§impl<N: Network> Account<N>
impl<N: Network> Account<N>
sourcepub const fn private_key(&self) -> &PrivateKey<N>
pub const fn private_key(&self) -> &PrivateKey<N>
Returns the account private key.
source§impl<N: Network> Account<N>
impl<N: Network> Account<N>
sourcepub fn sign<R: Rng + CryptoRng>(
&self,
message: &[Field<N>],
rng: &mut R
) -> Result<Signature<N>>
pub fn sign<R: Rng + CryptoRng>( &self, message: &[Field<N>], rng: &mut R ) -> Result<Signature<N>>
Returns a signature for the given message (as field elements), using the account private key.
sourcepub fn sign_bytes<R: Rng + CryptoRng>(
&self,
message: &[u8],
rng: &mut R
) -> Result<Signature<N>>
pub fn sign_bytes<R: Rng + CryptoRng>( &self, message: &[u8], rng: &mut R ) -> Result<Signature<N>>
Returns a signature for the given message (as bytes), using the account private key.
sourcepub fn sign_bits<R: Rng + CryptoRng>(
&self,
message: &[bool],
rng: &mut R
) -> Result<Signature<N>>
pub fn sign_bits<R: Rng + CryptoRng>( &self, message: &[bool], rng: &mut R ) -> Result<Signature<N>>
Returns a signature for the given message (as bits), using the account private key.
sourcepub fn verify(&self, message: &[Field<N>], signature: &Signature<N>) -> bool
pub fn verify(&self, message: &[Field<N>], signature: &Signature<N>) -> bool
Verifies a signature for the given message (as fields), using the account address.
sourcepub fn verify_bytes(&self, message: &[u8], signature: &Signature<N>) -> bool
pub fn verify_bytes(&self, message: &[u8], signature: &Signature<N>) -> bool
Verifies a signature for the given message (as bytes), using the account address.
sourcepub fn verify_bits(&self, message: &[bool], signature: &Signature<N>) -> bool
pub fn verify_bits(&self, message: &[bool], signature: &Signature<N>) -> bool
Verifies a signature for the given message (as bits), using the account address.
Trait Implementations§
Auto Trait Implementations§
impl<N> RefUnwindSafe for Account<N>where
<N as Environment>::Field: RefUnwindSafe,
<N as Environment>::Projective: RefUnwindSafe,
<N as Environment>::Scalar: RefUnwindSafe,
impl<N> Send for Account<N>
impl<N> Sync for Account<N>
impl<N> Unpin for Account<N>
impl<N> UnwindSafe for Account<N>where
<N as Environment>::Field: UnwindSafe,
<N as Environment>::Projective: 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