public class JNDIWithSMProxy extends java.lang.Object implements LdapDirectory
LdapDirectory connections.
An SMProxyDirectory and MultipleDirectories object is created
from the parameters supplied in the entrust.ini file. The currently active directory connection
is determined in the call to isAvailable. The following ProxyOrder values are
used to control the Proxy Ordering:
NOTE: A simple TCP/IP connection attempt is used as a connectivity test. For the proxied connection, this test is performed against the proxy server, not the directory.
| Constructor and Description |
|---|
JNDIWithSMProxy(IniFile iniFile,
ProxyOrder proxyOrder)
Constructor that takes and entrust.ini file and the proxy order.
|
JNDIWithSMProxy(java.lang.String entrustIniFile,
ProxyOrder proxyOrder)
Constructor that takes and entrust.ini file path and the proxy order.
|
| Modifier and Type | Method and Description |
|---|---|
byte[][] |
getAttr(java.lang.String dn,
java.lang.String attributeToFind)
Searches for a specific attribute within a directory entry (as specified by a DN).
|
int |
getConnectTimeout()
Returns the socket connect timeout value
|
X509CRL[] |
getCRLs(java.lang.String distributionPoint,
boolean wantARL)
Accessor method that returns an array of Certificate Revocation Lists (CRLs)
or Authority Revocation Lists (ARLs).
|
boolean |
isAvailable()
Determines which connection is alive based on the proxy order and
then calls
isAvailable on that connection. |
void |
setClientCredentials(java.security.cert.X509Certificate verificationCertificate,
java.security.cert.X509Certificate caCertificate,
java.security.PrivateKey signingKey)
Set credentials to use if communicating with a directory protocol that
requires authentication.
|
void |
setConnectTimeout(int connectionTimeout)
Sets the connect timeout to be applied to both the proxied and direct connections.
|
void |
setSMProxyConfig(SMProxyConfig config)
Sets the SSL configuration for the proxied connection
|
public JNDIWithSMProxy(java.lang.String entrustIniFile,
ProxyOrder proxyOrder)
throws SMProxyException,
java.text.ParseException,
java.io.FileNotFoundException,
java.net.MalformedURLException
Creates an SMProxyDirectory and MultipleDirectories object.
entrustIniFile - the entrust.ini file pathproxyOrder - the proxy orderSMProxyExceptionjava.text.ParseException - if there is any issues parsing the parameters from the entrust.inijava.io.FileNotFoundException - if the entrust.ini cannot be foundjava.net.MalformedURLException - is the proxy settings are invalidpublic JNDIWithSMProxy(IniFile iniFile, ProxyOrder proxyOrder) throws SMProxyException, java.text.ParseException, java.io.FileNotFoundException, java.net.MalformedURLException
Creates an SMProxyDirectory and MultipleDirectories object.
iniFile - the IniFile object that contains the proxy settingsproxyOrder - the proxy orderSMProxyException - if an SMProxyDirectory cannot be createdjava.text.ParseException - if there is any issues parsing the parameters from the entrust.inijava.io.FileNotFoundException - if the entrust.ini cannot be foundjava.net.MalformedURLException - is the proxy settings are invalidpublic byte[][] getAttr(java.lang.String dn,
java.lang.String attributeToFind)
throws javax.naming.NamingException
LdapDirectoryGiven a distinguished name and a desired attribute (using X.509 names, such as userCertificate, dn, cn, email, etc.), this method returns a byte array containing the attributes (certificate, CRL, DN, email address).
The following code fragment is an example of typical usage. In this case, each element of the result is a byte array representation of one of the user's certificates.
getAttr( "cn=Roger Ramjet, o=Lompoc, c=US", "userCertificate" );
getAttr in interface LdapDirectorydn - the distinguished nameattributeToFind - the attribute to findjavax.naming.NamingException - thrown if the search failspublic X509CRL[] getCRLs(java.lang.String distributionPoint, boolean wantARL) throws javax.naming.NamingException, java.security.cert.CRLException
LdapDirectorygetCRLs in interface LdapDirectorydistributionPoint - the DN as defined in a certificatewantARL - a boolean flag indicating that an ARL is requiredjavax.naming.NamingException - thrown if the search failsjava.security.cert.CRLException - thrown for other errorspublic boolean isAvailable()
isAvailable on that connection.
This method sets which connection to use based on network availability.
isAvailable in interface LdapDirectorypublic void setClientCredentials(java.security.cert.X509Certificate verificationCertificate,
java.security.cert.X509Certificate caCertificate,
java.security.PrivateKey signingKey)
LdapDirectorysetClientCredentials in interface LdapDirectoryverificationCertificate - a verification certificatecaCertificate - the CA certificate that issued verificationCertificatesigningKey - the private signing key that signs messages verified by verificationCertificatepublic void setSMProxyConfig(SMProxyConfig config) throws SMProxyException
config - the configuration to setSMProxyExceptionpublic int getConnectTimeout()
public void setConnectTimeout(int connectionTimeout)
connectionTimeout - the connectTimeout to set