aws_lc_rs::ptr

Struct ManagedPointer

Source
pub(crate) struct ManagedPointer<P: Pointer> {
    pointer: P,
}

Fields§

§pointer: P

Implementations§

Source§

impl ManagedPointer<*mut EVP_PKEY>

Source

pub(crate) fn validate_as_ed25519(&self) -> Result<(), KeyRejected>

Source

pub(crate) fn id(&self) -> i32

Source

pub(crate) fn key_size_bytes(&self) -> usize

Source

pub(crate) fn key_size_bits(&self) -> usize

Source

pub(crate) fn signature_size_bytes(&self) -> usize

Source

pub(crate) fn get_ec_key(&self) -> Result<ConstPointer<EC_KEY>, KeyRejected>

Source

pub(crate) fn get_rsa(&self) -> Result<ConstPointer<RSA>, KeyRejected>

Source

pub(crate) fn marshal_rfc5280_public_key(&self) -> Result<Vec<u8>, Unspecified>

Source

pub(crate) fn parse_rfc5280_public_key( bytes: &[u8], evp_pkey_type: c_int, ) -> Result<Self, KeyRejected>

Source

pub(crate) fn marshal_rfc5208_private_key( &self, version: Version, ) -> Result<Vec<u8>, Unspecified>

Source

pub(crate) fn parse_rfc5208_private_key( bytes: &[u8], evp_pkey_type: c_int, ) -> Result<Self, KeyRejected>

Source

pub(crate) fn create_EVP_PKEY_CTX( &self, ) -> Result<ManagedPointer<*mut EVP_PKEY_CTX>, ()>

Source

pub(crate) fn marshal_raw_private_key(&self) -> Result<Vec<u8>, Unspecified>

Source

pub(crate) fn marshal_raw_private_to_buffer( &self, buffer: &mut [u8], ) -> Result<usize, Unspecified>

Source

pub(crate) fn marshal_raw_public_key(&self) -> Result<Vec<u8>, Unspecified>

Source

pub(crate) fn marshal_raw_public_to_buffer( &self, buffer: &mut [u8], ) -> Result<usize, Unspecified>

Source

pub(crate) fn parse_raw_private_key( bytes: &[u8], evp_pkey_type: c_int, ) -> Result<Self, KeyRejected>

Source

pub(crate) fn parse_raw_public_key( bytes: &[u8], evp_pkey_type: c_int, ) -> Result<Self, KeyRejected>

Source

pub(crate) fn sign<F>( &self, message: &[u8], digest: Option<&'static Algorithm>, padding_fn: Option<F>, ) -> Result<Box<[u8]>, Unspecified>

Source

pub(crate) fn verify<F>( &self, msg: &[u8], digest: Option<&'static Algorithm>, padding_fn: Option<F>, signature: &[u8], ) -> Result<(), Unspecified>

Source

pub(crate) fn generate<F>( pkey_type: c_int, params_fn: Option<F>, ) -> Result<Self, Unspecified>

Source§

impl<P: Pointer> ManagedPointer<P>

Source

pub fn new<T: IntoPointer<P>>(value: T) -> Result<Self, ()>

Source

pub unsafe fn as_slice(&self, len: usize) -> &[P::T]

Source§

impl<P: Pointer> ManagedPointer<P>

Source

pub fn as_const(&self) -> ConstPointer<P::T>

Source

pub unsafe fn as_mut_unsafe(&self) -> MutPointer<P::T>

Source

pub fn as_mut(&mut self) -> MutPointer<P::T>

Trait Implementations§

Source§

impl AsRef<ManagedPointer<*mut evp_aead_ctx_st>> for AeadCtx

Source§

fn as_ref(&self) -> &ManagedPointer<*mut EVP_AEAD_CTX>

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl Clone for ManagedPointer<*mut EVP_PKEY>

Source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<P: Debug + Pointer> Debug for ManagedPointer<P>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<P: Pointer> Drop for ManagedPointer<P>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl<P: Pointer> From<DetachablePointer<P>> for ManagedPointer<P>

Source§

fn from(dptr: DetachablePointer<P>) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for ManagedPointer<*mut EVP_PKEY>

Source§

fn eq(&self, other: &Self) -> bool

Only compares params and public key

1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl TryFrom<&[u8]> for ManagedPointer<*mut BIGNUM>

Source§

type Error = ()

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

fn try_from(bytes: &[u8]) -> Result<Self, Self::Error>

Performs the conversion.

Auto Trait Implementations§

§

impl<P> Freeze for ManagedPointer<P>
where P: Freeze,

§

impl<P> RefUnwindSafe for ManagedPointer<P>
where P: RefUnwindSafe,

§

impl<P> Send for ManagedPointer<P>
where P: Send,

§

impl<P> Sync for ManagedPointer<P>
where P: Sync,

§

impl<P> Unpin for ManagedPointer<P>
where P: Unpin,

§

impl<P> UnwindSafe for ManagedPointer<P>
where P: UnwindSafe,

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> 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.