pub struct AgentCore {
pub keys: HashMap<Vec<u8>, SecureSeed>,
}Expand description
An in-memory registry of SSH keys used by the local agent. Stores seeds securely using SecureSeed (zeroize-on-drop). Note: Clone is intentionally NOT derived to prevent accidental copying of key material.
Fields§
§keys: HashMap<Vec<u8>, SecureSeed>Maps public key bytes (Vec
Implementations§
Source§impl AgentCore
impl AgentCore
Sourcepub fn register_key(
&mut self,
pkcs8_bytes: Zeroizing<Vec<u8>>,
) -> Result<(), AgentError>
pub fn register_key( &mut self, pkcs8_bytes: Zeroizing<Vec<u8>>, ) -> Result<(), AgentError>
Registers decrypted PKCS#8 key bytes in memory. Extracts the seed and public key, validates them, and stores the seed.
Args:
pkcs8_bytes- The raw, decrypted PKCS#8 bytes for the Ed25519 key, wrapped inZeroizing.
Sourcepub fn unregister_key(&mut self, pubkey: &[u8]) -> Result<(), AgentError>
pub fn unregister_key(&mut self, pubkey: &[u8]) -> Result<(), AgentError>
Removes a key by its public key bytes. Returns error if key not found.
Sourcepub fn sign(
&self,
pubkey_to_find: &[u8],
data: &[u8],
) -> Result<Vec<u8>, AgentError>
pub fn sign( &self, pubkey_to_find: &[u8], data: &[u8], ) -> Result<Vec<u8>, AgentError>
Signs a message using the key associated with the given public key bytes. Routes through CryptoProvider via the sync bridge.
Sourcepub fn public_keys(&self) -> Vec<Vec<u8>>
pub fn public_keys(&self) -> Vec<Vec<u8>>
Returns all public key bytes currently registered.
Sourcepub fn clear_keys(&mut self)
pub fn clear_keys(&mut self)
Removes all keys from the agent core.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AgentCore
impl RefUnwindSafe for AgentCore
impl Send for AgentCore
impl Sync for AgentCore
impl Unpin for AgentCore
impl UnsafeUnpin for AgentCore
impl UnwindSafe for AgentCore
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