IrohBeam. Identity
(iroh_beam v0.2.0)
View Source
Endpoint identity generation and optional file-backed persistence.
A private identity belongs to exactly one concurrently live endpoint. Share
its public IrohBeam.EndpointId, an IrohBeam.EndpointAddr, or an
IrohBeam.EndpointTicket with peers; do not copy one private key into several
live endpoints as a clustering mechanism.
Identity files contain exactly the 32 private key bytes. Creation uses a restrictive temporary file and atomic create-if-absent publication. A corrupt existing file returns an error and is never replaced.
Summary
Functions
@spec generate() :: {:ok, IrohBeam.SecretKey.t()} | {:error, IrohBeam.Error.t()}
@spec load_or_create(Path.t()) :: {:ok, IrohBeam.SecretKey.t()} | {:error, IrohBeam.Error.t()}