Package es.gob.afirma.tsl.utils
Class UtilsLDAP
- java.lang.Object
-
- es.gob.afirma.tsl.utils.UtilsLDAP
-
public final class UtilsLDAP extends java.lang.ObjectUtilities class relating to connections and LDAP protocol.
Project:Library for the integration with the services of @Firma, eVisor and TS@.
- Version:
- 1.3, 19/09/2022.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.StringextractFirstComponentFromURIldap(java.lang.String uriLdapString)Gets the first component value from a URI LDAP.static java.security.cert.X509CRLgetCRLfromLDAP(java.lang.String urlServer, java.lang.String user, java.lang.String password, java.lang.String pathLDAP, java.lang.String searchFilter, java.lang.String[] attributes, int connectionTimeout, int readTimeout, boolean directLDAP)Method that obtains the CRL from the LDAP.static booleanisUriOfSchemeLDAP(java.lang.String uriString)This method determines whether a given URI scheme is LDAP.static booleanisUriOfSchemeLDAP(java.net.URI uri)This method determines whether a given URI scheme is LDAP.
-
-
-
Method Detail
-
getCRLfromLDAP
public static java.security.cert.X509CRL getCRLfromLDAP(java.lang.String urlServer, java.lang.String user, java.lang.String password, java.lang.String pathLDAP, java.lang.String searchFilter, java.lang.String[] attributes, int connectionTimeout, int readTimeout, boolean directLDAP) throws CommonUtilsExceptionMethod that obtains the CRL from the LDAP.- Parameters:
urlServer- Parameter that represents the URL of the LDAP server (with the port, in another case the port is 389).user- Parameter that represents the user for the authentication.password- Parameter that represents the password for the authentication.pathLDAP- Parameter that represents the path to follow in the LDAP server.searchFilter- Parameter that represents the filter to use in the LDAP server.attributes- Parameter that represents the list of attributes for including in the search.connectionTimeout- Parameter that represents the number of milliseconds for the connection timeout.readTimeout- Parameter that represents the number of milliseconds for the reading timeout.directLDAP- Parameter that indicates whether the connection by LDAP is direct (true) or segmented (false).- Returns:
- a
X509CRLobject that represents the CRL. - Throws:
CommonUtilsException- In case of some error working with the LDAP connection o getting the CRL from this.
-
isUriOfSchemeLDAP
public static boolean isUriOfSchemeLDAP(java.lang.String uriString)
This method determines whether a given URI scheme is LDAP.- Parameters:
uriString- String representation of the URI to analyze.- Returns:
- true if the scheme of the URI is LDAP, otherwise false.
-
isUriOfSchemeLDAP
public static boolean isUriOfSchemeLDAP(java.net.URI uri)
This method determines whether a given URI scheme is LDAP.- Parameters:
uri- Representation of the URI to analyze.- Returns:
- true if the scheme of the URI is LDAP, otherwise false.
-
extractFirstComponentFromURIldap
public static java.lang.String extractFirstComponentFromURIldap(java.lang.String uriLdapString)
Gets the first component value from a URI LDAP.- Parameters:
uriLdapString- URI LDAP.- Returns:
- the first component value from a URI LDAP, or
nullif was not possible to extract.
-
-