feat: Implement certificate fingerprinting on creation #12

Merged
MarkL4YG merged 2 commits from feat/cert-fingerprints into main 2024-11-19 18:11:54 +00:00
Showing only changes of commit 541bf76eba - Show all commits

View file

@ -42,8 +42,7 @@ public class OpenSSLCertificateCreator {
[alt_names]
""";
private static final Pattern FINGERPRINT_EXTRACTOR = Pattern.compile(
"^(?<algo>[0-9a-z]+) Fingerprint=(?<finger>[a-z:A-Z0-9]+)",
Pattern.CASE_INSENSITIVE
"^(?<algo>[0-9a-zA-Z]+) (?i)Fingerprint(?-i)=(?<finger>[a-z:A-Z0-9]+)"
);
private final ExecutableResolver executableResolver;
@ -293,7 +292,9 @@ public class OpenSSLCertificateCreator {
Matcher matcher = FINGERPRINT_EXTRACTOR.matcher(output);
if (!matcher.find()) {
log.debug(output);
throw new CommandLineOperationException("Unexpected output of fingerprint command. (See log for more details)");
throw new CommandLineOperationException(
"Unexpected output of fingerprint command. (See log for more details)"
);
}
String algorithm = matcher.group("algo");
String fingerprint = matcher.group("finger");