pub struct UserKeypair {
pub signing_key: [u8; 64],
pub public_key: [u8; 32],
}Expand description
Ed25519 keypair for signing changesets and membership changes. The same seed can derive an X25519 keypair for key wrapping.
This is a global identity (not per-library) so attestations accumulate under one pubkey across all libraries.
Fields§
§signing_key: [u8; 64]§public_key: [u8; 32]Implementations§
Source§impl UserKeypair
impl UserKeypair
Sourcepub fn generate() -> Self
pub fn generate() -> Self
Generate a new random Ed25519 keypair. The unmanaged primitive behind
KeyService::get_or_create_user_keypair; also lets host code (and its
tests) mint an identity directly.
Sourcepub fn sign(&self, message: &[u8]) -> [u8; 64]
pub fn sign(&self, message: &[u8]) -> [u8; 64]
Sign a message, returning a 64-byte detached signature.
Sourcepub fn to_x25519_secret_key(&self) -> [u8; 32]
pub fn to_x25519_secret_key(&self) -> [u8; 32]
Derive the X25519 secret key from this Ed25519 signing key.
Sourcepub fn to_x25519_public_key(&self) -> [u8; 32]
pub fn to_x25519_public_key(&self) -> [u8; 32]
Derive the X25519 public key from this Ed25519 public key.
Trait Implementations§
Source§impl Clone for UserKeypair
impl Clone for UserKeypair
Source§fn clone(&self) -> UserKeypair
fn clone(&self) -> UserKeypair
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for UserKeypair
impl RefUnwindSafe for UserKeypair
impl Send for UserKeypair
impl Sync for UserKeypair
impl Unpin for UserKeypair
impl UnwindSafe for UserKeypair
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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 moreCreates a shared type from an unshared type.