Build the `did:atomic:...` identifier for a public key.
(public_key: &PublicKey)
| 27 | |
| 28 | /// Build the `did:atomic:...` identifier for a public key. |
| 29 | pub fn did_for_public_key(public_key: &PublicKey) -> String { |
| 30 | let fingerprint = blake3::hash(public_key.as_bytes()); |
| 31 | format!( |
| 32 | "{}{}", |
| 33 | DID_ATOMIC_PREFIX, |
| 34 | data_encoding::BASE32_NOPAD.encode(fingerprint.as_bytes()) |
| 35 | ) |
| 36 | } |
| 37 | |
| 38 | /// Build the standard `did:key` identifier for an Ed25519 public key |
| 39 | /// (multicodec `ed25519-pub` + key bytes, base58btc multibase). Always |