pub struct SoftwareSigner { /* private fields */ }Expand description
Default impl backed by an in-process ed25519_dalek::SigningKey.
Suitable for dev and non-regulated deployments. Production tenants
requiring HSM-backed signing implement SignerProvider against
their vendor SDK.
Implementations§
Source§impl SoftwareSigner
impl SoftwareSigner
Sourcepub fn new(key: SigningKey) -> Self
pub fn new(key: SigningKey) -> Self
Build from an existing SigningKey.
Sourcepub fn from_bytes(seed: [u8; 32]) -> Self
pub fn from_bytes(seed: [u8; 32]) -> Self
Build deterministically from 32 bytes — convenience for tests.
Sourcepub fn generate() -> Self
pub fn generate() -> Self
Generate a fresh keypair off the OS CSPRNG.
Dev / test only. The private key lives in process memory and is
lost on exit, so signatures are not reproducible and the key cannot
be rotated, escrowed, or HSM-protected. For production use
Self::from_bytes / Self::new with managed key material, or
implement SignerProvider against an HSM / KMS adapter.
Sourcepub fn public_key_hex(&self) -> String
pub fn public_key_hex(&self) -> String
Lowercase hex of the 32-byte Ed25519 verifying (public) key — always
64 hex chars. Informational only at verify time (see the BundleSigner
impl’s CWE-347 note); the trusted key is resolved via KeyResolver.
Sourcepub fn key_id(&self) -> String
pub fn key_id(&self) -> String
Stable key identifier derived from the verifying-key fingerprint.
Used as SignatureBytes::key_id so a verifier’s KeyResolver
can resolve the trusted public key.
Sourcepub fn verify(&self, payload: &[u8], signature_hex: &str) -> bool
pub fn verify(&self, payload: &[u8], signature_hex: &str) -> bool
Verify that signature_hex is a valid Ed25519 signature over
payload under this signer’s keypair.
Returns false on malformed hex, wrong-length signature bytes, or
a cryptographic mismatch — never panics. This is a convenience for
callers that hold the signer; bundle verification proper resolves
the trusted key via a KeyResolver (see crate::SignerProvider
docs and klieo_provenance::EvidenceBundle::verify).
Trait Implementations§
Source§impl BundleSigner for SoftwareSigner
impl BundleSigner for SoftwareSigner
Source§impl SignerProvider for SoftwareSigner
impl SignerProvider for SoftwareSigner
Source§fn sign_handoff<'life0, 'life1, 'async_trait>(
&'life0 self,
payload: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<SignedPayload, SignerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn sign_handoff<'life0, 'life1, 'async_trait>(
&'life0 self,
payload: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<SignedPayload, SignerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
payload and return both the signature and the verifying key.Auto Trait Implementations§
impl Freeze for SoftwareSigner
impl RefUnwindSafe for SoftwareSigner
impl Send for SoftwareSigner
impl Sync for SoftwareSigner
impl Unpin for SoftwareSigner
impl UnsafeUnpin for SoftwareSigner
impl UnwindSafe for SoftwareSigner
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> 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>
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>
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