tvaultapi/src/main/java/com/tmobile/cso/vault/api/service/SSLCertificateService.java
private boolean validateDNSNames(SSLCertificateRequest sslCertificateRequest) {
        String[] dnsNames = sslCertificateRequest.getDnsList();
        Set<String> set = new HashSet<>();

        if(!ArrayUtils.isEmpty(dnsNames)) {
	        for (String dnsName : dnsNames) {
	            if (dnsName.contains(" ") || (!dnsName.matches("^[a-zA-Z0-9*.-]+$")) || (dnsName.endsWith(certificateNameTailText)) ||
	                    (dnsName.contains(".-")) || (dnsName.contains("-.")) || (dnsName.contains("..")) || (dnsName.endsWith(".")) ||
                        (!set.add(dnsName))) {
	                return false;
	            }
	        }

        }
        return true;
    }
/**
     * Validate the DNSNames
     * @param sslCertificateRequest
     * @param isAdmin
     * @return
     */
Validate the DNSNames
@param sslCertificateRequest
@param isAdmin
@return
Validate the DNSNames @param sslCertificateRequest @param isAdmin @return
private boolean validateDNSNames(SSLCertificateRequest sslCertificateRequest) {
        String[] dnsNames = sslCertificateRequest.getDnsList();
        Set<String> set = new HashSet<>();
        if(!ArrayUtils.isEmpty(dnsNames)) {
	        for (String dnsName : dnsNames) {
	            if (dnsName.contains(" ") || (!dnsName.matches("^[a-zA-Z0-9*.-]+$")) || (dnsName.endsWith(certificateNameTailText)) ||
	                    (dnsName.contains(".-")) || (dnsName.contains("-.")) || (dnsName.contains("..")) || (dnsName.endsWith(".")) ||
                        (!set.add(dnsName))) {
	                return false;
	            }
	        }
        }
        return true;
    }
private boolean validateDNSNames ( SSLCertificateRequest sslCertificateRequest ) { String [ ] dnsNames = sslCertificateRequest . getDnsList ( ) ; Set < String > set = new HashSet < > ( ) ; if ( ! ArrayUtils . isEmpty ( dnsNames ) ) { for ( String dnsName : dnsNames ) { if ( dnsName . contains ( " " ) || ( ! dnsName . matches ( "^[a-zA-Z0-9*.-]+$" ) ) || ( dnsName . endsWith ( certificateNameTailText ) ) || ( dnsName . contains ( ".-" ) ) || ( dnsName . contains ( "-." ) ) || ( dnsName . contains ( ".." ) ) || ( dnsName . endsWith ( "." ) ) || ( ! set . add ( dnsName ) ) ) { return false ; } } } return true ; }
Validate the DNSNames
 @param sslCertificateRequest
 @param isAdmin
 @return
Validate the DNSNames @param sslCertificateRequest @param isAdmin @return