@Test public void testGenerateCertificateIssuer() throws Exception { final KeyPair keyPair = subjectKeyPair; final int days = 2; final String issuerCommonName = "issuer common name"; final String subjectCommonName = "subject common name"; final String domain = "domain.example.org"; final String signAlgoritm = "SHA256WITHRSAENCRYPTION"; final Set<String> sanDnsNames = Stream.of( "alternative-a.example.org", "alternative-b.example.org" ).collect( Collectors.toSet() ); final X509Certificate result = CertificateManager.createX509V3Certificate( keyPair, days, issuerCommonName, subjectCommonName, domain, signAlgoritm, sanDnsNames ); assertNotNull( result ); final Set<String> foundIssuerCNs = parse( result.getIssuerX500Principal().getName(), "CN" ); assertEquals( 1, foundIssuerCNs.size() ); assertEquals( issuerCommonName, foundIssuerCNs.iterator().next() ); }
public static synchronized X509Certificate createX509V3Certificate(KeyPair kp, int days, String issuerCommonName, String subjectCommonName, String domain, String signAlgoritm) throws GeneralSecurityException, IOException { return createX509V3Certificate( kp, days, issuerCommonName, subjectCommonName, domain, signAlgoritm, null ); }
CertificateManager { public static synchronized X509Certificate createX509V3Certificate(KeyPair kp, int days, String issuerCommonName, String subjectCommonName, String domain, String signAlgoritm) throws GeneralSecurityException, IOException { return createX509V3Certificate( kp, days, issuerCommonName, subjectCommonName, domain, signAlgoritm, null ); } }
CertificateManager { public static synchronized X509Certificate createX509V3Certificate(KeyPair kp, int days, String issuerCommonName, String subjectCommonName, String domain, String signAlgoritm) throws GeneralSecurityException, IOException { return createX509V3Certificate( kp, days, issuerCommonName, subjectCommonName, domain, signAlgoritm, null ); }  }
CertificateManager { public static synchronized X509Certificate createX509V3Certificate(KeyPair kp, int days, String issuerCommonName, String subjectCommonName, String domain, String signAlgoritm) throws GeneralSecurityException, IOException { return createX509V3Certificate( kp, days, issuerCommonName, subjectCommonName, domain, signAlgoritm, null ); }  static List<String> getClientIdentities(X509Certificate x509Certificate); static List<String> getServerIdentities(X509Certificate x509Certificate); static boolean isSelfSignedCertificate(X509Certificate certificate); static boolean isSigningRequestPending(X509Certificate certificate); static String createSigningRequest(X509Certificate cert, PrivateKey privKey); static String toPemRepresentation( Object object ); static PrivateKey parsePrivateKey(String pemRepresentation, String passPhrase); static PrivateKey parsePrivateKey(InputStream pemRepresentation, String passPhrase); static Collection<X509Certificate> parseCertificates(String pemRepresentation); @SuppressWarnings("unchecked") static Collection<X509Certificate> parseCertificates(InputStream pemRepresentation); static void addListener(CertificateEventListener listener); static void removeListener(CertificateEventListener listener); static void fireCertificateStoreChanged( CertificateStore store ); @Deprecated static List<X509Certificate> order( Collection<X509Certificate> certificates ); static synchronized X509Certificate createX509V3Certificate(KeyPair kp, int days, String issuerCommonName,
                                                                        String subjectCommonName, String domain,
                                                                        String signAlgoritm); static synchronized X509Certificate createX509V3Certificate(KeyPair kp, int days, String issuerCommonName,
                                                                        String subjectCommonName, String domain,
                                                                        String signAlgoritm, Set<String> sanDnsNames); static synchronized X509Certificate createX509V3Certificate(KeyPair kp, int days, X500NameBuilder issuerBuilder,
            X500NameBuilder subjectBuilder, String domain, String signAlgoritm ); static synchronized X509Certificate createX509V3Certificate(KeyPair kp, int days, X500NameBuilder issuerBuilder,
            X500NameBuilder subjectBuilder, String domain, String signAlgoritm, Set<String> sanDnsNames ); static Set<String> determineSubjectAlternateNameDnsNameValues(); }
CertificateManager { public static synchronized X509Certificate createX509V3Certificate(KeyPair kp, int days, String issuerCommonName, String subjectCommonName, String domain, String signAlgoritm) throws GeneralSecurityException, IOException { return createX509V3Certificate( kp, days, issuerCommonName, subjectCommonName, domain, signAlgoritm, null ); }  static List<String> getClientIdentities(X509Certificate x509Certificate); static List<String> getServerIdentities(X509Certificate x509Certificate); static boolean isSelfSignedCertificate(X509Certificate certificate); static boolean isSigningRequestPending(X509Certificate certificate); static String createSigningRequest(X509Certificate cert, PrivateKey privKey); static String toPemRepresentation( Object object ); static PrivateKey parsePrivateKey(String pemRepresentation, String passPhrase); static PrivateKey parsePrivateKey(InputStream pemRepresentation, String passPhrase); static Collection<X509Certificate> parseCertificates(String pemRepresentation); @SuppressWarnings("unchecked") static Collection<X509Certificate> parseCertificates(InputStream pemRepresentation); static void addListener(CertificateEventListener listener); static void removeListener(CertificateEventListener listener); static void fireCertificateStoreChanged( CertificateStore store ); @Deprecated static List<X509Certificate> order( Collection<X509Certificate> certificates ); static synchronized X509Certificate createX509V3Certificate(KeyPair kp, int days, String issuerCommonName,
                                                                        String subjectCommonName, String domain,
                                                                        String signAlgoritm); static synchronized X509Certificate createX509V3Certificate(KeyPair kp, int days, String issuerCommonName,
                                                                        String subjectCommonName, String domain,
                                                                        String signAlgoritm, Set<String> sanDnsNames); static synchronized X509Certificate createX509V3Certificate(KeyPair kp, int days, X500NameBuilder issuerBuilder,
            X500NameBuilder subjectBuilder, String domain, String signAlgoritm ); static synchronized X509Certificate createX509V3Certificate(KeyPair kp, int days, X500NameBuilder issuerBuilder,
            X500NameBuilder subjectBuilder, String domain, String signAlgoritm, Set<String> sanDnsNames ); static Set<String> determineSubjectAlternateNameDnsNameValues();  }