pub struct KeymintSealedData {
pub sealing_key_info: Vec<u8>,
pub sealing_key_blob: Vec<u8>,
pub sealed_keys: BTreeMap<String, Vec<u8>>,
pub old_blob: Option<Vec<u8>>,
}Expand description
Bundles together a handle to a Keymint sealing key together with a list of keys sealed by the sealing key. The contents of this struct can be persistently stored, as it contains no plaintext secrets.
Fields§
§sealing_key_info: Vec<u8>§sealing_key_blob: Vec<u8>§sealed_keys: BTreeMap<String, Vec<u8>>§old_blob: Option<Vec<u8>>Implementations§
Source§impl KeymintSealedData
impl KeymintSealedData
Sourcepub async fn new() -> Result<Self, Error>
pub async fn new() -> Result<Self, Error>
Generates a new hardware-backed sealing key based off of sealing_key_info and creates a
new instance of KeymintSealedData which uses this sealing key.
Note that repeated calls to this will yield different sealing keys. The sealing key should be persisted if it needs to be reused.
Sourcepub async fn create_key(&mut self, label: &str) -> Result<Vec<u8>, Error>
pub async fn create_key(&mut self, label: &str) -> Result<Vec<u8>, Error>
Generates and seals a new key named label. Updates this struct to contain the sealed key
(to be retrieved later by Self::unseal_key), and returns the unsealed key.
Sourcepub async fn unseal_key(&self, label: &str) -> Result<UnsealResult, Error>
pub async fn unseal_key(&self, label: &str) -> Result<UnsealResult, Error>
Unseals a key previously created via Self::create_key.
Returns either the unsealed key, or a UnsealResult::KeyRequiresUpgrade if the
hardware determines the sealing protocol format is too old.
Sourcepub async fn upgrade_sealing_blob(&mut self) -> Result<(), Error>
pub async fn upgrade_sealing_blob(&mut self) -> Result<(), Error>
Attempts to upgrade the hardware sealing blob for the current configuration.
In the event of a successful upgrade, the previous active blob is moved to old_blob
for cleanup.
Trait Implementations§
Source§impl Clone for KeymintSealedData
impl Clone for KeymintSealedData
Source§fn clone(&self) -> KeymintSealedData
fn clone(&self) -> KeymintSealedData
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<'de> Deserialize<'de> for KeymintSealedData
impl<'de> Deserialize<'de> for KeymintSealedData
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for KeymintSealedData
impl RefUnwindSafe for KeymintSealedData
impl Send for KeymintSealedData
impl Sync for KeymintSealedData
impl Unpin for KeymintSealedData
impl UnwindSafe for KeymintSealedData
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
§impl<T> InstanceFromServiceTransport<T> for T
impl<T> InstanceFromServiceTransport<T> for T
§fn from_service_transport(handle: T) -> T
fn from_service_transport(handle: T) -> T
T to [Self]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>
§impl<T> IntoAny for T
impl<T> IntoAny for T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more