* @throws LDAPException
* @throws UnsupportedEncodingException
*/
private LDAPConnection createConnection() throws LDAPException, UnsupportedEncodingException {
logger.debug("IN");
DefaultCipher defaultCipher = new DefaultCipher();
LDAPConnection connection = null;
try {
connection = new LDAPConnection();
connection.connect(host, port);
if (connection.isConnected()) {
connection.bind(LDAPConnection.LDAP_V3, adminUser, (defaultCipher.decrypt(adminPsw)).getBytes("UTF8"));
}
if (connection.isBound()) {
logger.debug("OUT");
return connection;
}