code: public byte[] encrypt(PrivateKey privateKey, byte[] encryptedSecretKey, String data) throws InvalidKeyException {
          byte[] encryptedData = null;
          try {
              byte[] chave = privateKey.getEncoded();
              // Decrypt secret symmetric key with private key
              Cipher rsacf = Cipher.getInstance("RSA");
              rsacf.init(Cipher.DECRYPT_MODE, privateKey);
              byte[] secretKey = rsacf.doFinal(encryptedSecretKey);
  
              encryptedData = encrypt(secretKey, data);
          } catch (Exception e) {
              LOG.log(Level.SEVERE, "Exception encrypting data", e);
          }
  
          return encryptedData;
      }
docs: Encrypt data using an key encrypted with a private key.
  @param privateKey the private key to decrypt the secret key
  @param encryptedSecretKey a encrypted secret key
  @param data the data to encrypt
  @return the encrypted data
  @throws InvalidKeyException one of the keys is invalid