View Javadoc

1   package org.astrogrid.ogsa.echo;
2   
3   import javax.xml.rpc.Stub;
4   import org.globus.axis.gsi.GSIConstants;
5   import org.globus.ogsa.impl.security.authentication.Constants;
6   import org.globus.ogsa.impl.security.authorization.NoAuthorization;
7   
8   /***
9    * A collection of static methods that configure a port object
10   * (i.e. an object built on a client stub for a grid service)
11   * to use GT3 message security.
12   */
13  public class SecurityHelper {
14    
15    /***
16     * Configures a port stub to use GSI message security
17     * with XML signatures.
18     */
19    static public void configureSecureCall (Object port) {
20      Stub stub = (Stub)port;
21      stub._setProperty(Constants.MSG_SEC_TYPE,
22                        Constants.SIGNATURE);
23      stub._setProperty(Constants.AUTHORIZATION,
24                        NoAuthorization.getInstance());
25    }
26  
27  
28    /***
29     * Configures a port stub to use "delegation by impersonation"
30     * in its limited form. Ports configured with this method must
31     * also be configured with {@link #configureSecureCall}.
32     */
33    static public void configureDelegation (Object port) {
34      Stub stub = (Stub)port;
35      stub._setProperty(GSIConstants.GSI_MODE,
36                        GSIConstants.GSI_MODE_LIMITED_DELEG);
37    }
38  
39  }