jsdsi.ldap
Class LDAPOperations

java.lang.Object
  extended byjsdsi.ldap.LDAPAttributes
      extended byjsdsi.ldap.LDAPOp
          extended byjsdsi.ldap.LDAPOperations

public class LDAPOperations
extends jsdsi.ldap.LDAPOp

LDAP operations. Insert, retrieve and delete sdsi certificates from a LDAP server

Version:
$Revision: 1.7 $ $Date: 2004/11/08 12:08:08 $
Author:
Lu�s Pedro, Sean Radford

Constructor Summary
LDAPOperations(LDAPParameters params)
          Create a new instance of LDAPOperations
 
Method Summary
 boolean deleteAllCertificates()
          Delete all based SPKI certificates from an LDAP server - CAUTION: The certificates no longer be available.
 boolean deleteCertificate(java.lang.String cn)
          Delete a sdsi certificate from an LDAP server with a specified cn
 LDAPParameters getParameters()
          Ldap parameters used to perform operations
 Certificate retrieveCertificate(java.lang.String cn)
          Retrieves a sdsi certificate from an LDAP server with a specified cn
 void storeCertificate(java.lang.String cn, Certificate certificate)
          Store a sdsi certificate into an LDAP server with a specified cn, default hash algorithm "md5" is assumed
 void storeCertificate(java.lang.String cn, Certificate certificate, java.lang.String hashAlg)
          Store a sdsi certificate into an LDAP server with a specified cn and a hash algorithm
 void toFile(java.lang.String filename)
          Writes all based SPKI certificates on a LDAP server to a file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LDAPOperations

public LDAPOperations(LDAPParameters params)
Create a new instance of LDAPOperations

Parameters:
params - ldap parameters
Method Detail

deleteAllCertificates

public boolean deleteAllCertificates()
                              throws LDAPSearchException
Delete all based SPKI certificates from an LDAP server - CAUTION: The certificates no longer be available.

Returns:
true if the operation was executed with sucess
Throws:
LDAPSearchException - custom error for an empty search, not ldap server error

deleteCertificate

public boolean deleteCertificate(java.lang.String cn)
Delete a sdsi certificate from an LDAP server with a specified cn

Parameters:
cn - cn ldap schema attribute that represents certificate name
Returns:
true if the operation was executed with sucess

retrieveCertificate

public Certificate retrieveCertificate(java.lang.String cn)
Retrieves a sdsi certificate from an LDAP server with a specified cn

Parameters:
cn - cn ldap schema attribute that represents certificate name
Returns:
certificate sdsi certificate
See Also:
Certificate.fromSequence(Sequence)

storeCertificate

public void storeCertificate(java.lang.String cn,
                             Certificate certificate)
Store a sdsi certificate into an LDAP server with a specified cn, default hash algorithm "md5" is assumed

Parameters:
cn - cn ldap schema attribute that represents certificate name
certificate - sdsi certificate

storeCertificate

public void storeCertificate(java.lang.String cn,
                             Certificate certificate,
                             java.lang.String hashAlg)
Store a sdsi certificate into an LDAP server with a specified cn and a hash algorithm

Parameters:
cn - cn ldap schema attribute that represents certificate name
certificate - sdsi certificate
hashAlg - hash algorithm to use with the public keys, "md5" or "sha1"
See Also:
Certificate.getEncoded()

toFile

public void toFile(java.lang.String filename)
Writes all based SPKI certificates on a LDAP server to a file. This file MUST not be used to store certificates on the ldap server using ldap command line commands

Parameters:
filename - filename to write the certificates

getParameters

public LDAPParameters getParameters()
Ldap parameters used to perform operations

Returns:
ldap parameters


Copyright © 2002-2006 JSDSI. All Rights Reserved.