}
return retval;
}
private HardTokenProfile getHardTokenProfile(HardTokenProfileData htpData) {
HardTokenProfile profile = null;
java.beans.XMLDecoder decoder;
try {
decoder = new java.beans.XMLDecoder(new java.io.ByteArrayInputStream(htpData.getData().getBytes("UTF8")));
} catch (UnsupportedEncodingException e) {
throw new RuntimeException(e);
}
HashMap h = (HashMap) decoder.readObject();
decoder.close();
// Handle Base64 encoded string values
HashMap data = new Base64GetHashMap(h);
switch (((Integer) (data.get(HardTokenProfile.TYPE))).intValue()) {
case SwedishEIDProfile.TYPE_SWEDISHEID:
profile = new SwedishEIDProfile();
break;
case EnhancedEIDProfile.TYPE_ENHANCEDEID:
profile = new EnhancedEIDProfile();
break;
case TurkishEIDProfile.TYPE_TURKISHEID:
profile = new TurkishEIDProfile();
break;
}
profile.loadData(data);
return profile;
}