[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[equinox-dev] Re: SecureStorage: Can not get the password after system user password has been changed

Make the question simpler:

How to delete the secure storage when the system user password has been changed?
2010/2/1 魏昕路 <appleren214@xxxxxxxxx>
I'm using secure storage to store my password. I changed my system password by the prompt that I'm getting from the windows logon screen as a reminder that my password expired. After that, the password can not be read and it can not be stored again. It only occurs on some of my Winodws machines.
I'm thinking about solve the problem by removing the secore_storage file in C:\Documents and Settings\Administrator\.eclipse\org.eclipse.equinox.security when get exception when reading the password. However, there's only one internal method "InternalExchangeUtils.defaultStorageDelete()". I'm not supposed to use that internal method although it did solve the problem.
I also tried to use my own secure_storage file. The code I used to open and delete my secure preference is:
root = SecurePreferencesFactory.open(storeUrl, null);
passwordNode = ibgRoot.node(PASSWORD_NODE);
public static void clearStore() {
    passwordNode = null;
    File file = new File(storeUrl.getPath());
But still I can't store the password. There'll be a StorageException when:
passwordNode.put(PASSWORD_KEY, password, true); 
I think something should have been missed in clearStore(). (maybe close() ?)
Is there any one in the list can help me?  Thank you!

email: appleren214@xxxxxxxxx
MSN: xinlu_wei@xxxxxxx