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

    Function encryptSubjectToRecipient

    • Encrypts the envelope's subject with a fresh content key and adds a hasRecipient assertion sealing that key to recipient (the reference's encrypt_subject_to_recipient).

      Parameters

      • envelope: Envelope
      • recipient: Encrypter

        The recipient's public key (implements Encrypter)

      • options: RecipientOptions = {}

        rng draws the content key, the subject's nonce and the sealed message's ephemeral key; nonce pins the sealed message's nonce

      Returns Envelope

      A new envelope with encrypted subject and recipient assertion

      EnvelopeError InvalidParameter when recipient is not an Encrypter; Components when components cannot seal to the key