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.
Trait Implementations§
Auto Trait Implementations§
impl Forget for PeerKey
impl Freeze for PeerKey
impl RefUnwindSafe for PeerKey
impl Send for PeerKey
impl Sync for PeerKey
impl Unpin for PeerKey
impl UnsafeUnpin for PeerKey
impl UnwindSafe for PeerKey
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