• Encrypt the given message to the given public key. If an AES key is not provided, one will be created. This uses an AES key to encrypt the given content, then we encrypt the AES key to the given public key.

    Parameters

    • opts: { content: string | Uint8Array<ArrayBufferLike>; publicKey: string | CryptoKey }
    • OptionalaesKey: string | Uint8Array<ArrayBufferLike> | CryptoKey

      An optional AES key to encrypt to the given public key

    Returns Promise<{ content: Uint8Array; key: Uint8Array }>

    The encrypted content and encrypted key

Methods

Methods

  • Encrypt a message, return everything as strings.

    Parameters

    • opts: { content: string | Uint8Array<ArrayBufferLike>; publicKey: string | CryptoKey }
    • OptionalaesKey: string | Uint8Array<ArrayBufferLike> | CryptoKey

    Returns Promise<{ content: string; key: string }>