}
private Object decryptCredentials(Object credentials)
{
if (credentials instanceof EncryptedObject) {
EncryptedObject encPassword = (EncryptedObject) credentials;
Key key = decryptKey(encPassword.getKeyAlgorithm(),
encPassword.getEncKey());
return decrypt(key, encPassword.getEncData());
}
else if (credentials instanceof SelfEncryptedCredentials) {
SelfEncryptedCredentials encCred
= (SelfEncryptedCredentials) credentials;