protected static GeneralNames getSubjectAlternativeNames( Set<String> sanDnsNames )
    {
        final ASN1EncodableVector subjectAlternativeNames = new ASN1EncodableVector();
        if ( sanDnsNames != null )
        {
            for ( final String dnsNameValue : sanDnsNames )
            {
                subjectAlternativeNames.add(
                    new GeneralName( GeneralName.dNSName, dnsNameValue )
                );
            }
        }

        return GeneralNames.getInstance(
            new DERSequence( subjectAlternativeNames )
        );
    }
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 issuerBuilder     IssuerDN builder
@param subjectBuilder    SubjectDN builder
@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