pub struct PrivateAccessKeyStore { /* private fields */ }Expand description
Encrypted-at-rest store for a pilot’s private_access_keypair private half.
The key is sealed with the same AES-256-GCM + HKDF envelope as PilotKeyStore.
After a successful provision or generate, the node holds Category 2
(private-access) capability for that pilot until delete is called.
Implementations§
Source§impl PrivateAccessKeyStore
impl PrivateAccessKeyStore
pub fn open(root: impl Into<PathBuf>) -> Self
pub fn for_data_dir(data_dir: impl AsRef<Path>) -> Self
Sourcepub fn generate_for_pilot(
&self,
pilot_id: &PilotId,
node_secret_key: &SecretKey,
) -> Result<SecretKey, PilotKeyStoreError>
pub fn generate_for_pilot( &self, pilot_id: &PilotId, node_secret_key: &SecretKey, ) -> Result<SecretKey, PilotKeyStoreError>
Generate a fresh random private_access_keypair for pilot_id and store
the private half.
Fails if that pilot already has a key (use delete_for_pilot first to
replace with an implementation-generated key).
Sourcepub fn provision_for_pilot(
&self,
pilot_id: &PilotId,
private_key: &SecretKey,
node_secret_key: &SecretKey,
) -> Result<(), PilotKeyStoreError>
pub fn provision_for_pilot( &self, pilot_id: &PilotId, private_key: &SecretKey, node_secret_key: &SecretKey, ) -> Result<(), PilotKeyStoreError>
Store an externally supplied private key for pilot_id (used during the
§5 key-provisioning handover). Overwrites that pilot’s previously stored
key atomically without affecting other pilots.
Sourcepub fn load_for_pilot(
&self,
pilot_id: &PilotId,
node_secret_key: &SecretKey,
) -> Result<Option<SecretKey>, PilotKeyStoreError>
pub fn load_for_pilot( &self, pilot_id: &PilotId, node_secret_key: &SecretKey, ) -> Result<Option<SecretKey>, PilotKeyStoreError>
Load the stored private key for pilot_id.
Returns None if no key has been provisioned for that pilot.
Sourcepub fn load_by_public_key(
&self,
public_key_hex: &str,
node_secret_key: &SecretKey,
) -> Result<Option<(PilotId, SecretKey)>, PilotKeyStoreError>
pub fn load_by_public_key( &self, public_key_hex: &str, node_secret_key: &SecretKey, ) -> Result<Option<(PilotId, SecretKey)>, PilotKeyStoreError>
Load a stored private key by its public half.
This is an interim lookup for the current gRPC POC until artifact
ownership resolution can map raw_igc_hash to pilot_id directly.
Sourcepub fn delete_for_pilot(
&self,
pilot_id: &PilotId,
) -> Result<(), PilotKeyStoreError>
pub fn delete_for_pilot( &self, pilot_id: &PilotId, ) -> Result<(), PilotKeyStoreError>
Delete the stored key for pilot_id (revocation / key rotation cleanup).
After this call the node loses Category 2 capability for this pilot. Callers are responsible for deleting any cached restricted plaintext per R-ACCESS-17.
Trait Implementations§
Source§impl Clone for PrivateAccessKeyStore
impl Clone for PrivateAccessKeyStore
Source§fn clone(&self) -> PrivateAccessKeyStore
fn clone(&self) -> PrivateAccessKeyStore
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more