I was test driving the X500Principal
class like so:
Map<String, String> attr = new LinkedHashMap<String, String>();
attr.put("CN", "Duke");
attr.put("O", "JavaSoft");
X500Principal p1 = new X500Principal("", attr);
X500Principal p2 = new X500Principal("CN=Duke,O=JavaSoft");
From the Javadocs, one should get the impression that p1
and p2
should compare equal, but unfortunately they don't. Using the various getName
methods on p1
I could figure that I always get an empty string.
So I wonder what's the point of passing in a map into the constructor (or the getName(String, Map)
method)?