pub struct Encryptor<S> { /* private fields */ }
Implementations§
source§impl<S> Encryptor<S>where
S: KVStorage,
impl<S> Encryptor<S>where S: KVStorage,
pub fn add_key(&mut self, version: KeyVersion, key: Key) -> Result<(), Error>
pub fn set_current_version(&mut self, version: KeyVersion) -> Result<(), Error>
pub fn current_version(&self) -> Result<KeyVersion, Error>
pub fn encrypt( &self, network_addresses: &[NetworkAddress], account: AccountAddress, seq_num: u64 ) -> Result<Vec<u8>, Error>
pub fn decrypt( &self, encrypted_network_addresses: &[u8], account: AccountAddress ) -> Result<Vec<NetworkAddress>, Error>
pub fn initialize(&mut self) -> Result<(), Error>
source§impl Encryptor<Storage>
impl Encryptor<Storage>
sourcepub fn empty() -> Self
pub fn empty() -> Self
This generates an empty encryptor for use in scenarios where encryption is not necessary. Any encryption operations (e.g., encrypt / decrypt) will return errors.
sourcepub fn for_testing() -> Self
pub fn for_testing() -> Self
This generates an encryptor for use in testing scenarios. The encryptor is initialized with a test network encryption key.