pub struct MeshCredentials {
pub mesh_id: String,
pub mesh_name: String,
pub formation_secret: [u8; 32],
pub authority_public_key: [u8; 32],
pub policy: MembershipPolicy,
}Expand description
Shareable mesh credentials (no seed, no authority private key).
This can be distributed to nodes joining the mesh. It includes everything needed for transport (formation_secret) and certificate validation (authority_public_key), but NOT the ability to issue certificates.
Fields§
§mesh_id: StringThe mesh_id (derived, for verification).
mesh_name: StringMesh name.
formation_secret: [u8; 32]Formation secret for HKDF-based Iroh EndpointId derivation.
Authority’s public key (for certificate verification).
policy: MembershipPolicyMembership policy.
Implementations§
Source§impl MeshCredentials
impl MeshCredentials
Sourcepub fn encode(&self) -> Vec<u8> ⓘ
pub fn encode(&self) -> Vec<u8> ⓘ
Encode for distribution (e.g., QR code, config file).
Format:
- mesh_name length (2 bytes, LE)
- mesh_name (variable)
- mesh_id (8 bytes, ASCII hex)
- formation_secret (32 bytes)
- authority_public_key (32 bytes)
- policy (1 byte)
Total: 75 + mesh_name.len() bytes
Sourcepub fn decode(data: &[u8]) -> Result<Self, SecurityError>
pub fn decode(data: &[u8]) -> Result<Self, SecurityError>
Decode from bytes.
Trait Implementations§
Source§impl Clone for MeshCredentials
impl Clone for MeshCredentials
Source§fn clone(&self) -> MeshCredentials
fn clone(&self) -> MeshCredentials
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for MeshCredentials
impl RefUnwindSafe for MeshCredentials
impl Send for MeshCredentials
impl Sync for MeshCredentials
impl Unpin for MeshCredentials
impl UnsafeUnpin for MeshCredentials
impl UnwindSafe for MeshCredentials
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