private static @NotNull List<? extends Entity> readPem(@NotNull InputStream stream) throws IOException {
    List<Entity> result = new ArrayList<>();
    try (BufferedReader reader = new BufferedReader(new InputStreamReader(stream, StandardCharsets.UTF_8))) {
      while (true) {
        String line = reader.readLine();
        if (line == null) break;
        Entity key = readPemEntity(line, reader);
        if (key != null) {
          result.add(key);
        }
      }
    }
    return result;
  }
private static @NotNull List<? extends Entity> readPem(@NotNull InputStream stream)