pub struct PersonPrincipal {
pub person_id: String,
pub ed25519_secret: [u8; 32],
pub created_at_unix: u64,
pub display_hint: String,
}Expand description
On-disk person principal (secret material).
Fields§
§person_id: StringStable DID: did:q42:person:{verifying_key_hex}.
ed25519_secret: [u8; 32]Raw Ed25519 signing secret (32 bytes).
created_at_unix: u64§display_hint: StringOptional preferred label (not a legal name).
Implementations§
Source§impl PersonPrincipal
impl PersonPrincipal
pub fn signing_key(&self) -> SigningKey
pub fn verifying_key_hex(&self) -> String
pub fn to_public(&self) -> PersonPublic
pub fn did_from_verifying_key_bytes(vk: &[u8; 32]) -> String
pub fn generate(display_hint: impl Into<String>) -> Result<Self, String>
Sourcepub fn load_or_create(display_hint: Option<&str>) -> Result<Self, String>
pub fn load_or_create(display_hint: Option<&str>) -> Result<Self, String>
Load existing person identity, or mint a new one (first install).
pub fn persist(&self) -> Result<(), String>
Sourcepub fn sign_message(&self, message: &[u8]) -> [u8; 64]
pub fn sign_message(&self, message: &[u8]) -> [u8; 64]
Sign a message with the person principal (for fleet job envelopes).
pub fn verify_message( person_id: &str, verifying_key_hex: &str, message: &[u8], sig: &[u8; 64], ) -> Result<(), String>
pub fn replace_with(person: PersonPrincipal) -> Result<PersonPrincipal, String>
pub fn transfer_bundle(&self) -> PersonTransferBundle
pub fn from_transfer_bundle( bundle: PersonTransferBundle, ) -> Result<Self, String>
Trait Implementations§
Source§impl Clone for PersonPrincipal
impl Clone for PersonPrincipal
Source§fn clone(&self) -> PersonPrincipal
fn clone(&self) -> PersonPrincipal
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 PersonPrincipal
impl Debug for PersonPrincipal
Source§impl<'de> Deserialize<'de> for PersonPrincipal
impl<'de> Deserialize<'de> for PersonPrincipal
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for PersonPrincipal
impl RefUnwindSafe for PersonPrincipal
impl Send for PersonPrincipal
impl Sync for PersonPrincipal
impl Unpin for PersonPrincipal
impl UnsafeUnpin for PersonPrincipal
impl UnwindSafe for PersonPrincipal
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<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