Skip navigation links

Oracle Security Developer Tools PKI SDK LDAP Java API Reference
11g (11.1.1)

E10669-02


oracle.security.crypto.ldap
Class LDAPUtils

java.lang.Object
  extended by oracle.security.crypto.ldap.LDAPUtils


public class LDAPUtils
extends java.lang.Object

Constructor Summary
LDAPUtils()
           

 

Method Summary
static void addCACert(javax.security.auth.x500.X500Principal subject, java.security.cert.X509Certificate cert, javax.naming.directory.DirContext ctx)
          Adds a CA certificate to the LDAP server.
static void addCACert(java.security.cert.X509Certificate cert, javax.naming.directory.DirContext ctx)
          Adds a CA certificate to the LDAP server.
static void addCert(javax.security.auth.x500.X500Principal subject, java.security.cert.X509Certificate cert, java.lang.String attr, javax.naming.directory.DirContext ctx)
          Adds a certificate to the LDAP server.
static void addCert(java.security.cert.X509Certificate cert, java.lang.String attr, javax.naming.directory.DirContext ctx)
          Adds a certificate to the LDAP server.
static void addCRL(oracle.security.crypto.cert.CRL crl, javax.naming.directory.DirContext ctx)
          Adds a CRL to the LDAP server.
static void addCRL(oracle.security.crypto.cert.X500Name crlDist, oracle.security.crypto.cert.CRL crl, javax.naming.directory.DirContext ctx)
          Adds a CRL to the LDAP server.
static void addUserCert(javax.security.auth.x500.X500Principal subject, java.security.cert.X509Certificate cert, javax.naming.directory.DirContext ctx)
          Adds a certificate to the LDAP server.
static void addUserCert(java.security.cert.X509Certificate cert, javax.naming.directory.DirContext ctx)
          Adds a certificate to the LDAP server.
static void createCA(javax.security.auth.x500.X500Principal dn, java.security.cert.X509Certificate cert, java.security.PrivateKey sk, oracle.security.crypto.cert.CRL crl, javax.naming.directory.DirContext ctx)
          Creates a CA on the LDAP server: a certificate and a CRL..
static void createCA(javax.security.auth.x500.X500Principal dn, java.security.cert.X509Certificate cert, java.security.PrivateKey sk, javax.naming.directory.DirContext ctx)
          Creates a CA on the LDAP server: a certificate and a CRL..
static void createCA(java.security.cert.X509Certificate cert, java.security.PrivateKey sk, oracle.security.crypto.cert.CRL crl, javax.naming.directory.DirContext ctx)
          Creates a CA on the LDAP server: a certificate and a CRL..
static void createCA(java.security.cert.X509Certificate cert, java.security.PrivateKey sk, javax.naming.directory.DirContext ctx)
          Creates a CA on the LDAP server: a certificate and a CRL..
static java.util.Vector getCACerts(javax.security.auth.x500.X500Principal subject, javax.naming.directory.DirContext ctx)
          Gets the certificates that match the subject from the Directory represented by the context.
static java.util.Vector getCerts(javax.security.auth.x500.X500Principal subject, java.lang.String attr, javax.naming.directory.DirContext ctx)
          Gets the certificates that match the subject from the Directory represented by the context.
static oracle.security.crypto.cert.CRL getCRL(javax.security.auth.x500.X500Principal crlDist, javax.naming.directory.DirContext ctx)
          Gets a CRL from the Directory represented by the context.
static java.util.Vector getUserCerts(javax.security.auth.x500.X500Principal subject, javax.naming.directory.DirContext ctx)
          Gets the certificates that match the subject from the Directory represented by the context.
static void removeCACert(javax.security.auth.x500.X500Principal subject, javax.naming.directory.DirContext ctx)
          Removes a CAcertificate from the LDAP server.
static void removeCACert(javax.security.auth.x500.X500Principal subject, java.security.cert.X509Certificate cert, javax.naming.directory.DirContext ctx)
          Removes a CAcertificate from the LDAP server.
static void removeCACert(java.security.cert.X509Certificate cert, javax.naming.directory.DirContext ctx)
          Removes a CAcertificate from the LDAP server.
static void removeCert(javax.security.auth.x500.X500Principal subject, java.lang.String attr, javax.naming.directory.DirContext ctx)
          Removes a certificate from the LDAP server.
static void removeCert(javax.security.auth.x500.X500Principal subject, java.security.cert.X509Certificate cert, java.lang.String attr, javax.naming.directory.DirContext ctx)
          Removes a certificate from the LDAP server.
static void removeCert(java.security.cert.X509Certificate cert, java.lang.String attr, javax.naming.directory.DirContext ctx)
          Removes a certificate from the LDAP server.
static void removeUserCert(javax.security.auth.x500.X500Principal subject, javax.naming.directory.DirContext ctx)
          Removes a certificate from the LDAP server.
static void removeUserCert(javax.security.auth.x500.X500Principal subject, java.security.cert.X509Certificate cert, javax.naming.directory.DirContext ctx)
          Removes a certificate from the LDAP server.
static void removeUserCert(java.security.cert.X509Certificate cert, javax.naming.directory.DirContext ctx)
          Removes a certificate from the LDAP server.
static java.security.cert.X509Certificate toJCECert(oracle.security.crypto.cert.X509 cert)
           
static oracle.security.crypto.cert.X509 toPhaosCert(java.security.cert.X509Certificate cert)
           
static oracle.security.crypto.core.PrivateKey toPhaosPrivateKey(java.security.PrivateKey privateKey)
           
static void updateCRL(oracle.security.crypto.cert.CRL crl, javax.naming.directory.DirContext ctx)
          Updates a CRL on the LDAP server.
static void updateCRL(oracle.security.crypto.cert.X500Name crlDist, oracle.security.crypto.cert.CRL crl, javax.naming.directory.DirContext ctx)
          Updates a CRL on the LDAP server.

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

LDAPUtils

public LDAPUtils()

Method Detail

addUserCert

public static void addUserCert(java.security.cert.X509Certificate cert,
                               javax.naming.directory.DirContext ctx)
                        throws java.io.IOException,
                               javax.naming.NamingException
Adds a certificate to the LDAP server. The name identifying the certificate will be the subject of the certificate. The id of the attribute that will contain the value of the certificate will be userCertificate.

Note the changes in the method signature

Previouslypublic static void addUserCert (X509, DirContext )

Now public static void addUserCert (X509Certificate, DirContext)

Parameters:
cert - The X509 certificate to import.
ctx - The directory context.
Throws:
java.io.IOException
javax.naming.NamingException

addUserCert

public static void addUserCert(javax.security.auth.x500.X500Principal subject,
                               java.security.cert.X509Certificate cert,
                               javax.naming.directory.DirContext ctx)
                        throws java.io.IOException,
                               javax.naming.NamingException
Adds a certificate to the LDAP server. The id of the attribute that will contain the value of the certificate will be userCertificate.

Note the changes in the method signature

Previouslypublic static void addUserCert (X500Name ,X509, DirContext )

Now public static void addUserCert (X500Principal , X509Certificate, DirContext)

Parameters:
subject - The name that will identify the certificate in the directory.
cert - The X509 certificate to import.
ctx - The directory context.
Throws:
java.io.IOException
javax.naming.NamingException

addCACert

public static void addCACert(java.security.cert.X509Certificate cert,
                             javax.naming.directory.DirContext ctx)
                      throws java.io.IOException,
                             javax.naming.NamingException
Adds a CA certificate to the LDAP server. The name identifying the certificate will be the subject of the certificate. The id of the attribute that will contain the value of the certificate will be cACertificate.

Note the changes in the method signature

Previously public static void addCACert (X509, DirContext)

Now public static void addCACert (X509Certificate , DirContext)

Parameters:
cert - The X509 CAcertificate to import.
ctx - The directory context.
Throws:
java.io.IOException
javax.naming.NamingException

addCACert

public static void addCACert(javax.security.auth.x500.X500Principal subject,
                             java.security.cert.X509Certificate cert,
                             javax.naming.directory.DirContext ctx)
                      throws java.io.IOException,
                             javax.naming.NamingException
Adds a CA certificate to the LDAP server. The id of the attribute that will contain the value of the certificate will be cACertificate.

Note the changes in the method signature

Previouslypublic static void addCACert (X500Name , X509 , DirContext )

Now public static void addCACert (X500Principal , X509Certificate, DirContext )

Parameters:
subject - The name that will identify the certificate in the directory.
cert - The X509 CAcertificate to import.
ctx - The directory context.
Throws:
java.io.IOException
javax.naming.NamingException

addCert

public static void addCert(java.security.cert.X509Certificate cert,
                           java.lang.String attr,
                           javax.naming.directory.DirContext ctx)
                    throws java.io.IOException,
                           javax.naming.NamingException
Adds a certificate to the LDAP server. The name identifying the certificate will be the subject of the certificate.

Note the changes in the method signature

Previouslypublic static void addCert (X509 , String , DirContext )

Now public static void addCert (X509Certificate , String , DirContext )

Parameters:
cert - The X509 certificate to import.
attr - The id of the attribute that will contain the value of the certificate.
ctx - The directory context.
Throws:
java.io.IOException
javax.naming.NamingException

addCert

public static void addCert(javax.security.auth.x500.X500Principal subject,
                           java.security.cert.X509Certificate cert,
                           java.lang.String attr,
                           javax.naming.directory.DirContext ctx)
                    throws java.io.IOException,
                           javax.naming.NamingException
Adds a certificate to the LDAP server.

Note the changes in the method signature

Previouslypublic static void addCert (X500Name ,X509 , String , DirContext )

Now public static void addCert (X500Principal , X509Certificate , String , DirContext )

Parameters:
subject - The name that will identify the certificate in the directory.
cert - The X509 certificate to import.
attr - The id of the attribute that will contain the value of the certificate.
ctx - The directory context.
Throws:
java.io.IOException
javax.naming.NamingException

getUserCerts

public static java.util.Vector getUserCerts(javax.security.auth.x500.X500Principal subject,
                                            javax.naming.directory.DirContext ctx)
                                     throws java.io.IOException,
                                            javax.naming.NamingException
Gets the certificates that match the subject from the Directory represented by the context. The id of the attribute to retrieve will be userCertificate.

Note the changes in the method signature

Previouslypublic static Vector getUserCerts (X500Name, DirContext)

Now public static Vector getUserCerts (X500Principal , DirContext )

Parameters:
subject - The subject identifying the certificate to look for.
ctx - The directory context.
Throws:
java.io.IOException
javax.naming.NamingException

getCACerts

public static java.util.Vector getCACerts(javax.security.auth.x500.X500Principal subject,
                                          javax.naming.directory.DirContext ctx)
                                   throws java.io.IOException,
                                          javax.naming.NamingException
Gets the certificates that match the subject from the Directory represented by the context. The id of the attribute to retrieve will be cACertificate.

Note the changes in the method signature

Previouslypublic static Vector getCACerts (X500Name, DirContext )

Now public static Vector getCACerts (X500Principal , DirContext )

Parameters:
subject - The subject identifying the certificate to look for.
ctx - The directory context.
Throws:
java.io.IOException
javax.naming.NamingException

getCerts

public static java.util.Vector getCerts(javax.security.auth.x500.X500Principal subject,
                                        java.lang.String attr,
                                        javax.naming.directory.DirContext ctx)
                                 throws java.io.IOException,
                                        javax.naming.NamingException
Gets the certificates that match the subject from the Directory represented by the context.

Note the changes in the method signature

Previouslypublic static Vector getCerts (X500Name, String, DirContext )

Now public static Vector getCerts (X500Principal ,String, DirContext )

Parameters:
subject - The subject identifying the certificate to look for.
attr - The id identifying the attribute to retrieve.
ctx - The directory context.
Throws:
java.io.IOException
javax.naming.NamingException

getCRL

public static oracle.security.crypto.cert.CRL getCRL(javax.security.auth.x500.X500Principal crlDist,
                                                     javax.naming.directory.DirContext ctx)
                                              throws java.io.IOException,
                                                     javax.naming.NamingException
Gets a CRL from the Directory represented by the context. The id of the attribute to retrieve will be certificateRevocationList.

Note the changes in the method signature

Previouslypublic static CRL getCRL (X500Name, DirContext )

Now public static CRL getCRL (X500Principal , DirContext )

Parameters:
crlDist - The identifier representing the CRL to look for.
ctx - The directory context.
Throws:
java.io.IOException
javax.naming.NamingException

removeUserCert

public static void removeUserCert(java.security.cert.X509Certificate cert,
                                  javax.naming.directory.DirContext ctx)
                           throws java.io.IOException,
                                  javax.naming.NamingException
Removes a certificate from the LDAP server. The name identifying the certificate to remove will be the subject of the certificate. The id of the attribute to remove containing the value of the certificate will be userCertificate.

Note the changes in the method signature

Previously public static void removeUserCert (X509, DirContext )

Now public static void removeUserCert (X509Certificate, DirContext )

Parameters:
cert - The X509 certificate to remove.
ctx - The directory context.
Throws:
java.io.IOException
javax.naming.NamingException

removeUserCert

public static void removeUserCert(javax.security.auth.x500.X500Principal subject,
                                  java.security.cert.X509Certificate cert,
                                  javax.naming.directory.DirContext ctx)
                           throws java.io.IOException,
                                  javax.naming.NamingException
Removes a certificate from the LDAP server. The id of the attribute to remove containing the value of the certificate will be userCertificate.

Note the changes in the method signature

Previously public static void removeUserCert (X500Name ,X509, DirContext )

Now public static void removeUserCert (X500Principal ,X509Certificate, DirContext )

Parameters:
subject - The name identifying the certificate to remove from the directory.
cert - The X509 certificate to remove.
ctx - The directory context.
Throws:
java.io.IOException
javax.naming.NamingException

removeUserCert

public static void removeUserCert(javax.security.auth.x500.X500Principal subject,
                                  javax.naming.directory.DirContext ctx)
                           throws java.io.IOException,
                                  javax.naming.NamingException
Removes a certificate from the LDAP server. The id of the attribute to remove containing the value of the certificate will be userCertificate.

Note the changes in the method signature

Previously public static void removeUserCert (X500Name , DirContext )

Now public static void removeUserCert (X500Principal , DirContext )

Parameters:
subject - The name identifying the certificate to remove from the directory.
ctx - The directory context.
Throws:
java.io.IOException
javax.naming.NamingException

removeCACert

public static void removeCACert(java.security.cert.X509Certificate cert,
                                javax.naming.directory.DirContext ctx)
                         throws java.io.IOException,
                                javax.naming.NamingException
Removes a CAcertificate from the LDAP server. The name identifying the certificate to remove will be the subject of the certificate.The id of the attribute to remove containing the value of the certificate will be cACertificate.

Note the changes in the method signature

Previously public static void removeCACert (X500Name , DirContext )

Now public static void removeCACert (X500Principal , DirContext )

Parameters:
cert - The X509 CAcertificate to remove.
ctx - The directory context.
Throws:
java.io.IOException
javax.naming.NamingException

removeCACert

public static void removeCACert(javax.security.auth.x500.X500Principal subject,
                                java.security.cert.X509Certificate cert,
                                javax.naming.directory.DirContext ctx)
                         throws java.io.IOException,
                                javax.naming.NamingException
Removes a CAcertificate from the LDAP server. The id of the attribute to remove containing the value of the certificate will be cACertificate.

Note the changes in the method signature

Previously public static void removeCACert (X500Name , X509, DirContext )

Now public static void removeCACert (X500Principal , X509Certificate, DirContext )

Parameters:
subject - The name identifying the CAcertificate to remove from the directory.
cert - The X509 CAcertificate to remove.
ctx - The directory context.
Throws:
java.io.IOException
javax.naming.NamingException

removeCACert

public static void removeCACert(javax.security.auth.x500.X500Principal subject,
                                javax.naming.directory.DirContext ctx)
                         throws java.io.IOException,
                                javax.naming.NamingException
Removes a CAcertificate from the LDAP server. The id of the attribute to remove containing the value of the certificate will be cACertificate.

Note the changes in the method signature

Previously public static void removeCACert (X500Name , DirContext )

Now public static void removeCACert (X500Principal , DirContext )

Parameters:
subject - The name identifying the CAcertificate to remove from the directory.
ctx - The directory context.
Throws:
java.io.IOException
javax.naming.NamingException

removeCert

public static void removeCert(java.security.cert.X509Certificate cert,
                              java.lang.String attr,
                              javax.naming.directory.DirContext ctx)
                       throws java.io.IOException,
                              javax.naming.NamingException
Removes a certificate from the LDAP server. The name identifying the certificate to remove will be the subject of the certificate.

Note the changes in the method signature

Previously public static void removeCert (X509,String, DirContext )

Now public static void removeCert (X509Certificate ,String, DirContext )

Parameters:
cert - The X509 certificate to remove.
attr - The id of the attribute to remove.
ctx - The directory context.
Throws:
java.io.IOException
javax.naming.NamingException

removeCert

public static void removeCert(javax.security.auth.x500.X500Principal subject,
                              java.security.cert.X509Certificate cert,
                              java.lang.String attr,
                              javax.naming.directory.DirContext ctx)
                       throws java.io.IOException,
                              javax.naming.NamingException
Removes a certificate from the LDAP server.

Note the changes in the method signature

Previously public static void removeCert (X500Name , X509,String, DirContext )

Now public static void removeCert (X500Principal , X509Certificate ,String, DirContext )

Parameters:
subject - The name identifying the certificate to remove from the directory.
cert - The X509 certificate to remove.
attr - The id of the attribute to remove.
ctx - The directory context.
Throws:
java.io.IOException
javax.naming.NamingException

removeCert

public static void removeCert(javax.security.auth.x500.X500Principal subject,
                              java.lang.String attr,
                              javax.naming.directory.DirContext ctx)
                       throws java.io.IOException,
                              javax.naming.NamingException
Removes a certificate from the LDAP server.

Note the changes in the method signature

Previously public static void removeCert (X500Name ,String, DirContext )

Now public static void removeCert (X500Principal , String, DirContext )

Parameters:
subject - The name identifying the certificate to remove from the directory.
attr - The id of the attribute to remove.
ctx - The directory context.
Throws:
java.io.IOException
javax.naming.NamingException

addCRL

public static void addCRL(oracle.security.crypto.cert.CRL crl,
                          javax.naming.directory.DirContext ctx)
                   throws java.io.IOException,
                          javax.naming.NamingException
Adds a CRL to the LDAP server. The name identifying the CRL will be the issuer of the CRL. The id of the attribute that will contain the value of the CRL will be certificateRevocationList.
Parameters:
crl - The CRL to import.
ctx - The directory context.
Throws:
java.io.IOException
javax.naming.NamingException

addCRL

public static void addCRL(oracle.security.crypto.cert.X500Name crlDist,
                          oracle.security.crypto.cert.CRL crl,
                          javax.naming.directory.DirContext ctx)
                   throws java.io.IOException,
                          javax.naming.NamingException
Adds a CRL to the LDAP server. The name identifying the CRL will be the issuer of the CRL. The id of the attribute that will contain the value of the CRL will be certificateRevocationList.
Parameters:
crlDist - The name that will identify the CRL in the directory.
crl - The CRL to import.
ctx - The directory context.
Throws:
java.io.IOException
javax.naming.NamingException

updateCRL

public static void updateCRL(oracle.security.crypto.cert.CRL crl,
                             javax.naming.directory.DirContext ctx)
                      throws java.io.IOException,
                             javax.naming.NamingException
Updates a CRL on the LDAP server. The name identifying the CRL will be the issuer of the CRL. The id of the attribute that will contain the value of the CRL will be certificateRevocationList.
Parameters:
crl - The CRL to import.
ctx - The directory context.
Throws:
java.io.IOException
javax.naming.NamingException

updateCRL

public static void updateCRL(oracle.security.crypto.cert.X500Name crlDist,
                             oracle.security.crypto.cert.CRL crl,
                             javax.naming.directory.DirContext ctx)
                      throws java.io.IOException,
                             javax.naming.NamingException
Updates a CRL on the LDAP server. The id of the attribute that will contain the value of the CRL will be certificateRevocationList.
Parameters:
crlDist - The name identifying the CRL in the directory.
crl - The CRL to import.
ctx - The directory context.
Throws:
java.io.IOException
javax.naming.NamingException

createCA

public static void createCA(java.security.cert.X509Certificate cert,
                            java.security.PrivateKey sk,
                            javax.naming.directory.DirContext ctx)
                     throws java.io.IOException,
                            javax.naming.NamingException,
                            java.security.SignatureException
Creates a CA on the LDAP server: a certificate and a CRL..

Note the changes in the method signature

Previously public static void createCA (X509,oracle.security.crypto.core.PrivateKey , DirContext )

Now public static void createCA ( X509Certificate ,java.security.PrivateKey, DirContext )

Parameters:
cert - The X509 CAcertificate to import.
sk - The private key of the CA.
ctx - The directory context.
Throws:
java.io.IOException
javax.naming.NamingException
java.security.SignatureException

createCA

public static void createCA(javax.security.auth.x500.X500Principal dn,
                            java.security.cert.X509Certificate cert,
                            java.security.PrivateKey sk,
                            javax.naming.directory.DirContext ctx)
                     throws java.io.IOException,
                            javax.naming.NamingException,
                            java.security.SignatureException
Creates a CA on the LDAP server: a certificate and a CRL..

Note the changes in the method signature

Previously public static void createCA (X500Name ,X509,oracle.security.crypto.core.PrivateKey , DirContext )

Now public static void createCA (X500Principal , X509Certificate ,java.security.PrivateKey, DirContext )

Parameters:
dn - The name identifying the certificate and the CRL.
cert - The X509 CAcertificate to import.
sk - The private key of the CA.
ctx - The directory context.
Throws:
java.io.IOException
javax.naming.NamingException
java.security.SignatureException

createCA

public static void createCA(java.security.cert.X509Certificate cert,
                            java.security.PrivateKey sk,
                            oracle.security.crypto.cert.CRL crl,
                            javax.naming.directory.DirContext ctx)
                     throws java.io.IOException,
                            javax.naming.NamingException,
                            java.security.SignatureException
Creates a CA on the LDAP server: a certificate and a CRL..

Note the changes in the method signature

Previously public static void createCA (X509,oracle.security.crypto.core.PrivateKey ,CRL , DirContext )

Now public static void createCA ( X509Certificate ,java.security.PrivateKey, CRL ,DirContext )

Parameters:
cert - The X509 CAcertificate to import.
sk - The private key of the CA.
crl - The CRL to import.
ctx - The directory context.
Throws:
java.io.IOException
javax.naming.NamingException
java.security.SignatureException

createCA

public static void createCA(javax.security.auth.x500.X500Principal dn,
                            java.security.cert.X509Certificate cert,
                            java.security.PrivateKey sk,
                            oracle.security.crypto.cert.CRL crl,
                            javax.naming.directory.DirContext ctx)
                     throws java.io.IOException,
                            javax.naming.NamingException,
                            java.security.SignatureException
Creates a CA on the LDAP server: a certificate and a CRL..

Note the changes in the method signature

Previously public static void createCA (X500Name ,X509,oracle.security.crypto.core.PrivateKey ,CRL, DirContext )

Now public static void createCA (X500Principal , X509Certificate ,java.security.PrivateKey,CRL, DirContext )

Parameters:
dn - The name identifying the certificate and the CRL.
cert - The X509 CAcertificate to import.
sk - The private key of the CA.
crl - The CRL to import.
ctx - The directory context.
Throws:
java.io.IOException
javax.naming.NamingException
java.security.SignatureException

toJCECert

public static java.security.cert.X509Certificate toJCECert(oracle.security.crypto.cert.X509 cert)
                                                    throws java.security.cert.CertificateException
Throws:
java.security.cert.CertificateException

toPhaosPrivateKey

public static oracle.security.crypto.core.PrivateKey toPhaosPrivateKey(java.security.PrivateKey privateKey)
                                                                throws java.security.InvalidKeyException
Parameters:
privateKey - JCE privatekey
Returns:
Phaos privateKey
Throws:
java.security.InvalidKeyException

toPhaosCert

public static oracle.security.crypto.cert.X509 toPhaosCert(java.security.cert.X509Certificate cert)
                                                    throws java.io.IOException
Throws:
java.io.IOException

Skip navigation links

Oracle Security Developer Tools PKI SDK LDAP Java API Reference
11g (11.1.1)

E10669-02


Copyright © 2005, 2009, Oracle. All rights reserved.