Struct libes::Ecies

source ·
pub struct Ecies<K, E, A> { /* private fields */ }
Expand description

Generic ECIES instance

Implementations§

source§

impl<K: Key, E, A> Ecies<K, E, A>

source

pub fn new<T: IntoPublicKey<K>>(recipient_public_key: T) -> Self

Create a new ECIES<K, E, A> instance given a recipient_public_key compatible with K

source

pub fn try_new<T: TryIntoPublicKey<K>>( recipient_public_key: T ) -> Result<Self, KeyError>

source§

impl<K, E, A> Ecies<K, E, A>where K: EciesMacEncryptionSupport + Key + GenerateEphemeralKey + KeyExchange + DeriveKeyMaterial, E: EciesMacEncryptionSupport + Encryption + GenerateNonce + TakeEncryptionKey, A: Mac + TakeMacKey,

source

pub fn encrypt(&self, plaintext: &[u8]) -> Result<Vec<u8>, EciesError>

Encrypt plaintext using the ECIES-MAC variant

source§

impl<K, E, A> Ecies<K, E, A>where K: EciesMacDecryptionSupport + Key + TakeEphemeralKey + KeyExchange + DeriveKeyMaterial, E: EciesMacDecryptionSupport + Encryption + TakeNonce + TakeEncryptionKey, A: Mac + TakeMac,

source

pub fn decrypt<T: IntoSecretKeyRef<K>>( recipient_secret_key: &T, ciphertext: &[u8] ) -> Result<Vec<u8>, EciesError>

Decrypt ciphertext using the ECIES-MAC variant, given the recipient_secret_key it was encrypted for

source§

impl<K, E> Ecies<K, E, Aead>where K: EciesAeadEncryptionSupport + Key + GenerateEphemeralKey + KeyExchange + DeriveKeyMaterial, E: EciesAeadEncryptionSupport + Encryption + GenerateNonce + TakeEncryptionKey,

source

pub fn encrypt(&self, plaintext: &[u8]) -> Result<Vec<u8>, EciesError>

Encrypt plaintext using the ECIES-AEAD variant

source§

impl<K, E> Ecies<K, E, Aead>where K: EciesAeadDecryptionSupport + Key + TakeEphemeralKey + KeyExchange + DeriveKeyMaterial, E: EciesAeadDecryptionSupport + Encryption + TakeNonce + TakeEncryptionKey,

source

pub fn decrypt<T: IntoSecretKeyRef<K>>( recipient_secret_key: &T, ciphertext: &[u8] ) -> Result<Vec<u8>, EciesError>

Decrypt ciphertext using the ECIES-AEAD variant, given the recipient_secret_key it was encrypted for

source§

impl<K, E> Ecies<K, E, Syn>where K: EciesSynEncryptionSupport + Key + GenerateEphemeralKey + KeyExchange + DeriveKeyMaterial, E: EciesSynEncryptionSupport + Encryption + TakeNonce + TakeEncryptionKey,

source

pub fn encrypt(&self, plaintext: &[u8]) -> Result<Vec<u8>, EciesError>

Encrypt plaintext using the ECIES-SYN variant

source§

impl<K, E> Ecies<K, E, Syn>where K: EciesSynDecryptionSupport + Key + TakeEphemeralKey + KeyExchange + DeriveKeyMaterial, E: EciesSynDecryptionSupport + Encryption + TakeNonce + TakeEncryptionKey,

source

pub fn decrypt<T: IntoSecretKeyRef<K>>( recipient_secret_key: &T, ciphertext: &[u8] ) -> Result<Vec<u8>, EciesError>

Decrypt ciphertext using the ECIES-SYN variant, given the recipient_secret_key it was encrypted for

Auto Trait Implementations§

§

impl<K, E, A> RefUnwindSafe for Ecies<K, E, A>where A: RefUnwindSafe, E: RefUnwindSafe, K: RefUnwindSafe,

§

impl<K, E, A> Send for Ecies<K, E, A>where A: Send, E: Send, K: Send,

§

impl<K, E, A> Sync for Ecies<K, E, A>where A: Sync, E: Sync, K: Sync,

§

impl<K, E, A> Unpin for Ecies<K, E, A>where A: Unpin, E: Unpin, K: Unpin,

§

impl<K, E, A> UnwindSafe for Ecies<K, E, A>where A: UnwindSafe, E: UnwindSafe, K: UnwindSafe,

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,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

const: unstable · 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, U> IntoPublicKey<U> for Twhere U: PublicKeyFrom<T>,

source§

fn into_pk(self) -> U

source§

impl<T, U> IntoSecretKey<U> for Twhere U: SecretKeyFrom<T>,

source§

fn into_sk(self) -> <U as Key>::SecretKey

source§

impl<T, U> IntoSecretKeyRef<U> for Twhere U: SecretKeyFromRef<T>,

source§

fn into_sk_ref(&self) -> &<U as Key>::SecretKey

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.
const: unstable · 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.
const: unstable · source§

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

Performs the conversion.
source§

impl<T, U> TryIntoPublicKey<U> for Twhere U: TryPublicKeyFrom<T>,

source§

impl<T, U> TryIntoSecretKey<U> for Twhere U: TrySecretKeyFrom<T>,

source§

fn try_into_sk(self) -> Result<<U as Key>::SecretKey, KeyError>

§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V