pub struct PortableUserId(/* private fields */);Expand description
Who a portable user is. For an identity begun with one phrase root, its
root’s Ed25519 public key; for any other, derived from its
genesis (IdentityGenesis::user). Written as 64 lowercase hex
digits, as iroh writes an EndpointId; serialized the same way.
Implementations§
Source§impl PortableUserId
impl PortableUserId
Sourcepub fn from_bytes(bytes: [u8; 32]) -> Result<Self, InvalidPortableUserId>
pub fn from_bytes(bytes: [u8; 32]) -> Result<Self, InvalidPortableUserId>
The id bytes are. Any 32 bytes: an id derived from a genesis
is a hash, not a curve point. A phrase identity’s is its
root’s public key, and Self::verify fails for one that is not
a point.
pub fn as_bytes(&self) -> &[u8; 32]
Sourcepub fn fingerprint(&self) -> String
pub fn fingerprint(&self) -> String
The short code a person compares between two screens, in the same
format as a server’s (fingerprint): K7QX-3MPA-9TRD-WF2H.
Sourcepub fn verify(&self, message: &[u8], signature: &Signature) -> bool
pub fn verify(&self, message: &[u8], signature: &Signature) -> bool
Whether signature is this user’s phrase root’s over message,
the root a phrase identity’s id is. Strict Ed25519 verification: a
signature another could forge from a valid one, or one under a
weak key, does not pass. An identity with other roots checks them
with RootKey::verify.