net.kwfgrid.gwes
Class CredentialManager

java.lang.Object
  extended by net.kwfgrid.gwes.CredentialManager

public class CredentialManager
extends Object

Credential manager for secured activities.

Version:
$Id: CredentialManager.java 1532 2011-06-23 15:57:53Z hoheisel $
Author:
Andreas Hoheisel (www.andreas-hoheisel.de)

Field Summary
static int MODE_DEFAULT_PROXY_FILE
          Use the default Globus credential.
static int MODE_PROXY_FILE
          Use a secific proxy file.
static int MODE_USER_CREDENTIAL
          Use a specific credential.
 
Constructor Summary
CredentialManager()
          Create credential manager which uses default Globus Toolkit credential as defined in cog.properties (property X509_USER_PROXY).
CredentialManager(File proxyFile)
          Create credential manager which uses specific proxy File.
CredentialManager(GSSCredential credential)
          Create credential manager which uses specific GSSCredential.
CredentialManager(String userIdCredential)
          Create credential manager which uses specific userID|credential string.
 
Method Summary
static String extractCredential(String userIdCredential)
          Extract a credential from a userIdCredential.
static String extractUserId(String userIdCredential)
          Get userID from userIdCredential String.
 GSSCredential getCredential()
           
 String getDN()
           
 String getFilteredCN()
           
static GSSCredential getGSSCredential(String credentialString)
          Convert a credential String to a GSSCredential.
 void setCredential(GSSCredential credential)
           
 void setCredential(String credentialString)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MODE_DEFAULT_PROXY_FILE

public static final int MODE_DEFAULT_PROXY_FILE
Use the default Globus credential.

See Also:
Constant Field Values

MODE_PROXY_FILE

public static final int MODE_PROXY_FILE
Use a secific proxy file.

See Also:
Constant Field Values

MODE_USER_CREDENTIAL

public static final int MODE_USER_CREDENTIAL
Use a specific credential.

See Also:
Constant Field Values
Constructor Detail

CredentialManager

public CredentialManager()
                  throws GSSException,
                         IOException,
                         LoggingException
Create credential manager which uses default Globus Toolkit credential as defined in cog.properties (property X509_USER_PROXY).

Throws:
GSSException
IOException
LoggingException

CredentialManager

public CredentialManager(File proxyFile)
                  throws GSSException,
                         IOException,
                         LoggingException
Create credential manager which uses specific proxy File.

Parameters:
proxyFile -
Throws:
GSSException
IOException
LoggingException

CredentialManager

public CredentialManager(GSSCredential credential)
                  throws LoggingException,
                         GSSException
Create credential manager which uses specific GSSCredential.

Parameters:
credential -
Throws:
LoggingException
GSSException

CredentialManager

public CredentialManager(String userIdCredential)
                  throws GSSException,
                         LoggingException
Create credential manager which uses specific userID|credential string.

Parameters:
userIdCredential -
Throws:
GSSException
LoggingException
Method Detail

getCredential

public GSSCredential getCredential()
                            throws GSSException,
                                   IOException
Throws:
GSSException
IOException

setCredential

public void setCredential(String credentialString)
                   throws GSSException,
                          LoggingException
Throws:
GSSException
LoggingException

setCredential

public void setCredential(GSSCredential credential)
                   throws GSSException,
                          LoggingException
Throws:
GSSException
LoggingException

getDN

public String getDN()
             throws GSSException
Throws:
GSSException

getFilteredCN

public String getFilteredCN()
                     throws GSSException
Throws:
GSSException

extractCredential

public static String extractCredential(String userIdCredential)
Extract a credential from a userIdCredential. The format is "userID|credentialString".

Parameters:
userIdCredential - The format is "userID|credentialString".
Returns:
the credentialString.

extractUserId

public static String extractUserId(String userIdCredential)
                            throws LoggingException,
                                   WorkflowSecurityException
Get userID from userIdCredential String.

Parameters:
userIdCredential - The format is "userID|credentialString".
Returns:
If userIdCredential contains a credential, then this method returns the DN of the credential. If not, this method just returns the userID (part before "|").
Throws:
LoggingException
WorkflowSecurityException

getGSSCredential

public static GSSCredential getGSSCredential(String credentialString)
                                      throws GSSException
Convert a credential String to a GSSCredential.

Parameters:
credentialString -
Returns:
Throws:
GSSException


Copyright © 2005-2011 Fraunhofer FIRST. All Rights Reserved.