static String getDNSubField(String varName, String DN) throws CertificateMapperException {
        if (varName.equals("DN")) {
            return DN; // return the whole DN
        }
        // Parse the DN looking for 'varName'
        StringTokenizer st = new StringTokenizer(DN);
        for (;;) {
            String name, value;
            try {
                name = st.nextToken(",= ");
                value = st.nextToken(",");
                if (value != null) {
                    value = value.substring(1);
                }
            } catch (NoSuchElementException e) {
                e.getMessage();
                break;
            }
            if (name.equals(varName)) {
                return value;
            }
        }

        throw new CertificateMapperException(WIMMessageKey.UNKNOWN_DN_FIELD, Tr.formatMessage(
                                                                                              tc,
                                                                                              WIMMessageKey.UNKNOWN_DN_FIELD,
                                                                                              WIMMessageHelper.generateMsgParms(varName)));
    }
static String getDNSubField ( String varName , String DN ) throws CertificateMapperException { if ( varName . equals ( "DN" ) ) { return DN ; } StringTokenizer st = new StringTokenizer ( DN ) ; for ( ; ; ) { String name , value ; try { name = st . nextToken ( ",= " ) ; value = st . nextToken ( "," ) ; if ( value != null ) { value = value . substring ( 1 ) ; } } catch ( NoSuchElementException e ) { e . getMessage ( ) ; break ; } if ( name . equals ( varName ) ) { return value ; } } throw new CertificateMapperException ( WIMMessageKey . UNKNOWN_DN_FIELD , Tr . formatMessage ( tc , WIMMessageKey . UNKNOWN_DN_FIELD , WIMMessageHelper . generateMsgParms ( varName ) ) ) ; }
Given 'input', return the digest version.