@blockchaincommons/envelope - v1.0.0-beta.4
    Preparing search index...

    Function unlockSubjectWith

    • Decrypts the subject with the content key agent unlocks: the reference's unlock_subject(id) under the ssh-agent feature. Every unobscured hasSecret object must decode as an EncryptedKey; a key locked through an agent is opened with the identity id names, else the identity stored in the key, else the agent's first Ed25519 identity; a key locked by a password is tried with id as the password. The first key that opens decrypts the subject; one that does not is skipped, whatever the reason.

      Parameters

      • envelope: Envelope
      • agent: SshAgent
      • id: string = ""

      Returns Promise<Envelope>

      EnvelopeError UnknownSecret when no key opens; Cbor when a hasSecret object is not an EncryptedKey; the errors of decryptSubject