code: async function(algo, pub_params, data, fingerprint) {
      const types = this.getEncSessionKeyParamTypes(algo);
      switch (algo) {
        case enums.publicKey.rsa_encrypt:
        case enums.publicKey.rsa_encrypt_sign: {
          const m = data.toBN();
          const n = pub_params[0].toBN();
          const e = pub_params[1].toBN();
          const res = await publicKey.rsa.encrypt(m, n, e);
          return constructParams(types, [res]);
        }
        case enums.publicKey.elgamal: {
          const m = data.toBN();
          const p = pub_params[0].toBN();
          const g = pub_params[1].toBN();
          const y = pub_params[2].toBN();
          const res = await publicKey.elgamal.encrypt(m, p, g, y);
          return constructParams(types, [res.c1, res.c2]);
        }
        case enums.publicKey.ecdh: {
          const oid = pub_params[0];
          const Q = pub_params[1].toUint8Array();
          const kdf_params = pub_params[2];
          const { publicKey: V, wrappedKey: C } = await publicKey.elliptic.ecdh.encrypt(
            oid, kdf_params.cipher, kdf_params.hash, data, Q, fingerprint);
          return constructParams(types, [new BN(V), C]);
        }
        default:
          return [];
      }
    }
docs: Encrypts data using specified algorithm and public key parameters.
  See {@link https://tools.ietf.org/html/rfc4880#section-9.1|RFC 4880 9.1} for public key algorithms.
  @param {module:enums.publicKey}        algo        Public key algorithm
  @param {Array<module:type/mpi|
  module:type/oid|
  module:type/kdf_params>} pub_params  Algorithm-specific public key parameters
  @param {module:type/mpi}               data        Data to be encrypted as MPI
  @param {String}                        fingerprint Recipient fingerprint
  @returns {Array<module:type/mpi|
  module:type/ecdh_symkey>}          encrypted session key parameters
  @async