pub struct EnvelopeKeypair {
pub public: [u8; 32],
pub secret: [u8; 32],
}Expand description
An X25519 envelope keypair for a party (the owner, or an agent). The secret opens sealed DEKs; the public is what a DEK is sealed to.
Fields§
§public: [u8; 32]§secret: [u8; 32]Implementations§
Source§impl EnvelopeKeypair
impl EnvelopeKeypair
Sourcepub fn generate() -> Result<Self, String>
pub fn generate() -> Result<Self, String>
Generate a fresh keypair (real X25519, OS randomness).
pub fn public_hex(&self) -> String
pub fn secret_hex(&self) -> String
Sourcepub fn from_hex(public_hex: &str, secret_hex: &str) -> Result<Self, String>
pub fn from_hex(public_hex: &str, secret_hex: &str) -> Result<Self, String>
Reconstruct from stored hex (e.g. an agent keypair supplied for opening).
Sourcepub fn derive(root_secret: &[u8; 32], domain: &[u8]) -> Self
pub fn derive(root_secret: &[u8; 32], domain: &[u8]) -> Self
Derive a keypair deterministically from a root secret (the owner’s ed25519 signing-key seed) and a
domain tag, so the owner envelope keypair is re-derivable and NEVER stored at rest — no plaintext
X25519 secret on disk. The derivation is SHA-256(domain ‖ 0x1f ‖ root_secret) → X25519 secret; it is
stable, so seals to this public key open with the re-derived secret across sessions.
Trait Implementations§
Source§impl Clone for EnvelopeKeypair
impl Clone for EnvelopeKeypair
Source§fn clone(&self) -> EnvelopeKeypair
fn clone(&self) -> EnvelopeKeypair
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 EnvelopeKeypair
impl Debug for EnvelopeKeypair
Source§impl PartialEq for EnvelopeKeypair
impl PartialEq for EnvelopeKeypair
Source§fn eq(&self, other: &EnvelopeKeypair) -> bool
fn eq(&self, other: &EnvelopeKeypair) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for EnvelopeKeypair
impl StructuralPartialEq for EnvelopeKeypair
Auto Trait Implementations§
impl Freeze for EnvelopeKeypair
impl RefUnwindSafe for EnvelopeKeypair
impl Send for EnvelopeKeypair
impl Sync for EnvelopeKeypair
impl Unpin for EnvelopeKeypair
impl UnsafeUnpin for EnvelopeKeypair
impl UnwindSafe for EnvelopeKeypair
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Aggregate shares in an MPC protocol.
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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> 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
Checks if this value is equivalent to the given key. Read more
§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
Compare self to
key and return true if they are equal.§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
Checks if this value is equivalent to the given key. Read more
§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
Checks if this value is equivalent to the given key. 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>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> 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>
Converts
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>
Converts
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