code: public static byte[] encryptBytes (PublicKey key, byte[] secret, byte[] salt)
      {
          byte[] encrypt = new byte[secret.length + salt.length];
          for (int ii = 0; ii < secret.length; ii++) {
              encrypt[ii] = secret[ii];
          }
          for (int ii = 0; ii < salt.length; ii++) {
              encrypt[secret.length + ii] = salt[ii];
          }
          try {
              return getRSACipher(key).doFinal(encrypt);
          } catch (GeneralSecurityException gse) {
              log.warning("Failed to encrypt bytes", gse);
          }
          return encrypt;
      }
docs: Encrypts a secret key and salt with a public key.