Sign this change in place with an Ed25519 secret key. Computes the change's content hash (unaffected by signatures — the SIGNATURE section is unhashed), signs it, and attaches the signature. The change's identity does not change. Used by record and revise paths that bypass the assemble/serialize pipeline (e.g. `revise --reword`).
(
&mut self,
signer_did: &str,
secret_key_bytes: &[u8; 32],
timestamp: i64,
)
| 856 | /// Used by record and revise paths that bypass the assemble/serialize |
| 857 | /// pipeline (e.g. `revise --reword`). |
| 858 | pub fn sign_with( |
| 859 | &mut self, |
| 860 | signer_did: &str, |
| 861 | secret_key_bytes: &[u8; 32], |
| 862 | timestamp: i64, |
| 863 | ) -> Result<Hash, ChangeError> { |
| 864 | let hash = self.hash()?; |
| 865 | let signature = |
| 866 | crate::change::signing::sign_change(signer_did, secret_key_bytes, &hash, timestamp); |
| 867 | self.signature = Some(signature); |
| 868 | Ok(hash) |
| 869 | } |
| 870 | |
| 871 | /// Check if this change directly knows about another change. |
| 872 | /// |