Static ReadonlyINDEXThe method discriminant that opens the SSH-agent parameter array on the wire.
Returns the salt.
Returns the SSH key identity: the comment of the agent identity; lock sets it from the secret.
StaticfromParameters with a fresh random salt unless one is given, and an empty id unless one is given.
Returns the method index for CBOR encoding.
Derive a key with an SSH agent and encrypt the content key, the
reference's lock.
Without options there is no agent to ask, and the call throws
SshAgent. With options.agent:
secret is the id: the comment of the identity to use, as UTF-8
(SSH Agent secret must be a valid UTF-8 string otherwise).No Ed25519 identities available in SSH agent when there is none).Multiple identities available in SSH agent, but no ID provided when there are several); a
non-empty id takes the identity with that comment (No matching identity found).SSH agent refused to sign on any failure).id is stored in these parameters, which are then the additional
authenticated data; the content key is encrypted with
options.nonce or a random nonce.Derive a key with an SSH agent and encrypt the content key, the
reference's lock.
Without options there is no agent to ask, and the call throws
SshAgent. With options.agent:
secret is the id: the comment of the identity to use, as UTF-8
(SSH Agent secret must be a valid UTF-8 string otherwise).No Ed25519 identities available in SSH agent when there is none).Multiple identities available in SSH agent, but no ID provided when there are several); a
non-empty id takes the identity with that comment (No matching identity found).SSH agent refused to sign on any failure).id is stored in these parameters, which are then the additional
authenticated data; the content key is encrypted with
options.nonce or a random nonce.Derive a key with an SSH agent and decrypt the content key, the
reference's unlock.
Without options there is no agent to ask, and the call throws
SshAgent. With options.agent the identity is chosen, among the
agent's Ed25519 identities, by the first of these that applies: the
secret's id when non-empty, the stored id when non-empty (each by
comment, No matching identity found otherwise), else the first
identity. The agent signs the stored salt, the key is derived as in
lock, and the message is decrypted.
SshAgent for the secret, identity and signing failures of
lock; Crypto Failed to decrypt the encrypted key: <reason> when
the message does not decrypt (a wrong identity, tampered data), and
Crypto Failed to convert decrypted key to SymmetricKey: <reason>
when the plaintext is not a symmetric key.
Derive a key with an SSH agent and decrypt the content key, the
reference's unlock.
Without options there is no agent to ask, and the call throws
SshAgent. With options.agent the identity is chosen, among the
agent's Ed25519 identities, by the first of these that applies: the
secret's id when non-empty, the stored id when non-empty (each by
comment, No matching identity found otherwise), else the first
identity. The agent signs the stored salt, the key is derived as in
lock, and the message is decrypted.
SshAgent for the secret, identity and signing failures of
lock; Crypto Failed to decrypt the encrypted key: <reason> when
the message does not decrypt (a wrong identity, tampered data), and
Crypto Failed to convert decrypted key to SymmetricKey: <reason>
when the plaintext is not a symmetric key.
Get string representation.
Convert to CBOR.
Format: [4, Salt, id: tstr] (Salt is encoded as a tagged value — #6.40018(bytes))
Convert to CBOR binary data.
StaticfromFrom the CBOR array, as the reference's TryFrom<CBOR> (a dcbor error):
every failure is Cbor with the bare message. The index element is
read as a usize (with dcbor's negative wrap) and its value ignored;
the fixed-width fields wrap the same way.
SSH Agent parameters for key derivation.
This method uses an SSH agent to derive encryption keys: the agent signs the salt with the Ed25519 identity
idnames (by comment), and the key is HKDF-SHA256 of that signature with the salt. The agent is passed tolockandunlockas anSshAgent:MemorySshAgentholds keys in memory, and thessh-agent-nodesubpath connects to the agent$SSH_AUTH_SOCKnames. Without an agent the synchronouslockandunlockofKeyDerivationthrowSshAgent, where the reference would connect to$SSH_AUTH_SOCKitself.The CBOR encoding of
SSHAgentParamsis byte-identical to the reference's, so a payload produced by either implementation is read by the other.