static char[] decode(String password, ObjectName serviceName) throws Exception { DecodeAction action = new DecodeAction(password, serviceName); try { char[] decode = (char[]) AccessController.doPrivileged(action); return decode; } catch(PrivilegedActionException e) { throw e.getException(); } } }
/** * * @return * @throws Exception */ public Object run() throws Exception { // Invoke the decodeb64 op byte[] secret = decode64(password); // Convert to UTF-8 base char array String secretPassword = new String(secret, "UTF-8"); return secretPassword.toCharArray(); }
protected String getBindCredential() { String bindCredential = options.get(BIND_CREDENTIAL); if (org.jboss.security.Util.isPasswordCommand(bindCredential)) { try { bindCredential = new String(org.jboss.security.Util.loadPassword(bindCredential)); } catch (Exception e1) { PicketBoxLogger.LOGGER.errorDecryptingBindCredential(e1); } } String securityDomain = options.get(SECURITY_DOMAIN_OPT); if (securityDomain != null) { try { ObjectName serviceName = new ObjectName(securityDomain); char[] tmp = DecodeAction.decode(bindCredential, serviceName); bindCredential = new String(tmp); } catch (Exception e) { PicketBoxLogger.LOGGER.errorDecryptingBindCredential(e); } } return bindCredential; }