Refine search
public static void main(String[] arg) { if (arg.length != 1 && arg.length != 2) { System.err.println("Usage - java " + Password.class.getName() + " [<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 = 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())); } }
/** * De-Obfuscate a password from the XML * @param s a string starting with "OBF:" */ public static String deobfuscate(String s) { if (!s.startsWith("OBF:")) return s; return Password.deobfuscate(s); } }
/** * Returns the password object for the given realm. * * @param realm the realm * @return the Password object */ protected Password getPassword(String realm) { return Password.getPassword(realm, null, null); }
HashLoginService loginService = new HashLoginService(); loginService.putUser(properties.getProperty("eventhubhandler.username"), new Password(properties.getProperty("eventhubhandler.password")), new String[]{"user"});
/** * @param password * The password (if any) for the specific key within the key store */ public void setKeyManagerPassword(String password) { checkNotStarted(); _keyManagerPassword = Password.getPassword(KEYPASSWORD_PROPERTY,password,null); }
/** * Override this method to provide alternate way to load a truststore. * * @return the key store instance * @throws Exception if the truststore cannot be loaded */ protected KeyStore loadTrustStore() throws Exception { return _trustStore != null ? _trustStore : getKeyStore(_trustStoreInputStream, _trustStorePath, _trustStoreType, _trustStoreProvider, _trustStorePassword==null? null: _trustStorePassword.toString()); }
_trustStorePassword == null ? null :_trustStorePassword.toString()); Collection<? extends CRL> crls = loadCRL(_crlPath); CertificateValidator validator = new CertificateValidator(trustStore, crls);
public void actionPerformed(ActionEvent e) { String userInput = inputBox.getText(); boolean pass= Password.check(userInput); //String message = Password.display(null); Password mess= new Password(); passwordLabel.setText( mess.getDisplay()); }
KeyManagerFactory keyManagerFactory = KeyManagerFactory.getInstance(getKeyManagerFactoryAlgorithm()); keyManagerFactory.init(keyStore, _keyManagerPassword == null ? (_keyStorePassword == null ? null : _keyStorePassword.toString().toCharArray()) : _keyManagerPassword.toString().toCharArray()); managers = keyManagerFactory.getKeyManagers(); String alias = getCertAlias(); if (alias != null)
String obfuscated = Password.obfuscate( password ); System.out.println( obfuscated ); System.exit( 0 );
if ( !Utils.isEmpty( slaveServer.getPassword() ) ) { hashLoginService = new HashLoginService( "Kettle" ); hashLoginService.putUser( slaveServer.getUsername(), new Password( slaveServer.getPassword() ), new String[] { "default" } ); } else {
/** * @param password * The password for the key store */ public void setKeyStorePassword(String password) { checkNotStarted(); _keyStorePassword = Password.getPassword(PASSWORD_PROPERTY,password,null); }
/** * Override this method to provide alternate way to load a keystore. * * @return the key store instance * @throws Exception if the keystore cannot be loaded */ protected KeyStore loadKeyStore() throws Exception { return _keyStore != null ? _keyStore : getKeyStore(_keyStoreInputStream, _keyStorePath, _keyStoreType, _keyStoreProvider, _keyStorePassword==null? null: _keyStorePassword.toString()); }
/** * Override this method to provide alternate way to load a keystore. * * @return the key store instance * @throws Exception if the keystore cannot be loaded */ protected KeyStore loadKeyStore() throws Exception { return _keyStore != null ? _keyStore : CertificateUtils.getKeyStore(_keyStoreInputStream, _keyStorePath, _keyStoreType, _keyStoreProvider, _keyStorePassword==null? null: _keyStorePassword.toString()); }
/** * Obfuscate a password for storage in the XML * @return a string starting with "OBF:" */ public static String obfuscate(String s) { if (s.startsWith("OBF:")) return s; return Password.obfuscate(s); }
public static void main(String[] arg) { if (arg.length != 1 && arg.length != 2) { System.err.println("Usage - java " + Password.class.getName() + " [<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 = 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())); } }
/** * Creates a new Password object. * * @param password the password string * @return the new Password object */ public Password newPassword(String password) { return new Password(password); }
/** * @param password * The password for the trust store */ public void setTrustStorePassword(String password) { checkNotStarted(); _trustStorePassword = Password.getPassword(PASSWORD_PROPERTY,password,null); }
/** * Constructor. * * @param password The String password. */ public Password(String password) { _pw = password; // expand password while (_pw != null && _pw.startsWith(__OBFUSCATE)) _pw = deobfuscate(_pw); }
/** * Override this method to provide alternate way to load a keystore. * * @return the key store instance * @throws Exception if the keystore cannot be loaded */ protected KeyStore loadKeyStore() throws Exception { return _keyStore != null ? _keyStore : getKeyStore(_keyStoreInputStream, _keyStorePath, _keyStoreType, _keyStoreProvider, _keyStorePassword==null? null: _keyStorePassword.toString()); }