subjectaltnamestring += "DNSNAME=" + (String) next.get(1);
subjectaltnamestring += separator + "DNSNAME=" + (String) next.get(1); separator = ", ";
    public String getSubjectAltName(){      if(subjectaltnamestring == null){      	        try {          if(certificate.getSubjectAlternativeNames() != null){			subjectaltnamestring = "";          			Iterator iter = certificate.getSubjectAlternativeNames().iterator();			while(iter.hasNext()){			  if(!subjectaltnamestring.equals(""))			    subjectaltnamestring += ", ";	              List next = (List) iter.next();               int OID = ((Integer) next.get(0)).intValue();                            switch(OID){              	case SUBALTNAME_OTHERNAME:              	  // check if upn exists.				  String upn = null;              	  try{              	                      upn = CertTools.getUPNAltName(certificate);              	  }catch(IOException e){}                    if(upn != null)				    subjectaltnamestring += "UPN=" + upn;                                  	                	  break;              	case SUBALTNAME_RFC822NAME: 				  subjectaltnamestring += "RFC822NAME=" + (String) next.get(1);                	  break;              	case SUBALTNAME_DNSNAME:				  subjectaltnamestring += "DNSNAME=" + (String) next.get(1);              	  break;              	case SUBALTNAME_X400ADDRESS:              	  //TODO Implement X400ADDRESS              	  break;				case SUBALTNAME_EDIPARTYNAME:				  //TODO Implement EDIPARTYNAME				  break;              	                	  				case SUBALTNAME_URI:				  subjectaltnamestring += "URI=" + (String) next.get(1);				  break;				case SUBALTNAME_IPADDRESS:                  //TODO implement IPADDRESS				  break;				case SUBALTNAME_REGISTREDID:                  //TODO implement REGISTREDID				  break;              }			}			          }			} catch (CertificateParsingException e) {}                        }              return subjectaltnamestring; 	    }