private void parseEncodedPassword(final String password) { if (password != null && password.startsWith("{")) { int closingBracketIndex = password.indexOf('}'); String digest = password.substring(1, password.indexOf('}')); if (digest != null) { digest = digest.toUpperCase(); } try { encodedPassword = password.substring(closingBracketIndex + 1); cipher = CipherAlgorithm.valueOf(digest); } catch (IllegalArgumentException e) { LOG.error("Cipher algorithm not allowed: {}", digest, e); encodedPassword = null; } } }
private void parseEncodedPassword(final String password, final Connector connector) { if (password != null) { ConnInstance connInstance = connector.getConnInstance(); String cipherAlgorithm = getCipherAlgorithm(connInstance); if (!CLEARTEXT.equals(cipherAlgorithm)) { try { encodedPassword = password; cipher = CipherAlgorithm.valueOf(cipherAlgorithm); } catch (IllegalArgumentException e) { LOG.error("Cipher algorithm not allowed: {}", cipherAlgorithm, e); encodedPassword = null; } } } }
private void setPassword(final User user, final String password, final SyncopeClientCompositeException scce) { try { String algorithm = confDAO.find("password.cipher.algorithm", CipherAlgorithm.AES.name()); user.setPassword(password, CipherAlgorithm.valueOf(algorithm)); } catch (IllegalArgumentException e) { SyncopeClientException invalidCiperAlgorithm = SyncopeClientException.build(ClientExceptionType.NotFound); invalidCiperAlgorithm.getElements().add(e.getMessage()); scce.addException(invalidCiperAlgorithm); throw scce; } }
authenticated = ENCRYPTOR.verify( authentication.getCredentials().toString(), CipherAlgorithm.valueOf(adminPasswordAlgorithm), adminPassword); } else {
authenticated = ENCRYPTOR.verify( authentication.getCredentials().toString(), CipherAlgorithm.valueOf(adminPasswordAlgorithm), adminPassword); } else {