code: private PGPEncryptedDataList getPGPEncryptedDataList(InputStream inputStream) throws IOException {
  
      if (Security.getProvider(BouncyCastleProvider.PROVIDER_NAME) == null) {
        Security.addProvider(new BouncyCastleProvider());
      }
      inputStream = PGPUtil.getDecoderStream(inputStream);
  
      JcaPGPObjectFactory pgpF = new JcaPGPObjectFactory(inputStream);
      PGPEncryptedDataList enc;
      Object pgpfObject = pgpF.nextObject();
  
      if (pgpfObject instanceof PGPEncryptedDataList) {
        enc = (PGPEncryptedDataList) pgpfObject;
      } else {
        enc = (PGPEncryptedDataList) pgpF.nextObject();
      }
      return enc;
    }
docs: Generate a PGPEncryptedDataList from an inputstream
  @param inputStream file inputstream that needs to be decrypted
  @throws IOException