public interface LdapDirectory
Classes that require access to a source of X509 certificates and other Directory information, stored in an X.500 Directory structure, can implement this interface. Such classes might require a custom initialization and extra methods to perform their roles, but must always define the two methods declared in this interface.
| 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).
|
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()
Checks whether the provided directory is available.
|
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.
|
byte[][] getAttr(java.lang.String dn,
java.lang.String attributeToFind)
throws javax.naming.NamingException
Given 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" );
dn - the distinguished nameattributeToFind - the attribute to findjavax.naming.NamingException - thrown if the search failsX509CRL[] getCRLs(java.lang.String distributionPoint, boolean wantARL) throws javax.naming.NamingException, java.security.cert.CRLException
distributionPoint - 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 errorsboolean isAvailable()
void setClientCredentials(java.security.cert.X509Certificate verificationCertificate,
java.security.cert.X509Certificate caCertificate,
java.security.PrivateKey signingKey)
verificationCertificate - a verification certificatecaCertificate - the CA certificate that issued verificationCertificatesigningKey - the private signing key that signs messages verified by verificationCertificate