Type Definition infinitree::crypto::cryptobox::StorageOnly
source · [−]pub type StorageOnly = KeyingScheme<Argon2UserPass, CryptoBoxStorage>;
Expand description
Asymmetric-key based encryption scheme to create archives with a write-only storage segment.
A fully write-only archive in Infinitree requires server-side support. However, we can get half-way there by storing any user-managed data through libsodium’s crypto_box scheme.
To write data using cryptobox, acquire a writer handle through
Infinitree::storage_writer. The
index itself is still symmetric for all operations that are
defined on Infinitree
.
Due to the fact that on changing the encryption scheme all
existing ChunkPointer
s would be invalidated, and would need
re-encryption, converting to and from CryptoBoxStorage
is not
supported.
Panics
Opening a tree with an invalid key currently panics.
Implementations
sourceimpl StorageOnly
impl StorageOnly
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.