pub enum Algorithm {
AesGcm256,
}
Expand description
The encryption algorithms known by PZip.
Encapsulates the enryption, decryption, key wrapping, and tags required for each algorithm.
Variants
AesGcm256
Implementations
sourceimpl Algorithm
impl Algorithm
sourcepub fn from(num: u8) -> Result<Algorithm, Error>
pub fn from(num: u8) -> Result<Algorithm, Error>
Returns an Algorithm
for the specified u8
if known, otherwise
Error::UnknownAlgorithm
.
Returns the PZipTags
to be used for new PZip files using
this algorithm.
Generally, this should return suitable random defaults for any encryption
parameters. Specifically, for AES-GCM, this returns a
Tag::Nonce
with 12 random bytes.
sourcepub fn wrap_key(&self, key_bytes: &[u8]) -> Result<LessSafeKey, Error>
pub fn wrap_key(&self, key_bytes: &[u8]) -> Result<LessSafeKey, Error>
Wraps the (either raw or already-derived) key bytes into a LessSafeKey
than
can be used for encryption and decryption with this algorithm.
Trait Implementations
impl Copy for Algorithm
impl Eq for Algorithm
impl StructuralEq for Algorithm
impl StructuralPartialEq for Algorithm
Auto Trait Implementations
impl RefUnwindSafe for Algorithm
impl Send for Algorithm
impl Sync for Algorithm
impl Unpin for Algorithm
impl UnwindSafe for Algorithm
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more