package org.csstudio.sns.passwordprovider;

import javax.crypto.spec.PBEKeySpec;

import org.eclipse.core.runtime.Platform;
import org.eclipse.equinox.security.storage.provider.IPreferencesContainer;
import org.eclipse.equinox.security.storage.provider.PasswordProvider;

/** PasswordProvider for
 *  extension point org.eclipse.equinox.security.secureStorage.
 *  Generates a password without requiring user input
 *  @author Xihui Chen
 */
public class SNSPasswordProvider extends PasswordProvider {
	@Override
	public PBEKeySpec getPassword(IPreferencesContainer container,
			int passwordType) {	
		
		String installLoc = Platform.getInstallLocation().getURL().toString();
		return new PBEKeySpec(installLoc.toCharArray());
	}

}

@@ -596,16 +596,59 @@
 e) %7B%09%0A%09%09
+//the master password cannot include spaces
 %0A%09%09Strin
@@ -711,16 +711,38 @@
 String()
+.replaceAll(%22%5C%5Cs%22, %22%22)
 ;%0A%09%09retu

change master password so it won't include spaces