/** * Constructs a PasswordCredential with the specified password. * @param password the specified password */ public PasswordCredential(char[] password) { _password = password; _mask = mask(); }
private void extractBasic(String source, Set<Credential> credentials) { String encoded = source.substring(6, source.length()); String decoded = Base64.decodeToString(encoded, _charset); if (decoded.indexOf(':') != -1) { String[] split = decoded.split(":", 2); String name = split.length > 0 ? split[0] : null; if (name != null) { credentials.add(new NameCredential(name)); } String password = split.length > 1 ? split[1] : null; if (password != null) { credentials.add(new PasswordCredential(password)); } } }
/** * {@inheritDoc} */ @Override public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException { Set<Credential> credentials = getCredentials(); if (credentials == null) { throw BaseSecurityMessages.MESSAGES.credentialsNotSet(); } for (Callback cb : callbacks) { if (cb instanceof NameCallback) { for (Credential cred : credentials) { if (cred instanceof NameCredential) { ((NameCallback)cb).setName(((NameCredential)cred).getName()); } } } else if (cb instanceof PasswordCallback) { for (Credential cred : credentials) { if (cred instanceof PasswordCredential) { ((PasswordCallback)cb).setPassword(((PasswordCredential)cred).getPassword()); } } } } }
credentials.add(new PasswordCredential(password));
/** * {@inheritDoc} */ @Override public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException { Set<Credential> credentials = getCredentials(); if (credentials == null) { throw BaseSecurityMessages.MESSAGES.credentialsNotSet(); } for (Callback cb : callbacks) { if (cb instanceof NameCallback) { for (Credential cred : credentials) { if (cred instanceof NameCredential) { ((NameCallback)cb).setName(((NameCredential)cred).getName()); } } } else if (cb instanceof PasswordCallback) { for (Credential cred : credentials) { if (cred instanceof PasswordCredential) { ((PasswordCallback)cb).setPassword(((PasswordCredential)cred).getPassword()); } } } } }
/** * Constructs a PasswordCredential with the specified password. * @param password the specified password */ public PasswordCredential(char[] password) { _password = password; _mask = mask(); }
String password = XMLHelper.valueOf(usernameChildNode.getFirstChild()); if (password != null) { credentials.add(new PasswordCredential(password));
/** * Constructs a PasswordCredential with the specified password. * @param password the specified password */ public PasswordCredential(String password) { _password = password != null ? password.toCharArray() : null; _mask = mask(); }
String password = XMLHelper.valueOf(usernameChildNode.getFirstChild()); if (password != null) { credentials.add(new PasswordCredential(password));
/** * Constructs a PasswordCredential with the specified password. * @param password the specified password */ public PasswordCredential(String password) { _password = password != null ? password.toCharArray() : null; _mask = mask(); }