Struct lock_keeper::crypto::storage_key::RemoteStorageKey
source · pub struct RemoteStorageKey(pub(super) EncryptionKey);
Expand description
The remote storage key is a default-length symmetric encryption key for an AEAD scheme.
The remote storage key is used by the key server to securely encrypt signing keys generated on (or plaintext imported to) the server.
Tuple Fields§
§0: EncryptionKey
Implementations§
source§impl RemoteStorageKey
impl RemoteStorageKey
sourcepub fn generate(rng: &mut (impl CryptoRng + RngCore)) -> Self
pub fn generate(rng: &mut (impl CryptoRng + RngCore)) -> Self
Generate a new 32-byte RemoteStorageKey
.
sourcepub fn read_from_file(path: impl AsRef<Path>) -> Result<Self, LockKeeperError>
pub fn read_from_file(path: impl AsRef<Path>) -> Result<Self, LockKeeperError>
Returns the remote storage key found in the file at the given path
sourcepub fn from_bytes(bytes: &[u8]) -> Result<Self, LockKeeperError>
pub fn from_bytes(bytes: &[u8]) -> Result<Self, LockKeeperError>
Returns the remote storage key found in the given bytes
sourcepub fn encrypt_signing_key_pair(
&self,
rng: &mut (impl CryptoRng + RngCore),
signing_key_pair: SigningKeyPair
) -> Result<Encrypted<SigningKeyPair>, LockKeeperError>
pub fn encrypt_signing_key_pair( &self, rng: &mut (impl CryptoRng + RngCore), signing_key_pair: SigningKeyPair ) -> Result<Encrypted<SigningKeyPair>, LockKeeperError>
Encrypt the given SigningKeyPair
under the
RemoteStorageKey
using an AEAD scheme.
sourcepub fn encrypt_session_key(
&self,
rng: &mut (impl CryptoRng + RngCore),
session_key: OpaqueSessionKey
) -> Result<Encrypted<OpaqueSessionKey>, LockKeeperError>
pub fn encrypt_session_key( &self, rng: &mut (impl CryptoRng + RngCore), session_key: OpaqueSessionKey ) -> Result<Encrypted<OpaqueSessionKey>, LockKeeperError>
Encrypt the given OpaqueSessionKey
under the
RemoteStorageKey
using an AEAD scheme.
sourcepub fn encrypt_data_blob(
&self,
rng: &mut (impl CryptoRng + RngCore),
data_blob: DataBlob
) -> Result<Encrypted<DataBlob>, LockKeeperError>
pub fn encrypt_data_blob( &self, rng: &mut (impl CryptoRng + RngCore), data_blob: DataBlob ) -> Result<Encrypted<DataBlob>, LockKeeperError>
Encrypt the given DataBlob
under the RemoteStorageKey
using an
AEAD scheme.
Trait Implementations§
source§impl Clone for RemoteStorageKey
impl Clone for RemoteStorageKey
source§fn clone(&self) -> RemoteStorageKey
fn clone(&self) -> RemoteStorageKey
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 RemoteStorageKey
impl Debug for RemoteStorageKey
source§impl Drop for RemoteStorageKey
impl Drop for RemoteStorageKey
Auto Trait Implementations§
impl Freeze for RemoteStorageKey
impl RefUnwindSafe for RemoteStorageKey
impl Send for RemoteStorageKey
impl Sync for RemoteStorageKey
impl Unpin for RemoteStorageKey
impl UnwindSafe for RemoteStorageKey
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
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request