pub struct ControllerKeypair {
pub id: String,
/* private fields */
}Expand description
A controller’s long-term Ed25519 identity used across pairings.
id is the controller’s pairing identifier (iOSDevicePairingID) — an
arbitrary UTF-8 string the accessory stores alongside the public key.
Fields§
§id: StringThe controller’s pairing identifier.
Implementations§
Source§impl ControllerKeypair
impl ControllerKeypair
Sourcepub fn generate(id: String) -> Self
pub fn generate(id: String) -> Self
Generate a fresh random Ed25519 keypair bound to id, using the
operating system CSPRNG (OsRng).
Sourcepub fn from_seed(id: String, seed: [u8; 32]) -> Self
pub fn from_seed(id: String, seed: [u8; 32]) -> Self
Reconstruct a keypair deterministically from a stored 32-byte Ed25519
seed bound to id.
Used by the test/replay harness and by persistence layers that store the
raw seed. The same seed always yields the same keypair.
Sourcepub fn ltpk(&self) -> [u8; 32]
pub fn ltpk(&self) -> [u8; 32]
The controller’s long-term public key (LTPK): the 32-byte Ed25519 public key.
Sourcepub fn seed(&self) -> [u8; 32]
pub fn seed(&self) -> [u8; 32]
The controller’s 32-byte Ed25519 secret seed.
This is sensitive long-term private key material — the inverse of
from_seed. It exists so a persistence layer (e.g.
hap-pairing’s JsonFileStore) can save and later restore the controller
identity. Store it only in a location you would treat as secret.
Trait Implementations§
Source§impl Clone for ControllerKeypair
impl Clone for ControllerKeypair
Source§fn clone(&self) -> ControllerKeypair
fn clone(&self) -> ControllerKeypair
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more