public static List<String> dnsNames(Pkcs10Csr csr) {
        return Stream.concat(X509CertificateUtils.getCommonNames(csr.getSubject()).stream(),
                             csr.getSubjectAlternativeNames().stream()
                                .map(SubjectAlternativeName::getValue))
                     .toList();
    }
Returns all DNS names contained in given CSR (CN + subject alternative names)
security-utils/src/main/java/com/yahoo/security/Pkcs10CsrUtils.java