pub struct AgentIdentity {
pub name: String,
pub project: String,
/* private fields */
}Expand description
A cryptographic agent identity. Wraps an Ed25519 SigningKey alongside
the human-readable (name, project) tuple that derives it.
Fields§
§name: String§project: StringImplementations§
Source§impl AgentIdentity
impl AgentIdentity
Sourcepub fn derive(
name: &str,
project: &str,
seed: Option<&[u8]>,
) -> Result<Self, IdentityError>
pub fn derive( name: &str, project: &str, seed: Option<&[u8]>, ) -> Result<Self, IdentityError>
Deterministically derive an identity from (name, project, seed?).
The same inputs always produce the same keypair. Pass a random seed
to mint an ephemeral identity that’s still bound to a name/project for
logging.
Sourcepub fn from_secret_bytes(
name: &str,
project: &str,
secret: &[u8],
) -> Result<Self, IdentityError>
pub fn from_secret_bytes( name: &str, project: &str, secret: &[u8], ) -> Result<Self, IdentityError>
Reconstruct an identity from a raw 32-byte Ed25519 secret key.
Sourcepub fn public_key(&self) -> [u8; 32]
pub fn public_key(&self) -> [u8; 32]
32-byte Ed25519 public key.
Sourcepub fn public_key_hex(&self) -> String
pub fn public_key_hex(&self) -> String
Hex-encoded public key.
Sourcepub fn secret_bytes(&self) -> [u8; 32]
pub fn secret_bytes(&self) -> [u8; 32]
32-byte Ed25519 secret key. Treat as sensitive — caller is responsible for zeroising the returned buffer.
Sourcepub fn signing_key(&self) -> &SigningKey
pub fn signing_key(&self) -> &SigningKey
Underlying signing key, for advanced uses.
Sourcepub fn fingerprint(&self) -> String
pub fn fingerprint(&self) -> String
Human-readable fingerprint: ag:sha256:<first-16-hex-chars-of-SHA256(pubkey)>.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AgentIdentity
impl RefUnwindSafe for AgentIdentity
impl Send for AgentIdentity
impl Sync for AgentIdentity
impl Unpin for AgentIdentity
impl UnsafeUnpin for AgentIdentity
impl UnwindSafe for AgentIdentity
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request