org.gcube.common.core.security
Interface GCUBESecurityManager

All Known Subinterfaces:
GCUBEClientSecurityManager, GCUBEServiceSecurityManager
All Known Implementing Classes:
GCUBECredentialAdder, GCUBESecurityManagerImpl, GCUBEServiceContext, GCUBEServiceSecurityManagerImpl, GCUBESimpleServiceSecurityManager

public interface GCUBESecurityManager

Defines the behaviour of security managers, i.e. providers of security-related facilities.

Security managers keep track of credentials to use for outgoing calls in one or more concurrent threads. They allow different clients which execute within a thread to exchange credentials asynchronously; a client which obtains credentials hands them over to the manager where clients which require them, typically in order to make a call, may later find them. Clients may also delegate credentials across different threads (e.g. when they spawn them).

Security managers mediate also between clients and lower-level facilities to set security settings on port-type stubs before making calls.

Security managers are transparent in an unsecure context, where they can be safely invoked to no effect. Implementations ought to implement the method isSecurityEnabled() to discriminate secure from unsecure contexts.

Author:
Fabio Simeoni (University of Strathclyde), Ciro Formisano (ENG)

Nested Class Summary
static class GCUBESecurityManager.AuthMethod
          Enumeration for levels of encryption of outgoing calls.
static class GCUBESecurityManager.AuthMode
          Enumeration for levels of encryption of outgoing calls.
static class GCUBESecurityManager.DelegationMode
          Enumeration for modes of credential delegation for outgoing calls.
 
Method Summary
 SecurityCredentials getCredentials()
          It returns the credentials for outgoing calls currently set in the current thread.
 boolean isSecurityEnabled()
          Indicates whether the manager is operating in a secure context.
 void setAuthMethod(GCUBESecurityManager.AuthMethod m)
          Adds an authentication method to be used in this security context
 void setSecurity(Remote s, GCUBESecurityManager.AuthMode e, GCUBESecurityManager.DelegationMode d)
          If security is enabled, sets the desired level of encryption and the mode of credential delegation on the stub of a remote porttype.
 void useCredentials(GSSCredential credentials)
          Deprecated. 
 void useCredentials(SecurityCredentials credentials)
          If security is enabled, it sets given credentials for outgoing calls in the current thread.
 void useCredentials(Thread thread, SecurityCredentials... credentials)
          If security is enabled, it sets given credentials for outgoing calls in a given thread.
 

Method Detail

isSecurityEnabled

boolean isSecurityEnabled()
Indicates whether the manager is operating in a secure context. If not, invoking its methods will have no effect.

Returns:
true if security is enabled, false otherwise.

useCredentials

@Deprecated
void useCredentials(GSSCredential credentials)
                    throws Exception
Deprecated. 

Parameters:
credentials - the credentials.
Throws:
Exception - if security is enabled, but credentials are corrupt.

useCredentials

void useCredentials(SecurityCredentials credentials)
                    throws Exception
If security is enabled, it sets given credentials for outgoing calls in the current thread. It has no effect otherwise.

Parameters:
credentials - the credentials.
Throws:
Exception - if security is enabled, but credentials are corrupt.

useCredentials

void useCredentials(Thread thread,
                    SecurityCredentials... credentials)
                    throws Exception
If security is enabled, it sets given credentials for outgoing calls in a given thread.

Parameters:
thread - the thread.
credentials - (optional) the credentials. If omitted, it delegates the credentials used for the current thread to the given thread.
Throws:
Exception - if security is enabled, but credentials are corrupt.

getCredentials

SecurityCredentials getCredentials()
It returns the credentials for outgoing calls currently set in the current thread.

Returns:
the credentials.

setSecurity

void setSecurity(Remote s,
                 GCUBESecurityManager.AuthMode e,
                 GCUBESecurityManager.DelegationMode d)
                 throws Exception
If security is enabled, sets the desired level of encryption and the mode of credential delegation on the stub of a remote porttype. It has no effect otherwise.

Parameters:
s - the stub.
e - the encryption level.
d - the delegation mode.
Throws:
Exception - if the settings could not be enforced.

setAuthMethod

void setAuthMethod(GCUBESecurityManager.AuthMethod m)
Adds an authentication method to be used in this security context

Parameters:
m - the authentication method


Copyright © 2013. All Rights Reserved.