KeyStoreCertSigner implements CertSigner, AutoCloseable { @Override public String getCACertificate() { return Crypto.convertToPEMFormat(caCertificate); } KeyStoreCertSigner(X509Certificate caCertificate, PrivateKey caPrivateKey, int maxCertExpiryTimeMins); @Override String generateX509Certificate(String csr, String keyUsage, int certExpiryMins); @Override String getCACertificate(); @Override int getMaxCertExpiryTimeMins(); @Override void close();  }
@Test public void testGetCACertificate() { try (KeyStoreCertSigner keyStoreCertSigner = new KeyStoreCertSigner(CA_CERT, CA_KEY, 43200)) { Assert.assertEquals(keyStoreCertSigner.getCACertificate(), CA_CERT_PEM); } }