com.entrust.toolkit.x509
Interface LdapDirectory

All Known Implementing Classes:
HttpDirectoryClient, JNDIDirectory

public interface LdapDirectory

Interface for classes that require access to information stored in an X.509 directory structure.

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.


Method Summary
 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).
 

Method Detail

getAttr

public byte[][] getAttr(java.lang.String dn,
                        java.lang.String attributeToFind)
                 throws javax.naming.NamingException
Searches for a specific attribute within a directory entry (as specified by a DN).

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" );
 
Parameters:
dn - the distinguished name
attributeToFind - the attribute to find
Returns:
the desired attribute as a byte array
Throws:
javax.naming.NamingException - thrown if the search fails

getCRLs

public X509CRL[] getCRLs(java.lang.String distributionPoint,
                         boolean wantARL)
                  throws javax.naming.NamingException,
                         CRLException
Accessor method that returns an array of Certificate Revocation Lists (CRLs) or Authority Revocation Lists (ARLs).
Parameters:
distributionPoint - the DN as defined in a certificate
wantARL - a boolean flag indicating that an ARL is required
Returns:
an array of CRLs or ARLs
Throws:
javax.naming.NamingException - thrown if the search fails
CRLException - thrown for other errors