public boolean isValidSubject ( X500Principal subject ) { if ( subject == null ) { throw new IllegalArgumentException ( ) ; } String subjectDN = CertificateUtil . toGlobusID ( subject ) ; if ( ( this . allowedDNs == null ) || ( this . allowedDNs . size ( ) < 1 ) ) { return false ; } int size = this . allowedDNs . size ( ) ; for ( int i = 0 ; i < size ; i ++ ) { Pattern pattern = allowedDNs . get ( i ) ; Matcher matcher = pattern . matcher ( subjectDN ) ; boolean valid = matcher . matches ( ) ; if ( valid ) { return true ; } } return false ; }
Ascertains if the subjectDN is valid against this policy .