The Zlint Java Wrapper is a Java-based utility that wraps around the zlint
command-line tool. ZLint is a X.509
certificate linter written in Java that checks for consistency with standards (e.g. RFC 5280) and other relevant PKI
requirements. It uses
the ProcessBuilder
class to execute zlint commands and capture the results. This
wrapper allows you to integrate Zlint's linting capabilities into your Java applications seamlessly.
- Execute
zlint
commands from Java. - Intenally process the
zlint
json result and give a high level result. - Dynamically set the working directory for
zlint
execution. - Handle different operating systems (Windows, Linux, Mac).
- Java 8 or higher
zlint
command-line tool installed and accessible in your system's PATH or- you can set the custom working directory of
zlint
only once before lintingZLinter.setZlintPath("Directory_Containing_Zlint");
-
Clone the repository:
git clone https://github.com/realmoieen/zlint-jwrapper.git cd zlint-java-wrapper
-
Build the project: Run the follwoing gradle command to build the project
gradlew jar
public class ZLinterExample {
public static void main(String[] args) throws ZLintException {
//first set the ZLint path
ZLinter.setZlintPath("Directory_Containing_Zlint");
//Lint certificate,crl
LintResult lintResult = ZLinter.lint("certificate.cer", ZLinter.Format.pem);
//validate result
System.out.println(lintResult.isPassed());
}
}
It used Google Gson for JSON. https://mvnrepository.com/artifact/com.google.code.gson/gson
We welcome contributions! Please fork the repository and submit pull requests.
This project is licensed under the MIT License. See the LICENSE file for details.
For any questions or issues, please open an issue on GitHub.