private ASN1Encodable[] buildSubjectAltNames() {
        val subjectAltNames = new ArrayList<ASN1Encodable>(2);
        subjectAltNames.add(new GeneralName(GeneralName.dNSName, hostname));

        if (uriSubjectAltNames != null) {
            uriSubjectAltNames.forEach(subjectAltName -> subjectAltNames.add(new GeneralName(GeneralName.uniformResourceIdentifier, subjectAltName)));
        }
        return subjectAltNames.toArray(ASN1Encodable[]::new);
    }
This is {@link DefaultSamlIdPCertificateAndKeyWriter}.

@author Misagh Moayyed
@since 5.3.0
support/cas-server-support-saml-idp-core/src/main/java/org/apereo/cas/support/saml/idp/metadata/writer/DefaultSamlIdPCertificateAndKeyWriter.java