feat: Allow creation of unsigned certs
This commit is contained in:
parent
b8ff45d35b
commit
a15d72914e
1 changed files with 6 additions and 0 deletions
|
@ -3,6 +3,7 @@ package de.mlessmann.certassist.openssl;
|
||||||
import de.mlessmann.certassist.ExecutableResolver;
|
import de.mlessmann.certassist.ExecutableResolver;
|
||||||
import de.mlessmann.certassist.except.CommandLineOperationException;
|
import de.mlessmann.certassist.except.CommandLineOperationException;
|
||||||
import de.mlessmann.certassist.except.UnresolvableCLIDependency;
|
import de.mlessmann.certassist.except.UnresolvableCLIDependency;
|
||||||
|
import de.mlessmann.certassist.openssl.CertificateRequest.RequestType;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
|
@ -71,6 +72,11 @@ public class OpenSSLCertificateCreator {
|
||||||
|
|
||||||
Path keyFile = createKeyfile(request, tmpDir.resolve("root.key"));
|
Path keyFile = createKeyfile(request, tmpDir.resolve("root.key"));
|
||||||
Path rootCert = createCertificate(request, keyFile, tmpDir.resolve("root.crt"));
|
Path rootCert = createCertificate(request, keyFile, tmpDir.resolve("root.crt"));
|
||||||
|
if (
|
||||||
|
request.getType() == RequestType.ROOT_AUTHORITY || request.getType() == RequestType.STANDALONE_CERTIFICATE
|
||||||
|
) {
|
||||||
|
return new OpenSSLCertificateResult(tmpDir, rootCert, keyFile);
|
||||||
|
}
|
||||||
|
|
||||||
Path childKey = createKeyfile(request, tmpDir.resolve("child.key"));
|
Path childKey = createKeyfile(request, tmpDir.resolve("child.key"));
|
||||||
Path unsignedCert = createSigningRequest(request, childKey, tmpDir.resolve("child.csr"));
|
Path unsignedCert = createSigningRequest(request, childKey, tmpDir.resolve("child.csr"));
|
||||||
|
|
Loading…
Add table
Reference in a new issue