use of com.thoughtworks.go.security.X509CertificateGenerator in project gocd by gocd.
the class AgentInstance method assignCertification.
public Registration assignCertification() {
if (AgentConfigStatus.Pending.equals(agentConfigStatus)) {
return Registration.createNullPrivateKeyEntry();
}
X509CertificateGenerator certificateGenerator = new X509CertificateGenerator();
Registration entry = certificateGenerator.createAgentCertificate(new SystemEnvironment().agentkeystore(), agentConfig.getHostname());
return new Registration(entry.getPrivateKey(), entry.getChain());
}
use of com.thoughtworks.go.security.X509CertificateGenerator in project gocd by gocd.
the class AgentCertificateMother method agentCertificate.
public static Registration agentCertificate(TemporaryFolder temporaryFolder) throws IOException {
File tempKeystoreFile = temporaryFolder.newFile();
X509CertificateGenerator certificateGenerator = new X509CertificateGenerator();
certificateGenerator.createAndStoreCACertificates(tempKeystoreFile);
return certificateGenerator.createAgentCertificate(tempKeystoreFile, "blah");
}
Aggregations