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

    Function addRecipient

    • Adds a hasRecipient assertion holding contentKey sealed to the recipient's public key (the reference's add_recipient / add_recipient_opt): the plaintext is the key's tagged CBOR.

      Parameters

      • envelope: Envelope
      • recipient: Encrypter

        The recipient's public key (implements Encrypter)

      • contentKey: SymmetricKey

        The symmetric key used to encrypt the envelope's subject

      • options: RecipientOptions = {}

        A fixed nonce for the sealed message, or an rng for the ephemeral key and the nonce

      Returns Envelope

      A new envelope with the recipient assertion added

      EnvelopeError Components (components error: <message>, cause the ComponentsError) when components cannot seal to the key (a low-order X25519 public key)