public RDN(String name,Map<String,String> keywordMap) throws IOException {
  int quoteCount=0;
  int searchOffset=0;
  int avaOffset=0;
  List<AVA> avaVec=new ArrayList<AVA>(3);
  int nextPlus=name.indexOf('+');
  while (nextPlus >= 0) {
    quoteCount+=X500Name.countQuotes(name,searchOffset,nextPlus);
    if (nextPlus > 0 && name.charAt(nextPlus - 1) != '\\' && quoteCount != 1) {
      String avaString=name.substring(avaOffset,nextPlus);
      if (avaString.length() == 0) {
        throw new IOException("empty AVA in RDN \"" + name + "\"");
      }
      AVA ava=new AVA(new StringReader(avaString),keywordMap);
      avaVec.add(ava);
      avaOffset=nextPlus + 1;
      quoteCount=0;
    }
    searchOffset=nextPlus + 1;
    nextPlus=name.indexOf('+',searchOffset);
  }
  String avaString=name.substring(avaOffset);
  if (avaString.length() == 0) {
    throw new IOException("empty AVA in RDN \"" + name + "\"");
  }
  AVA ava=new AVA(new StringReader(avaString),keywordMap);
  avaVec.add(ava);
  assertion=avaVec.toArray(new AVA[avaVec.size()]);
}

public RDN ( String name , Map < String , String > keywordMap ) throws IOException { int quoteCount = 0 ; int searchOffset = 0 ; int avaOffset = 0 ; List < AVA > avaVec = new ArrayList < AVA > ( 3 ) ; int nextPlus = name . indexOf ( '+' ) ; while ( nextPlus >= 0 ) { quoteCount += X500Name . countQuotes ( name , searchOffset , nextPlus ) ; if ( nextPlus > 0 && name . charAt ( nextPlus - 1 ) != '\\' && quoteCount != 1 ) { String avaString = name . substring ( avaOffset , nextPlus ) ; if ( avaString . length ( ) == 0 ) { throw new IOException ( "empty AVA in RDN \"" + name + "\"" ) ; } AVA ava = new AVA ( new StringReader ( avaString ) , keywordMap ) ; avaVec . add ( ava ) ; avaOffset = nextPlus + 1 ; quoteCount = 0 ; } searchOffset = nextPlus + 1 ; nextPlus = name . indexOf ( '+' , searchOffset ) ; } String avaString = name . substring ( avaOffset ) ; if ( avaString . length ( ) == 0 ) { throw new IOException ( "empty AVA in RDN \"" + name + "\"" ) ; } AVA ava = new AVA ( new StringReader ( avaString ) , keywordMap ) ; avaVec . add ( ava ) ; assertion = avaVec . toArray ( new AVA [ avaVec . size ( ) ] ) ; }
constructs an rdn from its printable representation . an rdn may consist of one or multiple attribute value assertions ( avas ) , using ' + ' as a separator . if the ' + ' should be considered part of an ava value , it must be preceded by ' \ ' .
