eu.xtreemos.xosd.utilities.security
Class UserCertificateUtility

java.lang.Object
  extended by eu.xtreemos.xosd.utilities.security.UserCertificateUtility

public class UserCertificateUtility
extends java.lang.Object

The class for obtaining information from the user certificates.

Author:
matej.artac@xlab.si

Field Summary
(package private) static org.apache.log4j.Logger logger
           
protected  java.security.cert.X509Certificate userCertificate
           
 
Constructor Summary
UserCertificateUtility(java.security.cert.X509Certificate userCertificate)
           
 
Method Summary
static java.lang.String dumpAttributes(java.security.cert.X509Certificate cert)
           
 java.lang.String getDistinguishedName()
          Extract the distinguished name (DN) from the certificate.
static java.lang.String getDistinguishedName(java.security.cert.X509Certificate userCertificate)
          Extract the distinguished name (DN) from the certificate.
private  java.lang.String getExtendedAttributeValue(VO.Attribute attribute)
           
 java.lang.String getGlobalUserIdentity()
          Extract the global user identity (GUID) from the user's certificate
static java.lang.String getGlobalUserIdentity(java.security.cert.X509Certificate userCertificate)
          Extract the global user identity (GUID) from the user's certificate.
 java.lang.String getPrimaryVOGlobalId()
          Extract the global ID of the primary VO that the user is a member of.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

static final org.apache.log4j.Logger logger

userCertificate

protected java.security.cert.X509Certificate userCertificate
Constructor Detail

UserCertificateUtility

public UserCertificateUtility(java.security.cert.X509Certificate userCertificate)
Method Detail

getGlobalUserIdentity

public java.lang.String getGlobalUserIdentity()
                                       throws java.lang.Exception
Extract the global user identity (GUID) from the user's certificate

Returns:
The value of the global user identity (GUID).
Throws:
java.lang.Exception - if the certificate contains no extended attribute with GUID.

getGlobalUserIdentity

public static java.lang.String getGlobalUserIdentity(java.security.cert.X509Certificate userCertificate)
                                              throws java.lang.Exception
Extract the global user identity (GUID) from the user's certificate.

Parameters:
userCertificate - The certificate to extract GUID from.
Returns:
The value of the global user identity (GUID).
Throws:
java.lang.Exception - if the certificate contains no extended attribute with GUID.

getDistinguishedName

public java.lang.String getDistinguishedName()
Extract the distinguished name (DN) from the certificate.

Returns:
the value of the DN.

getPrimaryVOGlobalId

public java.lang.String getPrimaryVOGlobalId()
Extract the global ID of the primary VO that the user is a member of.

Returns:
the value of the user's primary VO's global ID.
Throws:
java.lang.Exception

getExtendedAttributeValue

private java.lang.String getExtendedAttributeValue(VO.Attribute attribute)

getDistinguishedName

public static java.lang.String getDistinguishedName(java.security.cert.X509Certificate userCertificate)
Extract the distinguished name (DN) from the certificate.

Parameters:
userCertificate - The certificate to obtain the DN from.
Returns:
the value of the DN.

dumpAttributes

public static java.lang.String dumpAttributes(java.security.cert.X509Certificate cert)
                                       throws java.lang.Exception
Throws:
java.lang.Exception