OpenSslCertManager implements CertManager { @Override public void generateSelfSignedCert(File keyFile, File certFile, int days) throws IOException { generateSelfSignedCert(keyFile, certFile, null, days); } OpenSslCertManager(); @Override void generateSelfSignedCert(File keyFile, File certFile, int days); @Override void generateSelfSignedCert(File keyFile, File certFile, Subject sbj, int days); @Override void addCertToTrustStore(File certFile, String certAlias, File trustStoreFile, String trustStorePassword); @Override void addKeyAndCertToKeyStore(File keyFile, File certFile, String alias, File keyStoreFile, String keyStorePassword); @Override void deleteFromTrustStore(List<String> aliases, File trustStoreFile, String trustStorePassword); @Override void renewSelfSignedCert(File keyFile, File certFile, Subject sbj, int days); @Override void generateCsr(File keyFile, File csrFile, Subject sbj); @Override void generateCert(File csrFile, File caKey, File caCert, File crtFile, int days); @Override void generateCert(File csrFile, byte[] caKey, byte[] caCert, File crtFile, int days); @Override void generateCert(File csrFile, File caKey, File caCert, File crtFile, Subject sbj, int days); @Override void generateCert(File csrFile, byte[] caKey, byte[] caCert, File crtFile, Subject sbj, int days); static final int MAXIMUM_CN_LENGTH; }
@Test public void testGenerateSelfSignedCert() throws Exception { File key = File.createTempFile("key-", ".key"); File cert = File.createTempFile("crt-", ".crt"); File store = File.createTempFile("crt-", ".p12"); testGenerateSelfSignedCert(key, cert, store, "123456", null); key.delete(); cert.delete(); store.delete(); }