Methods Summary |
---|
public synchronized void | addIdentity(java.security.Identity identity)
if (identity == null) {
throw new NullPointerException(Messages.getString("security.92")); //$NON-NLS-1$
}
String name = identity.getName();
if (names.containsKey(name)) {
throw new KeyManagementException(Messages.getString("security.93", name)); //$NON-NLS-1$
}
PublicKey key = identity.getPublicKey();
if (key != null && keys.containsKey(key)) {
throw new KeyManagementException(Messages.getString("security.94", key)); //$NON-NLS-1$
}
names.put(name, identity);
if (key != null) {
keys.put(key, identity);
}
|
public synchronized java.security.Identity | getIdentity(java.lang.String name)
if (name == null) {
throw new NullPointerException();
}
return (Identity) names.get(name);
|
public synchronized java.security.Identity | getIdentity(java.security.PublicKey key)
if (key == null) {
return null;
}
return (Identity) keys.get(key);
|
public java.util.Enumeration | identities()
return names.elements();
|
public synchronized void | removeIdentity(java.security.Identity identity)
//Exception caught = null;
if (identity == null) {
throw new NullPointerException(Messages.getString("security.92")); //$NON-NLS-1$
}
String name = identity.getName();
if (name == null) {
throw new NullPointerException(Messages.getString("security.95")); //$NON-NLS-1$
}
boolean contains = names.containsKey(name);
names.remove(name);
PublicKey key = identity.getPublicKey();
if (key != null) {
contains = contains || keys.containsKey(key);
keys.remove(key);
}
if (!contains) {
throw new KeyManagementException(Messages.getString("security.96")); //$NON-NLS-1$
}
|
public int | size()
return names.size();
|