org.globus.gsi.ptls
Class PureTLSUtil

java.lang.Object
  extended byorg.globus.gsi.ptls.PureTLSUtil

public class PureTLSUtil
extends Object

A collection of utility functions for PureTLS library.


Constructor Summary
PureTLSUtil()
           
 
Method Summary
static X509Certificate[] certificateChainToArray(Vector chain)
          Converts a Vector of X509Cert objects into a standard Java X509 certificate array (in the reverse order).
static Vector certificateChainToVector(X509Certificate[] certs)
          Converts standard Java X509 certificate array into a Vector of X509Cert objects (in the reverse order)
static int checkProxyName(COM.claymoresystems.cert.X509Cert cert)
          Deprecated. Only works for Globus legacy proxies.
static X509Certificate convertCert(COM.claymoresystems.cert.X509Cert cert)
          Converts PureTLS specific X509 certificate object into standard Java X509 certificate object (right now it is using BouncyCastle provider to convert).
static COM.claymoresystems.cert.X509Name dupName(COM.claymoresystems.sslg.DistinguishedName name)
          Replicates a X509Name object.
static COM.claymoresystems.cert.X509Name getBase(COM.claymoresystems.sslg.DistinguishedName name)
          Deprecated. Only works with Globus legacy proxies.
static COM.claymoresystems.sslg.CertVerifyPolicyInt getDefaultCertVerifyPolicy()
          Returns a default certificate checking policy.
static String getGlobusId(byte[] cert)
          Deprecated. Only works with Globus legacy proxies.
static COM.claymoresystems.cert.X509Name getX509Name(String globusID)
          Converts Globus formatted string into a X509Name object.
static String toGlobusID(COM.claymoresystems.sslg.DistinguishedName subject)
          Returns the Globus formatted representation of the subject DN of the specified DN.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PureTLSUtil

public PureTLSUtil()
Method Detail

convertCert

public static X509Certificate convertCert(COM.claymoresystems.cert.X509Cert cert)
                                   throws GeneralSecurityException
Converts PureTLS specific X509 certificate object into standard Java X509 certificate object (right now it is using BouncyCastle provider to convert).

Parameters:
cert - PureTLS X509 certificate object
Returns:
standard Java X509 certificate object
Throws:
GeneralSecurityException - if conversion fails.

getX509Name

public static COM.claymoresystems.cert.X509Name getX509Name(String globusID)
                                                     throws Exception
Converts Globus formatted string into a X509Name object.

Parameters:
globusID - Globus-formatted subject to convert.
Returns:
the X509Name object.
Throws:
Exception - if conversion fails.

getBase

public static COM.claymoresystems.cert.X509Name getBase(COM.claymoresystems.sslg.DistinguishedName name)
Deprecated. Only works with Globus legacy proxies.

Returns the base name of a proxy. Strips all "cn=proxy" or "cn=limited proxy" components.


checkProxyName

public static int checkProxyName(COM.claymoresystems.cert.X509Cert cert)
Deprecated. Only works for Globus legacy proxies.

Returns proxy name.


dupName

public static COM.claymoresystems.cert.X509Name dupName(COM.claymoresystems.sslg.DistinguishedName name)
Replicates a X509Name object.

Parameters:
name - X509Name object to replicate.
Returns:
the replicated object.

certificateChainToVector

public static Vector certificateChainToVector(X509Certificate[] certs)
                                       throws GeneralSecurityException
Converts standard Java X509 certificate array into a Vector of X509Cert objects (in the reverse order)

Parameters:
certs - certificate array to convert.
Returns:
the converted Vector of X509Cert objects. Null if certs array was null.
Throws:
GeneralSecurityException - if conversion fails.

certificateChainToArray

public static X509Certificate[] certificateChainToArray(Vector chain)
                                                 throws GeneralSecurityException
Converts a Vector of X509Cert objects into a standard Java X509 certificate array (in the reverse order).

Parameters:
chain - the Vector of X509Cert objects to convert.
Returns:
the converted X509 certificate array
Throws:
GeneralSecurityException - if conversion fails.

getDefaultCertVerifyPolicy

public static COM.claymoresystems.sslg.CertVerifyPolicyInt getDefaultCertVerifyPolicy()
Returns a default certificate checking policy. This is not used as much as the certificate checking was mostly abstracted out from PureTLS code and moved into ProxyPathValidator.

Returns:
the default certificate checking policy.

getGlobusId

public static String getGlobusId(byte[] cert)
                          throws Exception
Deprecated. Only works with Globus legacy proxies.

Returns the Globus formatted representation of the subject DN of the specified certificate.

Parameters:
cert - the encoded certificate
Returns:
the Globus formatted representation of the subject DN.
Throws:
Exception - if something goes wrong.

toGlobusID

public static String toGlobusID(COM.claymoresystems.sslg.DistinguishedName subject)
Returns the Globus formatted representation of the subject DN of the specified DN.

Parameters:
subject - the DN
Returns:
the Globus formatted representation of the subject DN.