pub struct HmacSigner { /* private fields */ }Expand description
HMAC-SHA256 with a shared secret. The verifier needs the same secret, so this proves nothing about which device signed; use it for development and tests only.
Implementations§
Trait Implementations§
Source§impl Clone for HmacSigner
impl Clone for HmacSigner
Source§impl Debug for HmacSigner
impl Debug for HmacSigner
Source§impl Signer for HmacSigner
impl Signer for HmacSigner
Source§fn signer_class(&self) -> &str
fn signer_class(&self) -> &str
Signer class sent as
provenance.signer, e.g. "hmac" or "tpm".Source§fn sign(&self, payload: &[u8]) -> PhyTraceResult<String>
fn sign(&self, payload: &[u8]) -> PhyTraceResult<String>
Sign
payload, returning the encoded signature.Source§fn verify(&self, payload: &[u8], signature: &str) -> PhyTraceResult<bool>
fn verify(&self, payload: &[u8], signature: &str) -> PhyTraceResult<bool>
Check
signature over payload.Source§fn boot_counter(&self) -> Option<u64>
fn boot_counter(&self) -> Option<u64>
Hardware-anchored count of agent starts, sent as
provenance.boot_counter. A TPM signer reads it from a TPM NV
counter that it increments once per start; it never decreases, so
receivers can order events by (boot_counter, sequence_num) even if
the sequence state file is rolled back. None for signers without
one.Source§fn public_key_der(&self) -> Option<&[u8]>
fn public_key_der(&self) -> Option<&[u8]>
DER
SubjectPublicKeyInfo of the signing key, for enrolling the
device with PhyCloud. None for shared-secret signers.Source§fn attestation_key_der(&self) -> Option<&[u8]>
fn attestation_key_der(&self) -> Option<&[u8]>
DER
SubjectPublicKeyInfo of the attestation key (a restricted TPM
key), if the signer has one.Source§fn quote(&self, _nonce: &[u8], _pcrs: &str) -> Option<PhyTraceResult<Quote>>
fn quote(&self, _nonce: &[u8], _pcrs: &str) -> Option<PhyTraceResult<Quote>>
TPM2 quote over
pcrs (e.g. DEFAULT_PCRS) bound to nonce,
signed by the attestation key. None if the signer cannot quote.Auto Trait Implementations§
impl Freeze for HmacSigner
impl RefUnwindSafe for HmacSigner
impl Send for HmacSigner
impl Sync for HmacSigner
impl Unpin for HmacSigner
impl UnsafeUnpin for HmacSigner
impl UnwindSafe for HmacSigner
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