• Use the RSA public key for encryption.

    Parameters

    • publicKey: Buffer

      Public key. Note: Sensitive information. Do not enter plaintext in the code.

    • plainText: Buffer

      Plaintext. Note: Do not write sensitive information in plaintext in the code.

    • Optional padding: RSAPadding

      Filling mode. The default value is PKCS1.

    Returns Buffer