pub enum EncryptionType {
XChaCha20Poly1305,
Unknown,
}
Expand description
Represents the type of encryption for a EncryptionCodec
Variants§
XChaCha20Poly1305
ChaCha20Poly1305 variant with an extended 192-bit (24-byte) nonce
Unknown
Indicates an unknown encryption type for use in handshakes
Implementations§
Source§impl EncryptionType
impl EncryptionType
Sourcepub fn generate_secret_key_bytes(&self) -> Result<Vec<u8>>
pub fn generate_secret_key_bytes(&self) -> Result<Vec<u8>>
Generates bytes for a secret key based on the encryption type
Sourcepub const fn known_variants() -> &'static [EncryptionType]
pub const fn known_variants() -> &'static [EncryptionType]
Returns a list of all variants of the type except unknown.
Sourcepub fn is_unknown(&self) -> bool
pub fn is_unknown(&self) -> bool
Returns true if type is unknown
Sourcepub fn new_codec(&self, key: &[u8]) -> Result<EncryptionCodec>
pub fn new_codec(&self, key: &[u8]) -> Result<EncryptionCodec>
Creates a new EncryptionCodec
for this type, failing if this type is unknown or the key
is an invalid length
Trait Implementations§
Source§impl Clone for EncryptionType
impl Clone for EncryptionType
Source§fn clone(&self) -> EncryptionType
fn clone(&self) -> EncryptionType
Returns a copy 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 EncryptionType
impl Debug for EncryptionType
Source§impl<'de> Deserialize<'de> for EncryptionType
impl<'de> Deserialize<'de> for EncryptionType
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 EncryptionType
impl Display for EncryptionType
Source§impl Hash for EncryptionType
impl Hash for EncryptionType
Source§impl PartialEq for EncryptionType
impl PartialEq for EncryptionType
Source§impl Serialize for EncryptionType
impl Serialize for EncryptionType
impl Copy for EncryptionType
impl Eq for EncryptionType
impl StructuralPartialEq for EncryptionType
Auto Trait Implementations§
impl Freeze for EncryptionType
impl RefUnwindSafe for EncryptionType
impl Send for EncryptionType
impl Sync for EncryptionType
impl Unpin for EncryptionType
impl UnwindSafe for EncryptionType
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