Skip to main content

CryptoCtx

Struct 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 T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> ArchivePointee for T

Source§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
Source§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where 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 T
where 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> LayoutRaw for T

Source§

fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>

Returns the layout of the type.
Source§

impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
where T: SharedNiching<N1, N2>, N1: Niching<T>, N2: Niching<T>,

Source§

unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool

Returns whether the given value has been niched. Read more
Source§

fn resolve_niched(out: Place<NichedOption<T, N1>>)

Writes data to out indicating that a T is niched.
Source§

impl<T> Pointee for T

Source§

type Metadata = ()

The metadata type for pointers and references to this type.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

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 T
where U: TryFrom<T>,

Source§

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.