For a university project I need to verify a huge amount of data (~ 5TB) with zlint. I tried to create a file for each certificate and redirect the contents with ./zlint temp-cert.pem -format pem
but as the data set is huge this approach is too slow.
The external program zlint is able to read from stdin or from a file.
Currently I iterate through the set and execute for each line:
Runtime rt = Runtime.getRuntime();
String[] cmd = new String[] {"echo \"" + dao.raw + "\" | zlint -format base64"};
Process pr = rt.exec(cmd);
BufferedReader input = new BufferedReader(new InputStreamReader(pr.getInputStream()));
while ((line = input.readLine()) != null) {
cmdOutput.append(line);
}
// handle the results
Using this command works very well for the command-line. For the Java-runtime I get:
Cannot run program "echo "..." | ./zlint -format base64": error=63, File name too long
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
at java.lang.Runtime.exec(Runtime.java:620)
at java.lang.Runtime.exec(Runtime.java:485)
...
Caused by: java.io.IOException: error=63, File name too long
at java.lang.UNIXProcess.forkAndExec(Native Method)
at java.lang.UNIXProcess.<init>(UNIXProcess.java:247)
at java.lang.ProcessImpl.start(ProcessImpl.java:134)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
... 6 more
Is there any approach where I can pipe the raw text to the external program without the need of creating a temporary file?