Sign this attestation in place with an agent DID identity (V4, CB-12A AC3). `did` is the signer's DID string (e.g. `did:atomic: ` — `atomic_canonical::did::did_for_public_key`); `secret_key_bytes` is the Ed25519 seed (32 bytes, `atomic_identity::SecretKey::as_bytes`). The signature is stored base32 (nopad), matching `atomic_identity::Signature::to_base32`. Unlike [`Attestation::sign_with_
(&mut self, did: &str, secret_key_bytes: &[u8; 32])
| 587 | /// holding the signer's public key can verify, and the private key never |
| 588 | /// has to live beside the evidence. |
| 589 | pub fn sign_with_did(&mut self, did: &str, secret_key_bytes: &[u8; 32]) { |
| 590 | use ed25519_dalek::Signer; |
| 591 | let signing_key = ed25519_dalek::SigningKey::from_bytes(secret_key_bytes); |
| 592 | // The signer is part of the signed payload: set it BEFORE computing |
| 593 | // the signature input (mirrors sign_with_mac). |
| 594 | self.signer = Some(did.to_string()); |
| 595 | let input = self.did_signature_input(); |
| 596 | self.signature = |
| 597 | Some(data_encoding::BASE32_NOPAD.encode(&signing_key.sign(&input).to_bytes())); |
| 598 | } |
| 599 | |
| 600 | /// Verify a V4 DID signature against the signer's Ed25519 public key. |
| 601 | /// |
no test coverage detected