pub enum LegacyCompatSymmetricKeyEnvelope {
EncString(EncString),
SymmetricKeyEnvelope(SymmetricKeyEnvelope),
}Expand description
A symmetric key wrapped either as a legacy EncString or as a SymmetricKeyEnvelope.
In order to migrate, add support via seal_legacy, then three full
releases later, switch to seal. This is a breaking change.
See the migration example.
Variants§
EncString(EncString)
Legacy format. Has no namespace, so the namespace is not validated on unseal.
SymmetricKeyEnvelope(SymmetricKeyEnvelope)
Current format.
Implementations§
Source§impl LegacyCompatSymmetricKeyEnvelope
impl LegacyCompatSymmetricKeyEnvelope
Sourcepub fn seal<Ids: KeySlotIds>(
key_to_seal: Ids::Symmetric,
sealing_key: Ids::Symmetric,
namespace: SymmetricKeyEnvelopeNamespace,
ctx: &KeyStoreContext<'_, Ids>,
) -> Result<Self, SymmetricKeyEnvelopeError>
pub fn seal<Ids: KeySlotIds>( key_to_seal: Ids::Symmetric, sealing_key: Ids::Symmetric, namespace: SymmetricKeyEnvelopeNamespace, ctx: &KeyStoreContext<'_, Ids>, ) -> Result<Self, SymmetricKeyEnvelopeError>
Seals a symmetric key with an XAES-256-GCM or AES-256-CBC-HMAC key from the key store.
Always produces the SymmetricKeyEnvelope variant.
Sourcepub fn seal_legacy<Ids: KeySlotIds>(
key_to_seal: Ids::Symmetric,
sealing_key: Ids::Symmetric,
_namespace: SymmetricKeyEnvelopeNamespace,
ctx: &KeyStoreContext<'_, Ids>,
) -> Result<Self, SymmetricKeyEnvelopeError>
pub fn seal_legacy<Ids: KeySlotIds>( key_to_seal: Ids::Symmetric, sealing_key: Ids::Symmetric, _namespace: SymmetricKeyEnvelopeNamespace, ctx: &KeyStoreContext<'_, Ids>, ) -> Result<Self, SymmetricKeyEnvelopeError>
Seals a symmetric key as a legacy EncString, readable by clients that predate
SymmetricKeyEnvelope. Always produces the EncString variant. The namespace is
unused; it keeps the signature identical to seal.
In order to migrate, add support via seal_legacy, then three full releases later, switch
to seal. This is a breaking change.
Sourcepub fn unseal<Ids: KeySlotIds>(
&self,
wrapping_key: Ids::Symmetric,
namespace: SymmetricKeyEnvelopeNamespace,
ctx: &mut KeyStoreContext<'_, Ids>,
) -> Result<Ids::Symmetric, SymmetricKeyEnvelopeError>
pub fn unseal<Ids: KeySlotIds>( &self, wrapping_key: Ids::Symmetric, namespace: SymmetricKeyEnvelopeNamespace, ctx: &mut KeyStoreContext<'_, Ids>, ) -> Result<Ids::Symmetric, SymmetricKeyEnvelopeError>
Unseals a symmetric key and stores it in the key store context.
The namespace is only validated for the SymmetricKeyEnvelope variant.
Sourcepub fn contained_key_id(
&self,
) -> Result<Option<KeyId>, SymmetricKeyEnvelopeError>
pub fn contained_key_id( &self, ) -> Result<Option<KeyId>, SymmetricKeyEnvelopeError>
Get the key ID of the contained key. Returns None for the EncString
Sourcepub fn encrypted_by_key_id(
&self,
) -> Result<Option<KeyId>, SymmetricKeyEnvelopeError>
pub fn encrypted_by_key_id( &self, ) -> Result<Option<KeyId>, SymmetricKeyEnvelopeError>
Get the key ID of the key this was sealed with. Always present for the
SymmetricKeyEnvelope variant; for the EncString variant, see
EncString::key_id.
Trait Implementations§
Source§impl Clone for LegacyCompatSymmetricKeyEnvelope
impl Clone for LegacyCompatSymmetricKeyEnvelope
Source§fn clone(&self) -> LegacyCompatSymmetricKeyEnvelope
fn clone(&self) -> LegacyCompatSymmetricKeyEnvelope
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<'de> Deserialize<'de> for LegacyCompatSymmetricKeyEnvelope
impl<'de> Deserialize<'de> for LegacyCompatSymmetricKeyEnvelope
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>,
Source§impl FromWasm for LegacyCompatSymmetricKeyEnvelope
Available on crate feature wasm only.
impl FromWasm for LegacyCompatSymmetricKeyEnvelope
wasm only.Source§impl IntoWasmAbi for LegacyCompatSymmetricKeyEnvelope
Available on crate feature wasm only.
impl IntoWasmAbi for LegacyCompatSymmetricKeyEnvelope
wasm only.Source§impl OptionIntoWasmAbi for LegacyCompatSymmetricKeyEnvelope
Available on crate feature wasm only.
impl OptionIntoWasmAbi for LegacyCompatSymmetricKeyEnvelope
wasm only.Source§impl ToWasm for LegacyCompatSymmetricKeyEnvelope
Available on crate feature wasm only.
impl ToWasm for LegacyCompatSymmetricKeyEnvelope
wasm only.Source§impl WasmDescribe for LegacyCompatSymmetricKeyEnvelope
Available on crate feature wasm only.
impl WasmDescribe for LegacyCompatSymmetricKeyEnvelope
wasm only.Auto Trait Implementations§
impl Freeze for LegacyCompatSymmetricKeyEnvelope
impl RefUnwindSafe for LegacyCompatSymmetricKeyEnvelope
impl Send for LegacyCompatSymmetricKeyEnvelope
impl Sync for LegacyCompatSymmetricKeyEnvelope
impl Unpin for LegacyCompatSymmetricKeyEnvelope
impl UnsafeUnpin for LegacyCompatSymmetricKeyEnvelope
impl UnwindSafe for LegacyCompatSymmetricKeyEnvelope
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> CompatExt for T
impl<T> CompatExt for T
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
§unsafe fn consume_handle(handle: Handle) -> Arc<T> ⓘ
unsafe fn consume_handle(handle: Handle) -> Arc<T> ⓘ
Arc<> Read more§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
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 moreSource§impl<T> MaybeIntoWasmAbi for Twhere
T: OptionIntoWasmAbi,
impl<T> MaybeIntoWasmAbi for Twhere
T: OptionIntoWasmAbi,
Source§type MaybeAbi = <T as IntoWasmAbi>::Abi
type MaybeAbi = <T as IntoWasmAbi>::Abi
Option<Self>.Source§fn into_maybe_abi(self) -> <T as IntoWasmAbi>::Abi
fn into_maybe_abi(self) -> <T as IntoWasmAbi>::Abi
Option<Self> ABI.§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
Source§type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
IntoWasmAbi::AbiSource§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
IntoWasmAbi::into_abi, except that it may throw and never
return in the case of Err.