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 );
    }
Creates an X509 version3 certificate.

@param kp           KeyPair that keeps the public and private keys for the new certificate.
@param days       time to live
@param issuerCommonName     Issuer CN string
@param subjectCommonName    Subject CN string
@param domain       Domain of the server.
@param signAlgoritm Signature algorithm. This can be either a name or an OID.
@return X509 V3 Certificate
@throws GeneralSecurityException if there was a problem creating the certificate
@throws IOException if there was a problem creating the certificate
xmppserver/src/main/java/org/jivesoftware/util/CertificateManager.java