pub struct OpenedContentKey {
pub lockbox_id: LockboxId,
/* private fields */
}Expand description
Decrypted content key produced by opening a key slot.
Fields§
§lockbox_id: LockboxIdLockbox id associated with the opened key.
Implementations§
Source§impl OpenedContentKey
impl OpenedContentKey
Sourcepub fn try_clone_key(&self) -> Result<SecureVec, Error>
pub fn try_clone_key(&self) -> Result<SecureVec, Error>
Clone the decrypted content key into a new secure allocation.
This lets vault integrations hand a copy to an external key cache without borrowing the original key under a secure read guard.
Sourcepub fn with_key<R>(&self, f: impl FnOnce(&[u8]) -> R) -> Result<R, Error>
pub fn with_key<R>(&self, f: impl FnOnce(&[u8]) -> R) -> Result<R, Error>
Borrow the decrypted content key for the duration of the callback.
Returns Error::SecurityLimitExceeded if secure memory access fails.
Sourcepub fn open_bytes(self, bytes: Vec<u8>) -> Result<Lockbox<ReadOnly>, Error>
pub fn open_bytes(self, bytes: Vec<u8>) -> Result<Lockbox<ReadOnly>, Error>
Open in-memory lockbox bytes with this opened content key.
This is primarily useful for bytes-oriented callers such as WASM wrappers or vault integrations.
Sourcepub fn open_bytes_for_write(
self,
bytes: Vec<u8>,
signing_key: &OwnerSigningKeyPair,
) -> Result<Lockbox, Error>
pub fn open_bytes_for_write( self, bytes: Vec<u8>, signing_key: &OwnerSigningKeyPair, ) -> Result<Lockbox, Error>
Open in-memory lockbox bytes for mutation with this content key.
Sourcepub fn open_path(self, path: &Path) -> Result<Lockbox<ReadOnly>, Error>
pub fn open_path(self, path: &Path) -> Result<Lockbox<ReadOnly>, Error>
Open a lockbox file with this opened content key.
Returns Error::Io if the host file cannot be read, Error::InvalidKey
if authentication fails, or corrupt/truncated errors if the lockbox
structure cannot be parsed.
Sourcepub fn open_path_for_write(
self,
path: &Path,
signing_key: &OwnerSigningKeyPair,
) -> Result<Lockbox, Error>
pub fn open_path_for_write( self, path: &Path, signing_key: &OwnerSigningKeyPair, ) -> Result<Lockbox, Error>
Open a lockbox file for mutation with this content key.