pub struct PeerKey { /* private fields */ }Expand description
An Ed25519 key with its id (key:<hex>): a service’s signing key, or a
peer’s own. Debug never shows the seed.
Implementations§
Source§impl PeerKey
impl PeerKey
Sourcepub fn load_or_create(path: &Path) -> Result<Self, String>
pub fn load_or_create(path: &Path) -> Result<Self, String>
The key in path (a 32-byte seed, raw or base64 — synapse’s key
file), made there (0600) when there is none. A file readable by
others is refused.
Sourcepub fn save(&self, path: &Path) -> Result<(), String>
pub fn save(&self, path: &Path) -> Result<(), String>
DYNAUTH-7: write it to path, replacing what is there (a new file
beside it, 0600, renamed into place).
Sourcepub fn public(&self) -> VerifyingKey
pub fn public(&self) -> VerifyingKey
Its public half.
Sourcepub fn thumbprint(&self) -> String
pub fn thumbprint(&self) -> String
Its RFC 7638 thumbprint.
Sourcepub fn key_proof_for(&self, nonce: &str, backend: &str, asker: &str) -> String
pub fn key_proof_for(&self, nonce: &str, backend: &str, asker: &str) -> String
The _info key proof: a signature over
plexus-peer-key/v2\n<nonce>\n<backend>\n<asker>, base64url —
KEEL-19: asker the principal of whoever asked, as the prover
knows it: the principal its connection proved (a mount’s, a dialing
peer’s), or, on its parent’s own pipe, the one the parent names. A
proof made for one asker is refused by any other
(check_key_proof), so a peer cannot relay another’s proof and be
registered under its key. The one form for a mount’s child and a
dial-out’s relay (KEEL-8).
Sourcepub fn key_proof(&self, nonce: &str, backend: &str) -> String
👎Deprecated since 0.11.1: a key proof bound to no asker can be relayed; use key_proof_for(nonce, backend, asker)
pub fn key_proof(&self, nonce: &str, backend: &str) -> String
a key proof bound to no asker can be relayed; use key_proof_for(nonce, backend, asker)
0.11.0’s _info key proof, bound to no asker (plexus-peer-key/v1):
nothing in 0.11.1 accepts it. KEEL-19: use Self::key_proof_for.