[−][src]Struct openssl::derive::Deriver
A type used to derive a shared secret between two keys.
Implementations
impl<'a> Deriver<'a>
[src]
pub fn new<T>(key: &'a PKeyRef<T>) -> Result<Deriver<'a>, ErrorStack> where
T: HasPrivate,
[src]
T: HasPrivate,
Creates a new Deriver
using the provided private key.
This corresponds to EVP_PKEY_derive_init
.
pub fn set_peer<T>(&mut self, key: &'a PKeyRef<T>) -> Result<(), ErrorStack> where
T: HasPublic,
[src]
T: HasPublic,
Sets the peer key used for secret derivation.
This corresponds to EVP_PKEY_derive_set_peer
:
pub fn len(&mut self) -> Result<usize, ErrorStack>
[src]
Returns the size of the shared secret.
It can be used to size the buffer passed to Deriver::derive
.
This corresponds to EVP_PKEY_derive
.
pub fn derive(&mut self, buf: &mut [u8]) -> Result<usize, ErrorStack>
[src]
Derives a shared secret between the two keys, writing it into the buffer.
Returns the number of bytes written.
This corresponds to EVP_PKEY_derive
.
pub fn derive_to_vec(&mut self) -> Result<Vec<u8>, ErrorStack>
[src]
A convenience function which derives a shared secret and returns it in a new buffer.
This simply wraps Deriver::len
and Deriver::derive
.
Trait Implementations
Auto Trait Implementations
impl<'a> RefUnwindSafe for Deriver<'a>
impl<'a> Unpin for Deriver<'a>
impl<'a> UnwindSafe for Deriver<'a>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,