if (entry.getKey().equalsIgnoreCase("EMAILADDRESS")
|| entry.getKey().equalsIgnoreCase("UID")) {
seq.add(new ASN1IA5String(val));
} else if (entry.getKey().equalsIgnoreCase("C")
|| entry.getKey().equalsIgnoreCase("SERIALNUMBER")) {
seq.add(new ASN1PrintableString(val));
} else {
switch (currentEncoding_) {
case (ASN1.TAG_UTF8STRING):
seq.add(new ASN1UTF8String(val));
break;
case (ASN1.TAG_IA5STRING):
seq.add(new ASN1IA5String(val));
break;
case (ASN1.TAG_PRINTABLESTRING):
if (checkPrintableSpelling(val)) {
seq.add(new ASN1PrintableString(val));
} else {
throw new BadNameException(
"Illegal characters for PrintableString "
+ "in characters");
}