pub struct ProofSigner { /* private fields */ }Expand description
Ed25519 signer + verifier for Proofs. Owns a keypair stored on
disk at <state_dir>/identity-key and provides the only path Shield
uses to mint or validate proofs.
Implementations§
Source§impl ProofSigner
impl ProofSigner
Sourcepub fn load_or_create(state_dir: &Path) -> Result<Self>
pub fn load_or_create(state_dir: &Path) -> Result<Self>
Load the existing key from <state_dir>/identity-key, or
generate one and persist it if absent.
Sourcepub fn sign(&self, proof: Proof) -> Result<Proof>
pub fn sign(&self, proof: Proof) -> Result<Proof>
Sign a proof in-place, returning the now-fully-populated value.
Sourcepub fn verify(&self, proof: &Proof) -> Result<()>
pub fn verify(&self, proof: &Proof) -> Result<()>
Verify a previously-minted proof. Returns Ok(()) if the signature matches; an error otherwise.
Sourcepub fn public_key_hex(&self) -> String
pub fn public_key_hex(&self) -> String
Hex-encoded public key – useful for surfacing in audit logs so a fleet admin can confirm two laptops are running independent shields.
Auto Trait Implementations§
impl Freeze for ProofSigner
impl RefUnwindSafe for ProofSigner
impl Send for ProofSigner
impl Sync for ProofSigner
impl Unpin for ProofSigner
impl UnsafeUnpin for ProofSigner
impl UnwindSafe for ProofSigner
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