use of org.platformlayer.crypto.SimpleCertificateAuthority in project platformlayer by platformlayer.
the class PkiServiceImpl method signCsr.
@Override
public List<X509Certificate> signCsr(ProjectEntity project, String csr) throws OpsException {
CertificateAndKey projectPki;
try {
projectPki = repository.getProjectPki(project);
} catch (RepositoryException e) {
throw new OpsException("Error getting project PKI info", e);
}
SimpleCertificateAuthority ca = new SimpleCertificateAuthority();
ca.caCertificate = projectPki.getCertificateChain();
ca.caPrivateKey = projectPki.getPrivateKey();
X509Certificate certificate = ca.signCsr(csr);
List<X509Certificate> chain = Lists.newArrayList();
chain.add(certificate);
for (X509Certificate cert : projectPki.getCertificateChain()) {
chain.add(cert);
}
return chain;
}
Aggregations