/* (non-Javadoc)
@see nyla.solutions.core.util.Settings#getPropertyPassword(java.lang.String, char[])
329379
@Override
	public char[] getPropertyPassword(String key, char[] defaultPassword)
	{
		char[] bVal = null;
		String sVal = getSecureProperty(key);
		if ((sVal != null) && (sVal.length() > 0))
		{
			bVal = sVal.toCharArray();
		}
		else
		{
			bVal = defaultPassword;
		}
		return bVal;

	}
498010
@Override
    public void setPassword(String password) {
        room.setPassword(password);
        apiRoom.setPassword(password);
    }
1312570
public String determinePassword() {
		if (CollectionUtils.isEmpty(this.parsedAddresses)) {
			return getPassword();
		}
		Address address = this.parsedAddresses.get(0);
		return (address.password != null) ? address.password : getPassword();
	}
1937
public Key getPrivateKey(String alias, String password) throws UnrecoverableKeyException, KeyStoreException, NoSuchAlgorithmException {
		return this.keystore.getKey(alias, password.toCharArray());
	}
1093267
public String getPassword(String alias, String passwordPassword) throws NoSuchAlgorithmException, UnrecoverableEntryException, KeyStoreException, InvalidKeySpecException {
		SecretKey sk =  (SecretKey) this.keystore.getKey(alias,passwordPassword.toCharArray());
		return new String(sk.getEncoded());
	}
1046601
@Sensitive
    public static byte[] getByteArrayPassword(@Sensitive String password) throws WIMSystemException {
        String METHODNAME = "getByteArrayPassword";
        try {
            if (password != null) {
                return password.getBytes("UTF-8");
            } else {
                return null;
            }
        } catch (java.io.UnsupportedEncodingException e) {
            if (tc.isErrorEnabled()) {
                Tr.error(tc, WIMMessageKey.GENERIC, WIMMessageHelper.generateMsgParms(e.toString()));
            }
            throw new WIMSystemException(WIMMessageKey.GENERIC, Tr.formatMessage(
                                                                                 tc,
                                                                                 WIMMessageKey.GENERIC,
                                                                                 WIMMessageHelper.generateMsgParms(e.toString())));
        }
    }
480817
private String getPassword(ISecurityContext baseContext) {
        String password = null;
        IOpaqueCredentials oc = baseContext.getOpaqueCredentials();

        if (oc instanceof NotSoOpaqueCredentials) {
            NotSoOpaqueCredentials nsoc = (NotSoOpaqueCredentials) oc;
            password = nsoc.getCredentials();
        }

        // If still no password, loop through subcontexts to find cached credentials
        Enumeration en = baseContext.getSubContexts();
        while (password == null && en.hasMoreElements()) {
            ISecurityContext subContext = (ISecurityContext) en.nextElement();
            password = this.getPassword(subContext);
        }

        return password;
    }
752233
char[] getChars() {
    if (tc.isEntryEnabled())
      tc.entry(this,cclass, "getChars");
    char[] ans;
    if (prefixDone)
      ans = (char[]) pattern.getSuffix().items[next--];
    else
      ans = (char[]) pattern.getPrefix().items[next++];
    if (tc.isEntryEnabled())
      tc.exit(this,cclass, "getChars", new String(ans));
    return ans;
  }
542306
private char[] getPassword()
    {
        String password = null;
        if (this.getField() != null)
            if (((BaseField)this.getField()).getRecord().getRecordOwner() != null)
                password = ((BaseField)this.getField()).getRecord().getRecordOwner().getProperty("keystorePassword");
        if (password == null)
        {
            byte[] rgBytes = DEFAULT_PASSWORD.clone();
            rgBytes = XorEncryptedConverter.encrypt(rgBytes, (byte)'E');
            password = new String(rgBytes);
        }
        return password.toCharArray();
    }
282344
@Override
	public String decode(String password) {
		if (password.startsWith(PASSWORD_PREFIX)) {
			password = password.substring(PASSWORD_PREFIX.length());
			return JKSecurityUtil.decode(new String(JKSecurityUtil.decrypt(password.getBytes())));
		}
		return password;
	}
135256
@Override
	public String getProperty(String key, String aDefault)
	{
		String retval = null;
		
		
		retval = getProperty(key,false);
		if (retval == null || retval.length() == 0)
		{
			retval = aDefault;
		}

		return Cryption.interpret(retval);

	}
1367888
protected char[] getPasswordFromConfig(String name) {
		char[] pass = null;
		if (getBoolean(CredentialProvider.CLEAR_TEXT_FALLBACK,
				CommonConfigurationKeysPublic.
						HADOOP_SECURITY_CREDENTIAL_CLEAR_TEXT_FALLBACK_DEFAULT)) {
			String passStr = get(name);
			if (passStr != null) {
				pass = passStr.toCharArray();
			}
		}
		return pass;
	}
431334
public static String encodePassword(final String password) {
        if (password == null) {
            return null;
        }
        return encodePassword(password.toCharArray());
    }
1149071
public String encriptPassword(String password)
    {
        String newpassword = null;
        byte[] defaultBytes = password.getBytes();
        try
        {
            MessageDigest algorithm = MessageDigest.getInstance("MD5");
            algorithm.reset();
            algorithm.update(defaultBytes);
            byte messageDigest[] = algorithm.digest();

            StringBuffer hexString = new StringBuffer();
            for (int i = 0; i < messageDigest.length; i++)
            {
                hexString.append(Integer.toHexString(0xFF & messageDigest[i]));
            }
            newpassword = hexString.toString();
        }
        catch (NoSuchAlgorithmException e)
        {
            log.error("Error while encripting password {}, caused by : .", password, e);
            throw new PersistenceException(e);
        }
        return newpassword;
    }
444811
protected char[] getPasswordFromCredentialProviders(String name)
      throws IOException {
    char[] pass = null;
    try {
      List<CredentialProvider> providers =
          CredentialProviderFactory.getProviders(this);

      if (providers != null) {
        for (CredentialProvider provider : providers) {
          try {
            CredentialEntry entry = provider.getCredentialEntry(name);
            if (entry != null) {
              pass = entry.getCredential();
              break;
            }
          }
          catch (IOException ioe) {
            throw new IOException("Can't get key " + name + " from key provider" +
            		"of type: " + provider.getClass().getName() + ".", ioe);
          }
        }
      }
    }
    catch (IOException ioe) {
      throw new IOException("Configuration problem with provider path.", ioe);
    }

    return pass;
  }
1226996
public String getUserPassword() {
		if(getSipURI().getUserPassword() == null) return null;
		return RFC2396UrlDecoder.decode(getSipURI().getUserPassword());
	}
284380
private String getUserPassword(Object[] args) throws AuthException {
		if (args == null)
			throw new AuthException("auth error: args is null");
		if ((userPasswordPair == null) || userPasswordPair.equals("")) {
			try {
				StringBuilder sb = new StringBuilder();
				if ((args[0] != null) && (args[1] != null)) {
					sb.append(args[0]);
					sb.append(":");
					sb.append(args[1]);
					userPasswordPair = sb.toString();
				}
			} catch (Exception e) {
				throw new AuthException("auth error: args is null");
			}
		}
		Debug.logVerbose("[JdonFramework] url param is" + userPasswordPair, module);
		return userPasswordPair;
	}