return;
}
throw new UnsupportedCallbackException(callbacks[i],
"check failed");
}
/*
* here call a function/method to lookup the secret for
* the given identifier (e.g. a user name or keystore alias)
* e.g.: pc.setSecret(passStore.getSecret(pc.getIdentfifier))
* for Testing we supply a fixed name here.
*/
if (pc.getUsage() == WSPasswordCallback.KEY_NAME) {
pc.setKey(key);
} else if (pc.getIdentifer().equals("alice")) {
pc.setPassword("password");
} else if (pc.getIdentifer().equals("bob")) {
pc.setPassword("password");
} else if (pc.getIdentifer().equals("Ron")) {
pc.setPassword("noR");
} else if (pc.getIdentifer().equals("joe")) {
pc.setPassword("eoj");
} else if (pc.getIdentifer().equals("ip")) {
pc.setPassword("password");
} else {
pc.setPassword("sirhC");
}
} else {
throw new UnsupportedCallbackException(callbacks[i],
"Unrecognized Callback");
}