Documentation Language: Swift

Framework

SSHAgent

Communicate with the local SSH agent and adapt agent-backed keys to NIOSSH.

Overview

SSHAgent implements the OpenSSH agent message framing needed to list identities and request signatures over SSH_AUTH_SOCK. It exposes a small async API that turns agent responses into SSHAgentKey values and, when needed, wraps those keys in NIOSSHPrivateKey values whose signing operations are delegated back to the agent.

The target keeps the raw protocol parsing in one place so higher-level code can work with Swift types instead of hand-built binary messages. It also preserves agent-specific behaviour such as RSA signing flags and response parsing rules.

Topics

Core Types

?
SSHAgent

An actor that implements communication with SSH agents using the standard protocol.

S
SSHAgentKey

A representation of an SSH key from the agent.

E
SSHAgentError

Errors raised whilst communicating with an SSH agent.

E
SSHAgentMessageType

SSH agent protocol message identifiers used on the wire.

S
SSHAgentSignFlags

SSH agent signing flags defined by the OpenSSH agent protocol.

T
SendableData

DataProtocol value that is also safe to send across concurrency domains.

Signing Support

F
createNIOSSHPrivateKey(for:)

Creates an SSH agent-backed NIOSSH private key.

F
requestSignature(for:usingKey:flags:)

Requests a signature from the SSH agent for the specified data and key.

C
SSHAgentPrivateKey

A private key implementation that delegates signing operations to the SSH agent.

Protocol Handling

F
requestIdentities()

Requests the list of identities from the SSH agent.

A
Agent Protocol Notes

Understand how the package maps OpenSSH agent messages to Swift types.