An agent holding identities (none by default). With refuseToSign
every sign call fails, the way an agent that declines a request does.
Adds key under its comment, replacing any identity with that comment.
Removes the identity whose comment is key's; nothing happens when there is none.
Removes every identity.
The public keys of the identities, in insertion order, each with its comment.
The raw signature bytes of the sshsig signature (namespace
test_namespace, SHA-256) over data by the private key whose comment
is identity's.
An
SshAgentwhose identities are private keys held in memory, the analogue of the reference's testMockSSHAgent.Identities are keyed by comment: adding a key whose comment is already present replaces that identity in place.
listIdentitiesreturns the public keys in insertion order, so with an empty id a lock or unlock uses the first key added.signsignsdatathe way the reference's mock does: ansshsigsignature in the namespacetest_namespaceover the SHA-256 digest ofdata, of which the inner raw signature bytes are returned. A real agent signsdataitself, so a key locked with this agent cannot be unlocked with a real agent holding the same key, and vice versa.