Struct wasi_crypto::CryptoCtx

source ·
pub struct CryptoCtx { /* private fields */ }

Implementations§

source§

impl CryptoCtx

source

pub fn array_output_len( &self, array_output_handle: Handle ) -> Result<usize, CryptoError>

source

pub fn array_output_pull( &self, array_output_handle: Handle, buf: &mut [u8] ) -> Result<usize, CryptoError>

source§

impl CryptoCtx

source

pub fn keypair_generate( &self, alg_type: AlgorithmType, alg_str: &str, options_handle: Option<Handle> ) -> Result<Handle, CryptoError>

source

pub fn keypair_import( &self, alg_type: AlgorithmType, alg_str: &str, encoded: &[u8], encoding: KeyPairEncoding ) -> Result<Handle, CryptoError>

source

pub fn keypair_id( &self, kp_handle: Handle ) -> Result<(Vec<u8>, Version), CryptoError>

source

pub fn keypair_from_pk_and_sk( &self, pk_handle: Handle, sk_handle: Handle ) -> Result<Handle, CryptoError>

source

pub fn keypair_export( &self, kp_handle: Handle, encoding: KeyPairEncoding ) -> Result<Handle, CryptoError>

source

pub fn keypair_publickey( &self, kp_handle: Handle ) -> Result<Handle, CryptoError>

source

pub fn keypair_secretkey( &self, kp_handle: Handle ) -> Result<Handle, CryptoError>

source

pub fn keypair_close(&self, kp_handle: Handle) -> Result<(), CryptoError>

source§

impl CryptoCtx

source

pub fn keypair_generate_managed( &self, _secrets_manager_handle: Handle, _alg_type: AlgorithmType, _alg_str: &str, _options_handle: Option<Handle> ) -> Result<Handle, CryptoError>

source

pub fn keypair_store_managed( &self, _secrets_manager_handle: Handle, kp_handle: Handle, _key_id_buf: &mut [u8] ) -> Result<(), CryptoError>

source

pub fn keypair_replace_managed( &self, _secrets_manager_handle: Handle, kp_old_handle: Handle, kp_new_handle: Handle ) -> Result<Version, CryptoError>

source

pub fn keypair_from_id( &self, _secrets_manager_handle: Handle, _symmetric_key_id: &[u8], _symmetric_key_version: Version ) -> Result<Handle, CryptoError>

source§

impl CryptoCtx

source

pub fn publickey_import( &self, alg_type: AlgorithmType, alg_str: &str, encoded: &[u8], encoding: PublicKeyEncoding ) -> Result<Handle, CryptoError>

source

pub fn publickey_export( &self, pk_handle: Handle, encoding: PublicKeyEncoding ) -> Result<Handle, CryptoError>

source

pub fn publickey_verify(&self, pk: Handle) -> Result<(), CryptoError>

source

pub fn publickey_close(&self, pk: Handle) -> Result<(), CryptoError>

source§

impl CryptoCtx

source

pub fn secretkey_import( &self, alg_type: AlgorithmType, alg_str: &str, encoded: &[u8], encoding: SecretKeyEncoding ) -> Result<Handle, CryptoError>

source

pub fn secretkey_export( &self, sk_handle: Handle, encoding: SecretKeyEncoding ) -> Result<Handle, CryptoError>

source

pub fn publickey(&self, sk_handle: Handle) -> Result<Handle, CryptoError>

source

pub fn secretkey_close(&self, sk: Handle) -> Result<(), CryptoError>

source§

impl CryptoCtx

source

pub fn kx_encapsulate( &self, pk_handle: Handle ) -> Result<(Handle, Handle), CryptoError>

source§

impl CryptoCtx

source

pub fn kx_dh( &self, pk_handle: Handle, sk_handle: Handle ) -> Result<Handle, CryptoError>

source

pub fn kx_decapsulate( &self, sk_handle: Handle, encapsulated_secret: &[u8] ) -> Result<Handle, CryptoError>

source§

impl CryptoCtx

source

pub fn options_open( &self, algorithm_type: AlgorithmType ) -> Result<Handle, CryptoError>

source

pub fn options_close(&self, options_handle: Handle) -> Result<(), CryptoError>

source

pub fn options_set( &self, options_handle: Handle, name: &str, value: &[u8] ) -> Result<(), CryptoError>

source

pub fn options_set_guest_buffer( &self, options_handle: Handle, name: &str, buffer: &'static mut [u8] ) -> Result<(), CryptoError>

source

pub fn options_set_u64( &self, options_handle: Handle, name: &str, value: u64 ) -> Result<(), CryptoError>

source

pub fn options_get( &self, options_handle: Handle, name: &str, value: &mut [u8] ) -> Result<usize, CryptoError>

source

pub fn options_get_u64( &self, options_handle: Handle, name: &str ) -> Result<u64, CryptoError>

source§

impl CryptoCtx

source

pub fn secrets_manager_open( &self, _options: Option<Handle> ) -> Result<Handle, CryptoError>

source

pub fn secrets_manager_close( &self, _secrets_manager_handle: Handle ) -> Result<(), CryptoError>

source

pub fn secrets_manager_invalidate( &self, _secrets_manager_handle: Handle, _key_id: &[u8], _key_version: Version ) -> Result<(), CryptoError>

source§

impl CryptoCtx

source

pub fn signature_export( &self, signature_handle: Handle, encoding: SignatureEncoding ) -> Result<Handle, CryptoError>

source

pub fn signature_import( &self, alg_str: &str, encoded: &[u8], encoding: SignatureEncoding ) -> Result<Handle, CryptoError>

source

pub fn signature_state_open( &self, kp_handle: Handle ) -> Result<Handle, CryptoError>

source

pub fn signature_state_update( &self, state_handle: Handle, input: &[u8] ) -> Result<(), CryptoError>

source

pub fn signature_state_sign( &self, state_handle: Handle ) -> Result<Handle, CryptoError>

source

pub fn signature_state_close(&self, handle: Handle) -> Result<(), CryptoError>

source

pub fn signature_verification_state_open( &self, pk_handle: Handle ) -> Result<Handle, CryptoError>

source

pub fn signature_verification_state_update( &self, verification_state_handle: Handle, input: &[u8] ) -> Result<(), CryptoError>

source

pub fn signature_verification_state_verify( &self, verification_state_handle: Handle, signature_handle: Handle ) -> Result<(), CryptoError>

source

pub fn signature_verification_state_close( &self, verification_state_handle: Handle ) -> Result<(), CryptoError>

source

pub fn signature_close( &self, signature_handle: Handle ) -> Result<(), CryptoError>

source§

impl CryptoCtx

source

pub fn symmetric_key_generate( &self, alg_str: &str, options_handle: Option<Handle> ) -> Result<Handle, CryptoError>

source

pub fn symmetric_key_import( &self, alg_str: &str, raw: &[u8] ) -> Result<Handle, CryptoError>

source

pub fn symmetric_key_export( &self, symmetric_key_handle: Handle ) -> Result<Handle, CryptoError>

source

pub fn symmetric_key_id( &self, symmetric_key_handle: Handle ) -> Result<(Vec<u8>, Version), CryptoError>

source

pub fn symmetric_key_close( &self, symmetric_key_handle: Handle ) -> Result<(), CryptoError>

source§

impl CryptoCtx

source

pub fn symmetric_key_generate_managed( &self, _secrets_manager_handle: Handle, _alg_str: &str, _options_handle: Option<Handle> ) -> Result<Handle, CryptoError>

source

pub fn symmetric_key_store_managed( &self, _secrets_manager_handle: Handle, symmetric_key_handle: Handle, _key_id_buf: &mut [u8] ) -> Result<(), CryptoError>

source

pub fn symmetric_key_replace_managed( &self, _secrets_manager_handle: Handle, symmetric_key_old_handle: Handle, symmetric_key_new_handle: Handle ) -> Result<Version, CryptoError>

source

pub fn symmetric_key_from_id( &self, _secrets_manager_handle: Handle, _symmetric_key_id: &[u8], _symmetric_key_version: Version ) -> Result<Handle, CryptoError>

source§

impl CryptoCtx

source

pub fn symmetric_state_open( &self, alg_str: &str, key_handle: Option<Handle>, options_handle: Option<Handle> ) -> Result<Handle, CryptoError>

source

pub fn symmetric_state_options_get( &self, symmetric_state_handle: Handle, name: &str, value: &mut [u8] ) -> Result<usize, CryptoError>

source

pub fn symmetric_state_options_get_u64( &self, symmetric_state_handle: Handle, name: &str ) -> Result<u64, CryptoError>

source

pub fn symmetric_state_close( &self, symmetric_state_handle: Handle ) -> Result<(), CryptoError>

source

pub fn symmetric_state_clone( &self, symmetric_state_handle: Handle ) -> Result<Handle, CryptoError>

source

pub fn symmetric_state_absorb( &self, symmetric_state_handle: Handle, data: &[u8] ) -> Result<(), CryptoError>

source

pub fn symmetric_state_squeeze( &self, symmetric_state_handle: Handle, out: &mut [u8] ) -> Result<(), CryptoError>

source

pub fn symmetric_state_squeeze_tag( &self, symmetric_state_handle: Handle ) -> Result<Handle, CryptoError>

source

pub fn symmetric_state_squeeze_key( &self, symmetric_state_handle: Handle, alg_str: &str ) -> Result<Handle, CryptoError>

source

pub fn symmetric_state_max_tag_len( &self, symmetric_state_handle: Handle ) -> Result<usize, CryptoError>

source

pub fn symmetric_state_encrypt( &self, symmetric_state_handle: Handle, out: &mut [u8], data: &[u8] ) -> Result<usize, CryptoError>

source

pub fn symmetric_state_encrypt_detached( &self, symmetric_state_handle: Handle, out: &mut [u8], data: &[u8] ) -> Result<Handle, CryptoError>

source

pub fn symmetric_state_decrypt( &self, symmetric_state_handle: Handle, out: &mut [u8], data: &[u8] ) -> Result<usize, CryptoError>

source

pub fn symmetric_state_decrypt_detached( &self, symmetric_state_handle: Handle, out: &mut [u8], data: &[u8], raw_tag: &[u8] ) -> Result<usize, CryptoError>

source

pub fn symmetric_state_ratchet( &self, symmetric_state_handle: Handle ) -> Result<(), CryptoError>

source§

impl CryptoCtx

source

pub fn symmetric_tag_len( &self, symmetric_tag_handle: Handle ) -> Result<usize, CryptoError>

source

pub fn symmetric_tag_pull( &self, symmetric_tag_handle: Handle, buf: &mut [u8] ) -> Result<usize, CryptoError>

source

pub fn symmetric_tag_verify( &self, symmetric_tag_handle: Handle, expected_raw: &[u8] ) -> Result<(), CryptoError>

source

pub fn symmetric_tag_close( &self, symmetric_tag_handle: Handle ) -> Result<(), CryptoError>

source§

impl CryptoCtx

source

pub fn new() -> Self

source

pub fn set_limits(&mut self, limits: Limits)

source

pub fn new_with_limits(limits: Limits) -> Self

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.