pub struct PublicKey(/* private fields */);key only.Expand description
A public key.
The key itself is stored as the CompressedEdwards y coordinate of the public key
It is verified to decompress into a valid key when created.
Implementations§
Source§impl PublicKey
impl PublicKey
Sourcepub fn from_bytes(bytes: &[u8; 32]) -> Result<Self, KeyParsingError>
pub fn from_bytes(bytes: &[u8; 32]) -> Result<Self, KeyParsingError>
Construct a PublicKey from a slice of bytes.
§Warning
This will return a SignatureError if the bytes passed into this method do not represent
a valid ed25519_dalek curve point. Will never fail for bytes return from Self::as_bytes.
See [VerifyingKey::from_bytes] for details.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for PublicKey
impl<'de> Deserialize<'de> for PublicKey
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Source§impl From<PublicKey> for EndpointAddr
impl From<PublicKey> for EndpointAddr
Source§impl From<PublicKey> for EndpointId
impl From<PublicKey> for EndpointId
Source§impl FromStr for PublicKey
Deserialises the PublicKey from it’s base32 encoding.
impl FromStr for PublicKey
Deserialises the PublicKey from it’s base32 encoding.
Display is capable of serialising this format.
Source§impl Hash for PublicKey
The identifier for an endpoint in the (iroh) network.
impl Hash for PublicKey
The identifier for an endpoint in the (iroh) network.
Each endpoint in iroh has a unique identifier created as a cryptographic key. This can be used to globally identify an endpoint. Since it is also a cryptographic key it is also the mechanism by which all traffic is always encrypted for a specific endpoint only.
This is equivalent to PublicKey. By convention we will (or should) use PublicKey
as type name when performing cryptographic operations, but use EndpointId when referencing
an endpoint. E.g.:
encrypt(key: PublicKey)send_to(endpoint: EndpointId)