/** Constructor. * @param password The String password. */ public Password(String password) { _pw=password; // expand password while (_pw!=null && _pw.startsWith(__OBFUSCATE)) _pw=deobfuscate(_pw); }
public void setKeyPassword(String password) { _keyPassword = Password.getPassword(KEYPASSWORD_PROPERTY,password,null); }
/** * @param arg */ public static void main(String[] arg) { if (arg.length!=1 && arg.length!=2 ) { System.err.println("Usage - java org.mortbay.jetty.security.Password [<user>] <password>"); System.err.println("If the password is ?, the user will be prompted for the password"); System.exit(1); } String p=arg[arg.length==1?0:1]; Password pw = "?".equals(p)?new Password(p):new Password(p); System.err.println(pw.toString()); System.err.println(obfuscate(pw.toString())); System.err.println(Credential.MD5.digest(p)); if (arg.length==2) System.err.println(Credential.Crypt.crypt(arg[0],pw.toString())); } }
/** Get a credential from a String. * If the credential String starts with a known Credential type (eg * "CRYPT:" or "MD5:" ) then a Credential of that type is returned. Else the * credential is assumed to be a Password. * @param credential String representation of the credential * @return A Credential or Password instance. */ public static Credential getCredential(String credential) { if (credential.startsWith(Crypt.__TYPE)) return new Crypt(credential); if (credential.startsWith(MD5.__TYPE)) return new MD5(credential); return new Password(credential); }
keystoreInputStream = Resource.newResource(_keystore).getInputStream(); KeyStore keyStore = KeyStore.getInstance(_keystoreType); keyStore.load(keystoreInputStream, _password==null?null:_password.toString().toCharArray()); keyManagerFactory.init(keyStore,_keyPassword==null?null:_keyPassword.toString().toCharArray()); keyManagers = keyManagerFactory.getKeyManagers(); truststoreInputStream = Resource.newResource(_truststore).getInputStream(); KeyStore trustStore = KeyStore.getInstance(_truststoreType); trustStore.load(truststoreInputStream,_trustPassword==null?null:_trustPassword.toString().toCharArray());
/** * @param arg */ public static void main(String[] arg) { if (arg.length!=1 && arg.length!=2 ) { System.err.println("Usage - java org.mortbay.jetty.security.Password [<user>] <password>"); System.err.println("If the password is ?, the user will be prompted for the password"); System.exit(1); } String p=arg[arg.length==1?0:1]; Password pw = "?".equals(p)?new Password(p):new Password(p); System.err.println(pw.toString()); System.err.println(obfuscate(pw.toString())); System.err.println(Credential.MD5.digest(p)); if (arg.length==2) System.err.println(Credential.Crypt.crypt(arg[0],pw.toString())); } }
/** Get a credential from a String. * If the credential String starts with a known Credential type (eg * "CRYPT:" or "MD5:" ) then a Credential of that type is returned. Else the * credential is assumed to be a Password. * @param credential String representation of the credential * @return A Credential or Password instance. */ public static Credential getCredential(String credential) { if (credential.startsWith(Crypt.__TYPE)) return new Crypt(credential); if (credential.startsWith(MD5.__TYPE)) return new MD5(credential); return new Password(credential); }
/** Constructor. * @param password The String password. */ public Password(String password) { _pw=password; // expand password while (_pw!=null && _pw.startsWith(__OBFUSCATE)) _pw=deobfuscate(_pw); }
passwd=promptDft; return new Password(passwd);
public void setPassword(String password) { _password = Password.getPassword(PASSWORD_PROPERTY,password,null); }
public PasswordAuthenticator(String user, String password) { passwordAuthentication = new PasswordAuthentication (user, (password.startsWith(Password.__OBFUSCATE)?Password.deobfuscate(password):password)); }
passwd=promptDft; return new Password(passwd);
public void setTrustPassword(String password) { _trustPassword = Password.getPassword(PASSWORD_PROPERTY,password,null); }
public PasswordAuthenticator(String user, String password) { passwordAuthentication = new PasswordAuthentication (user, (password.startsWith(Password.__OBFUSCATE)?Password.deobfuscate(password):password)); }