ddn.net.ssh.agent_client
Asynchronous ssh-agent client over a supplied byte transport.
The client drives the OpenSSH agent protocol (identity listing and signing) over any SshTransport: the Unix connector in this module, the EVE adapter, or scripted transports in tests. All operations are non-blocking: pump moves bytes and advances one step; callers poll progress afterwards.
The client never opens sockets itself and never blocks on user confirmation - an agent holding back a signature until the user approves simply surfaces as SshAgentProgress.waiting.
Types 4
Progress of an agent operation.
An in-flight or completed agent operation.
const(SshAgentIdentitiesAnswer) identities() @property constReturns: the listed identities (valid when done and the operation was a listing).const(SshAgentSignAnswer) signature() @property constReturns: the signature (valid when done and the operation was a sign request).this()Non-blocking ssh-agent client over a byte transport.
Ownership: the client references but does not own the transport; the caller keeps it alive and closes it.
void setOperationTimeout(Duration timeout) @safe pure nothrowSets a deadline applied to every operation started afterwards.SshAgentOperation requestIdentities()Starts an identity listing.SshAgentOperation sign(const(ubyte)[] keyBlob, const(ubyte)[] data,
uint flags)Starts a signature request.SshAgentProgress pump()Advances the active operation one step.this(SshTransport transport)Constructs a client over a transport.An SshSigner backed by an SshAgentClient.
Signing is asynchronous: the first sign call starts the agent request and reports SshProgress.WAIT; later calls pump the agent client and continue the same operation until the agent confirms or fails. The application drives the agent transport independently of the SSH session, so a delayed confirmation (for example a hardware-token approval) never blocks the session pump.
SshSignResult sign(scope const(ubyte)[] requestData,
string signatureAlgorithm)Signs the request data through the agent, continuing a pending operation when called again.bool signatureFlagsForTest(string keyAlgorithm,
string signatureAlgorithm, out uint flags) static @safe pure nothrowExposes the flag mapping for unittest verification.this(SshAgentClient client, const(ubyte)[] keyBlob,
SshPublicKeyInfo publicKey)Constructs a signer for one agent identity.Functions 1
SshTransport connectUnixAgent(string path = null, Duration timeout = Duration.zero)Connects to the agent socket named by SSH_AUTH_SOCK.