pub struct WrappedStoreKey {
pub author_pubkey: String,
pub generation: u64,
pub sealed: String,
pub signature: String,
}Expand description
A Store encryption keyring sealed to one member and signed by an Owner.
Membership authority names the immutable exact object
through WrappedStoreKeyRef. The sealed box authenticates no sender, so
the Owner signature additionally binds the Store, recipient, generation,
author, and sealed bytes. The reader verifies both the exact reference and
that signature before opening the keyring.
recipient_pubkey is part of the signed payload and exact path rather than
duplicated in this value, so a wrap cannot be relocated to another member.
Fields§
Hex-encoded Ed25519 public key of the Owner that signed this wrapped key.
generation: u64The keyring’s current generation, covered by the Owner signature and the exact reference.
sealed: StringHex-encoded sealed box (seal_box_encrypt output) carrying the store key.
signature: StringHex-encoded detached signature over WrappedKeyFields, produced by the owner.
Implementations§
Source§impl WrappedStoreKey
impl WrappedStoreKey
pub fn seal_keyring( store_id: &str, recipient_pubkey: &str, recipient_x25519_pk: &[u8; 32], encryption: &EncryptionService, owner: &UserKeypair, ) -> Result<Self, EncryptionError>
Sourcepub fn signed(
store_id: &str,
recipient_pubkey: &str,
generation: u64,
sealed: Vec<u8>,
owner: &UserKeypair,
) -> Self
pub fn signed( store_id: &str, recipient_pubkey: &str, generation: u64, sealed: Vec<u8>, owner: &UserKeypair, ) -> Self
Wrap sealed (a sealed box of the store key, already encrypted to
recipient_pubkey) and sign the binding with owner: fills signature
with the owner’s detached signature over the canonical payload.
Sourcepub fn verify_and_unwrap<'a>(
&self,
store_id: &str,
recipient_pubkey: &str,
expected_owners: impl IntoIterator<Item = &'a str>,
) -> Result<Vec<u8>, WrappedKeyError>
pub fn verify_and_unwrap<'a>( &self, store_id: &str, recipient_pubkey: &str, expected_owners: impl IntoIterator<Item = &'a str>, ) -> Result<Vec<u8>, WrappedKeyError>
Verify this wrapped key was authentically produced by one of
expected_owners for recipient_pubkey in store_id, and return the
sealed-box bytes to decrypt. Verifies the signature against the authorized
Owner set for this context over the binding (store_id, recipient_pubkey, author_pubkey, sealed). Fails closed, naming why, if the
signature doesn’t verify against that set (a substituted, forged,
replayed, or relocated key) or the sealed box is malformed; neither must
be adopted.
pub fn verify_and_open_keyring<'a>( &self, store_id: &str, recipient_pubkey: &str, expected_owners: impl IntoIterator<Item = &'a str>, expected_generation: u64, recipient: &dyn IdentityKeyAuthority, ) -> Result<EncryptionService, WrappedKeyringError>
Trait Implementations§
Source§impl Clone for WrappedStoreKey
impl Clone for WrappedStoreKey
Source§fn clone(&self) -> WrappedStoreKey
fn clone(&self) -> WrappedStoreKey
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for WrappedStoreKey
impl Debug for WrappedStoreKey
Source§impl<'de> Deserialize<'de> for WrappedStoreKey
impl<'de> Deserialize<'de> for WrappedStoreKey
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 PartialEq for WrappedStoreKey
impl PartialEq for WrappedStoreKey
Source§impl Serialize for WrappedStoreKey
impl Serialize for WrappedStoreKey
impl Eq for WrappedStoreKey
impl StructuralPartialEq for WrappedStoreKey
Auto Trait Implementations§
impl Freeze for WrappedStoreKey
impl RefUnwindSafe for WrappedStoreKey
impl Send for WrappedStoreKey
impl Sync for WrappedStoreKey
impl Unpin for WrappedStoreKey
impl UnsafeUnpin for WrappedStoreKey
impl UnwindSafe for WrappedStoreKey
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.