Struct infinitree::crypto::KeyingScheme
source · [−]pub struct KeyingScheme<H, I> { /* private fields */ }
Expand description
Binds header and internal encryption. This type can only be instantiated through type aliases.
Implementations
sourceimpl KeyingScheme<Argon2UserPass, Symmetric>
impl KeyingScheme<Argon2UserPass, Symmetric>
pub fn generate_password() -> Result<String, CryptoError>
pub fn with_credentials(
username: impl Into<SecretString>,
password: impl Into<SecretString>
) -> Result<Self, CryptoError>
sourceimpl KeyingScheme<Argon2UserPass, CryptoBoxStorage>
impl KeyingScheme<Argon2UserPass, CryptoBoxStorage>
sourcepub fn encrypt_only(
username: impl Into<SecretString>,
password: impl Into<SecretString>,
public_key: RawKey
) -> Result<Self, CryptoError>
pub fn encrypt_only(
username: impl Into<SecretString>,
password: impl Into<SecretString>,
public_key: RawKey
) -> Result<Self, CryptoError>
Create a crypto backend that only allows encryption through
Infinitree::storage_writer
.
Panics
The resulting encryption backend will panic if decryption
operation is done through Infinitree::storage_reader
.
sourcepub fn encrypt_and_decrypt(
username: SecretString,
password: SecretString,
public_key: RawKey,
secret_key: RawKey
) -> Result<Self, CryptoError>
pub fn encrypt_and_decrypt(
username: SecretString,
password: SecretString,
public_key: RawKey,
secret_key: RawKey
) -> Result<Self, CryptoError>
Create a crypto backend that allows encryption and decryption
for writers and readers acquired through
Infinitree::storage_writer
and
Infinitree::storage_reader
,
respectively.
sourceimpl KeyingScheme<YubikeyHeader, Symmetric>
impl KeyingScheme<YubikeyHeader, Symmetric>
pub fn with_credentials(
username: SecretString,
password: SecretString,
ykconfig: Config
) -> Result<Self, CryptoError>
Trait Implementations
Auto Trait Implementations
impl<H, I> RefUnwindSafe for KeyingScheme<H, I> where
H: RefUnwindSafe,
I: RefUnwindSafe,
impl<H, I> Send for KeyingScheme<H, I> where
H: Send + Sync,
I: Send,
impl<H, I> Sync for KeyingScheme<H, I> where
H: Send + Sync,
I: Sync,
impl<H, I> Unpin for KeyingScheme<H, I> where
I: Unpin,
impl<H, I> UnwindSafe for KeyingScheme<H, I> where
H: RefUnwindSafe,
I: UnwindSafe,
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