pub enum PrivateEncryptKey {
Ntru128 {
pk: PublicEncryptKey,
sk: Vec<u8>,
},
Ntru192 {
pk: PublicEncryptKey,
sk: Vec<u8>,
},
Ntru256 {
pk: PublicEncryptKey,
sk: Vec<u8>,
},
}Expand description
Private encryption keys provide the ability to decrypt a secret that was encrypted using a Public Key - this capability is useful for key-exchange and trust validation in the crypto chain. Asymetric crypto in ATE uses the leading candidates from NIST that provide protection against quantom computer attacks
Variants§
Implementations§
Source§impl PrivateEncryptKey
impl PrivateEncryptKey
pub fn generate(size: KeySize) -> PrivateEncryptKey
pub fn as_public_key<'a>(&'a self) -> &'a PublicEncryptKey
pub fn hash(&self) -> AteHash
pub fn pk<'a>(&'a self) -> &'a [u8] ⓘ
pub fn sk<'a>(&'a self) -> &'a [u8] ⓘ
pub fn decapsulate(&self, iv: &InitializationVector) -> Option<EncryptKey>
pub fn decrypt( &self, iv: &InitializationVector, data: &[u8], ) -> Result<Vec<u8>, Error>
pub fn decrypt_ext( &self, iv: &InitializationVector, data: &[u8], ek_hash: &AteHash, ) -> Result<Vec<u8>, Error>
pub fn size(&self) -> KeySize
Trait Implementations§
Source§impl Clone for PrivateEncryptKey
impl Clone for PrivateEncryptKey
Source§fn clone(&self) -> PrivateEncryptKey
fn clone(&self) -> PrivateEncryptKey
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PrivateEncryptKey
impl Debug for PrivateEncryptKey
Source§impl<'de> Deserialize<'de> for PrivateEncryptKey
impl<'de> Deserialize<'de> for PrivateEncryptKey
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for PrivateEncryptKey
impl Display for PrivateEncryptKey
Source§impl Hash for PrivateEncryptKey
impl Hash for PrivateEncryptKey
Source§impl PartialEq for PrivateEncryptKey
impl PartialEq for PrivateEncryptKey
Source§impl Serialize for PrivateEncryptKey
impl Serialize for PrivateEncryptKey
impl Eq for PrivateEncryptKey
impl StructuralPartialEq for PrivateEncryptKey
Auto Trait Implementations§
impl Freeze for PrivateEncryptKey
impl RefUnwindSafe for PrivateEncryptKey
impl Send for PrivateEncryptKey
impl Sync for PrivateEncryptKey
impl Unpin for PrivateEncryptKey
impl UnwindSafe for PrivateEncryptKey
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.