Function encryptKeyTo

Encrypt the given content to the given public key. This is RSA encryption, and should be used only to encrypt AES keys.

The content to encrypt, and public key to encrypt it to.

  • Parameters

    • __namedParameters: {
          key: string | Uint8Array<ArrayBufferLike> | CryptoKey;
          publicKey: string | Uint8Array<ArrayBufferLike> | CryptoKey;
      }
    • format: "arraybuffer"

    Returns Promise<ArrayBuffer>

  • Parameters

    • __namedParameters: {
          key: string | Uint8Array<ArrayBufferLike> | CryptoKey;
          publicKey: string | Uint8Array<ArrayBufferLike> | CryptoKey;
      }
    • format: "uint8array"

    Returns Promise<Uint8Array<ArrayBufferLike>>

  • Parameters

    • __namedParameters: {
          key: string | Uint8Array<ArrayBufferLike> | CryptoKey;
          publicKey: string | Uint8Array<ArrayBufferLike> | CryptoKey;
      }
    • Optionalformat: undefined

    Returns Promise<Uint8Array<ArrayBufferLike>>

Methods

Methods

  • Parameters

    • __namedParameters: {
          key: string | Uint8Array<ArrayBufferLike> | CryptoKey;
          publicKey: string | Uint8Array<ArrayBufferLike> | CryptoKey;
      }
    • Optionalformat: SupportedEncodings

    Returns Promise<string>