Struct aleo_wasm::record::record_ciphertext::RecordCiphertext
source · pub struct RecordCiphertext(/* private fields */);
Expand description
Encrypted Aleo record
Implementations§
source§impl RecordCiphertext
impl RecordCiphertext
sourcepub fn from_string(record: &str) -> Result<RecordCiphertext, String>
pub fn from_string(record: &str) -> Result<RecordCiphertext, String>
Create a record ciphertext from a string
@param {string} record String representation of a record ciphertext @returns {RecordCiphertext | Error} Record ciphertext
sourcepub fn to_string(&self) -> String
pub fn to_string(&self) -> String
Return the string reprensentation of the record ciphertext
@returns {string} String representation of the record ciphertext
sourcepub fn decrypt(&self, view_key: &ViewKey) -> Result<RecordPlaintext, String>
pub fn decrypt(&self, view_key: &ViewKey) -> Result<RecordPlaintext, String>
Decrypt the record ciphertext into plaintext using the view key. The record will only decrypt if the record was encrypted by the account corresponding to the view key
@param {ViewKey} view_key View key used to decrypt the ciphertext @returns {RecordPlaintext | Error} Record plaintext object
Methods from Deref<Target = Record<Testnet3, Ciphertext<Testnet3>>>§
pub fn decrypt(
&self,
view_key: &ViewKey<N>
) -> Result<Record<N, Plaintext<N>>, Error>
pub fn decrypt( &self, view_key: &ViewKey<N> ) -> Result<Record<N, Plaintext<N>>, Error>
Decrypts self
into plaintext using the given view key and checks that the owner matches the view key.
pub fn decrypt_symmetric_unchecked(
&self,
record_view_key: &Field<N>
) -> Result<Record<N, Plaintext<N>>, Error>
pub fn decrypt_symmetric_unchecked( &self, record_view_key: &Field<N> ) -> Result<Record<N, Plaintext<N>>, Error>
Decrypts self
into plaintext using the given record view key.
Note: This method does not check that the record view key corresponds to the record owner.
Use Self::decrypt
for the checked variant.
pub fn encrypt(
&self,
randomizer: Scalar<N>
) -> Result<Record<N, Ciphertext<N>>, Error>
pub fn encrypt( &self, randomizer: Scalar<N> ) -> Result<Record<N, Ciphertext<N>>, Error>
Encrypts self
for the record owner under the given randomizer.
pub fn encrypt_symmetric_unchecked(
&self,
record_view_key: &Field<N>
) -> Result<Record<N, Ciphertext<N>>, Error>
pub fn encrypt_symmetric_unchecked( &self, record_view_key: &Field<N> ) -> Result<Record<N, Ciphertext<N>>, Error>
Encrypts self
under the given record view key.
Note: This method does not check that the record view key corresponds to the record owner.
Use Self::encrypt
for the checked variant.
pub fn find<A>(&self, path: &[A]) -> Result<Entry<N, Plaintext<N>>, Error>where
A: Into<Access<N>> + Copy + Debug,
pub fn find<A>(&self, path: &[A]) -> Result<Entry<N, Plaintext<N>>, Error>where A: Into<Access<N>> + Copy + Debug,
Returns the entry from the given path.
pub fn is_owner(&self, view_key: &ViewKey<N>) -> bool
pub fn is_owner(&self, view_key: &ViewKey<N>) -> bool
Decrypts self
into plaintext using the given view key.
pub fn is_owner_with_address_x_coordinate(
&self,
view_key: &ViewKey<N>,
address_x_coordinate: &Field<N>
) -> bool
pub fn is_owner_with_address_x_coordinate( &self, view_key: &ViewKey<N>, address_x_coordinate: &Field<N> ) -> bool
Decrypts self
into plaintext using the x-coordinate of the address corresponding to the given view key.
pub fn to_commitment(
&self,
program_id: &ProgramID<N>,
record_name: &Identifier<N>
) -> Result<Field<N>, Error>
pub fn to_commitment( &self, program_id: &ProgramID<N>, record_name: &Identifier<N> ) -> Result<Field<N>, Error>
Returns the record commitment.
pub fn to_commitment(
&self,
_program_id: &ProgramID<N>,
_record_name: &Identifier<N>
) -> Result<Field<N>, Error>
pub fn to_commitment( &self, _program_id: &ProgramID<N>, _record_name: &Identifier<N> ) -> Result<Field<N>, Error>
Returns the record commitment.
pub fn owner(&self) -> &Owner<N, Private>
pub fn owner(&self) -> &Owner<N, Private>
Returns the owner of the program record.
pub fn nonce(&self) -> &Group<N>
pub fn nonce(&self) -> &Group<N>
Returns the nonce of the program record.
Trait Implementations§
source§impl Clone for RecordCiphertext
impl Clone for RecordCiphertext
source§fn clone(&self) -> RecordCiphertext
fn clone(&self) -> RecordCiphertext
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Deref for RecordCiphertext
impl Deref for RecordCiphertext
source§impl From<RecordCiphertext> for JsValue
impl From<RecordCiphertext> for JsValue
source§fn from(value: RecordCiphertext) -> Self
fn from(value: RecordCiphertext) -> Self
source§impl FromStr for RecordCiphertext
impl FromStr for RecordCiphertext
source§impl FromWasmAbi for RecordCiphertext
impl FromWasmAbi for RecordCiphertext
source§impl IntoWasmAbi for RecordCiphertext
impl IntoWasmAbi for RecordCiphertext
source§impl OptionFromWasmAbi for RecordCiphertext
impl OptionFromWasmAbi for RecordCiphertext
source§impl OptionIntoWasmAbi for RecordCiphertext
impl OptionIntoWasmAbi for RecordCiphertext
source§impl RefFromWasmAbi for RecordCiphertext
impl RefFromWasmAbi for RecordCiphertext
§type Anchor = Ref<'static, RecordCiphertext>
type Anchor = Ref<'static, RecordCiphertext>
Self
for the duration of the
invocation of the function that has an &Self
parameter. This is
required to ensure that the lifetimes don’t persist beyond one function
call, and so that they remain anonymous.source§impl RefMutFromWasmAbi for RecordCiphertext
impl RefMutFromWasmAbi for RecordCiphertext
source§impl TryFromJsValue for RecordCiphertext
impl TryFromJsValue for RecordCiphertext
source§impl VectorFromWasmAbi for RecordCiphertext
impl VectorFromWasmAbi for RecordCiphertext
type Abi = <Box<[JsValue]> as FromWasmAbi>::Abi
unsafe fn vector_from_abi(js: Self::Abi) -> Box<[RecordCiphertext]>
source§impl VectorIntoWasmAbi for RecordCiphertext
impl VectorIntoWasmAbi for RecordCiphertext
type Abi = <Box<[JsValue]> as IntoWasmAbi>::Abi
fn vector_into_abi(vector: Box<[RecordCiphertext]>) -> Self::Abi
source§impl WasmDescribeVector for RecordCiphertext
impl WasmDescribeVector for RecordCiphertext
Auto Trait Implementations§
impl RefUnwindSafe for RecordCiphertext
impl Send for RecordCiphertext
impl Sync for RecordCiphertext
impl Unpin for RecordCiphertext
impl UnwindSafe for RecordCiphertext
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere T: IntoWasmAbi,
§type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
IntoWasmAbi::Abi
source§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
IntoWasmAbi::into_abi
, except that it may throw and never
return in the case of Err
.