GT 4.2.0 Java WS A&A Public Interfaces


APIs

Documentation for these interfaces can be found here .

1. Authorization Programming Model

Independent authorization settings can be configured on the server and client side. The security programming model on the server side is declarative and all configuration is done by setting a security descriptor. The descriptor can be a resource, service or container descriptor, depending on the required scope for the authorization. Alternatively the security settings can be done using programmatic security descriptor constructs. The client side the configuration is done by setting required properties on the stub used to make the method invocation. The security properties, and hence the authorization settings, can be set directly as properties on the stub, or a client security descriptor that encapsulates the individual properties may be written and in turn passed to the framework via a property on the stub object.

2. Authentication/message protection Programming Model

The authentication programming model differs between the client and server side. The client side model is programmatic in nature, i.e. security-related code is driven by making actual function calls, whereas the server-side model is declarative, i.e. security-related settings are declared in a security descriptor. For more information on the available client side calls see Configuring client authentication and message/transport security. More information about the security descriptor can be found in Java WS A&A Security Descriptor Framework.

3. API

  • Generic Java Authorization Engine API

    • org.globus.security.authorization.PDP
    • org.globus.security.authorization.PIP
    • org.globus.security.authorization.ChainConfig
    • org.globus.security.authorization.Interceptor
  • Stable API

    • org.globus.wsrf.security.Constants
    • org.globus.wsrf.security.SecureResource
    • org.globus.wsrf.security.SecurityManager
    • org.globus.wsrf.security.authorization.Constants
    • org.globus.wsrf.security.impl.authorization.Authorization
  • Less stable API

    • org.globus.wsrf.impl.security.descriptor.ClientSecurityDescriptor
    • org.globus.wsrf.impl.security.descriptor.ServiceSecurityDescriptor
    • org.globus.wsrf.impl.security.descriptor.ResourceSecurityDescriptor

Services and WSDL

1. Secure Conversation Service

1.1. Protocol overview

This service provides a mechanism for generating a security session, i.e the negotiation of a shared secret which may be used to secure a set of subsequent messages. It is based on the WS-Trust and WS-SecureConversation specifications.

1.2. Operations

  • RequestSecurityToken: This operation initiates a new security session negotiation. Furthermore, since the actual schema for this message is not unambiguously defined by the specifications, this is the actual schema used:
<xs:element name='RequestSecurityToken'>
   <xs:complexType name='RequestSecurityTokenType'>
      <xs:sequence>
         <xs:element ref='wst:TokenType'/>
         <xs:element ref='wst:RequestType'/>
         <xs:element ref='wst:BinaryExchange'/>
      </xs:sequence>
      <xs:attribute name='Context' type='xs:anyURI'/>
   </xs:complexType>
</xs:element>

<xs:element name='RequestSecurityTokenResponse'>
   <xs:complexType name='RequestSecurityTokenResponseType'>
      <xs:sequence>
         <xs:element ref='wst:TokenType'/>
         <xs:element ref='wst:RequestType'/>
         <xs:element ref='wst:BinaryExchange'/>
      </xs:sequence>
      <xs:attribute name='Context' type='xs:anyURI'/>
   </xs:complexType>
</xs:element>
  • RequestSecurityTokenResponse: This operation continues a security session negotiation. Furthermore, since the actual schema for this message is not unambiguously defined by the specifications, this is the actual schema used:
<xs:element name='RequestSecurityTokenResponse'>
   <xs:complexType name='RequestSecurityTokenResponseType'>
      <xs:sequence>
         <xs:element ref='wst:TokenType'/>
         <xs:element ref='wst:RequestType'/>
         <xs:element ref='wst:BinaryExchange'/>
      </xs:sequence>
      <xs:attribute name='Context' type='xs:anyURI'/>
   </xs:complexType>
</xs:element>
 
<xs:element name='RequestSecurityTokenResponse'>
   <xs:complexType name='RequestSecurityTokenResponseType'>
      <xs:sequence>
         <xs:element ref='wst:TokenType'/>
         <xs:element ref='wst:RequestType'/>
         <xs:element ref='wst:BinaryExchange'
                     minOccurs="0"/>
         <xs:element ref='wsc:SecurityContextToken'/>
      </xs:sequence>
      <xs:attribute name='Context' type='xs:anyURI'/>
   </xs:complexType>
</xs:element>  

In the above schema, the second RequestSecurityTokenResponse element refers to the final message in the exchange.

1.3. Resource properties

This service has no associated resource properties.

1.4. Faults

Both RequestSecurityToken and RequestSecurityTokenResponse throw the following faults:

  • ValueTypeNotSupportedFault: This fault indicates that the value type attribute on the binary exchange token element is not supported by the service.
  • EncodingTypeNotSupportedFault: This fault indicates that the encoding type attribute on the binary exchange token element is not supported by the service.
  • RequestTypeNotSupportedFault: This fault indicates that the request type specified in the request type element is not supported by the service
  • TokenTypeNotSupportedFault: This fault indicates that the token type specified in the token type element is not supported by the service.
  • MalformedMessageFault: This fault indicates that the message content received by the service does not conform to the expected content. This is necessary since the schema does not give a well defined content model.
  • BinaryExchangeFault: This fault indicates that a failure occurred during the in the underlying security constant responsible for the session negotiation.
  • InvalidContextIdFault: This fault indicates that the context id passed in the message is not valid within the context of this service or negotiation.

1.5. WSDL and Schema Definitions

2. SAML Authorization Callout

The authorization framework as such does not have a WSDL interface. On the other hand one of the authorization schemes in the toolkit, a callout to an authorization service compliant with the specification published by the OGSA Authorization Working Group (OGSA-AuthZ) requires a WSDL interface for the service. The callout makes a query on the configured authorization service, which returns an authorization decision.

2.1. Protocol overview

The authorization service takes a query as input and returns an authorization decision. The Security Assertion Markup Language (SAML) is used for expressing the query and the decision. If any fault occurs, it is embedded as a part of the decision. The decision can be a permit, deny or indeterminate.

2.2. Operations

  • SAMLRequest: Used to send queries to the authorization service, which after processing returns an authorization decision. All faults are embedded as part of the decision that is returned, i.e. no fault is declared at the WSDL level.
  • GetResourceProperty: Gets the value of a specific resource property. This operation throws the following faults:

    • ResourceUnknownFault
    • InvalidResourcePropertyQNameFault
  • SetResourceProperties: Sets the value for resource properties. This operation throws the following faults:

    • ResourceUnknownFault
    • InvalidSetResourcePropertiesRequestContentFault
    • UnableToModifyResourcePropertyFault
    • InvalidResourcePropertyQNameFault
    • SetResourcePropertyRequestFailedFault
  • QueryResourceProperties: Used for the querying of resource properties using a query expression. This operation throws the following faults:

    • ResourceUnknownFault
    • InvalidResourcePropertyQNameFault
    • UnknownQueryExpressionDialectFault
    • InvalidQueryExpressionFault
    • QueryEvaluationErrorFault

2.3. Resource properties

  • supportedPolicies: Contains identifiers for any or all access control policies that the authorization service is capable of rendering decisions regarding.
  • supportsIndeterminate: Indicates whether the authorization service may return an "indeterminate" authorization decision. If set to flase, only permit or deny is returned.
  • signatureCapable: Indicates if the authorization service is capable of signing the decision returned. If not, only unsigned decisions are returned.

2.5. WSDL and Schema Definition

Framework-level Protocols

2. Transport (HTTPS) Security

The transport security solution used by the framework consists of HTTP over SSL/TLS (HTTPS) using X.509 certificates. The path validation step has been augmented to support the Proxy Certificate Profile (RFC3820).

Configuring client authentication and message/transport security

1. Interface introduction

Client-side security is set up by either setting individual properties on the javax.xml.rpc.Stub object used for the web service method invocation or by setting properties on a client-side security descriptor object, which in turn is propagated to client-side security handlers by making it available as a stub object property. Here are examples of the two approaches:

  • Setting a property on the stub:

    // Create endpoint reference
    EndpointReferenceType endpoint = new EndpointReferenceType();
    // Set address of service
    String counterAddr = 
       "http://localhost:8080/wsrf/services/CounterService";
    // Get handle to port 
    CounterPortType port = 
       locator.getCounterPortTypePort(endpoint);
    // set client authorization to self 
      ((Stub)port)._setProperty(Constants.AUTHORIZATION, 
                   SelfAuthorization.getInstance());
  • Setting properties using a client descriptor:

    // Client security descriptor file 
    String CLIENT_DESC = 
       "org/globus/wsrf/samples/counter/client/client-security-config.xml"; 
    // Create endpoint reference
    EndpointReferenceType endpoint = new EndpointReferenceType();
    // Set address of service
    String counterAddr = 
       "http://localhost:8080/wsrf/services/CounterService";
    // Get handle to port 
    CounterPortType port = 
       locator.getCounterPortTypePort(endpoint);
    //Set descriptor on Stub 
    ((Stub)port)._setProperty(Constants.CLIENT_DESCRIPTOR_FILE, CLIENT_DESC);

The descriptor file is described in detail in Introduction.

[Note]Note

If the client needs to use transport security, the following API must be used to register the Axis transport handler for https:

import org.globus.axis.util.Util;
static {
        Util.registerTransport();
    }

2. Syntax of the interface

Table 1. Client side security properties

NumberTask Stub Configuration Descriptor Configuration
1.Allows for configuration of credentials for authentication.

Property:

org.globus.axis.gsi.GSIConstants.GSI_CREDENTIALS

Value equals the Instance of org.ietf.jgss.GSSCredential.

Section 2, “Credentials”

2.Allows for configuring client-side authorization.

Property:

org.globus.wsrf.security.Constants.AUTHORIZATION

Value equals the Instance of org.globus.wsrf.security.authorization.Authorization

If GSI Secure Transport or GSI Secure Conversation is used, the value should be an instance of org.globus.gsi.gssapi.auth.Authorization. But this translation is done automatically by the toolkit.

Refer to Section 3, “Authorization policy”
3.Enable GSI Secure Conversation with specified message protection level.

1. Property:

org.globus.wsrf.security.Constants.GSI_SEC_CONV

Values equal one of the following:

  • Constants.ENCRYPTION
  • Constants.SIGNATURE

2. Property:

org.globus.wsrf.security.Constants.GSI_SEC_CONV_SECREPLY_UNNECESSARY

If the value is set to Boolean.TRUE, the GSI Secure conversation protection is not required in the reply message. By default, if the request was secured with GSI Secure Conversation, the response is also required to have the same protection.

3. Property:

You can set the SOAP Actor of the GSI signed/encrypted SOAP message by using the gssActor property. We recommend that you not do this unless you really know what you are doing.

Refer Section 4, “GSI Secure Conversation”.

4.Sets the GSI delegation mode. Used for GSI Secure Conversation only. If limited or full delegation is chosen, then some form of client-side authorization needs to be done (i.e client-side authorization cannot be set to none).

Property:

org.globus.axis.gsi.GSIConstants.GSI_MODE 

Value equals one of following:

  1. GSIConstants.GSI_MODE_NO_DELEG: No delegation is performed.
  2. GSIConstants.GSI_MODE_LIMITED_DELEG: Limited delegation is performed.
  3. GSIConstants.GSI_MODE_FULL_DELEG: Full delegation is performed.

Refer Section 4, “GSI Secure Conversation”

5.Enables GSI Secure Transport with some protection level.

Property:

org.globus.gsi.GSIConstants.GSI_TRANSPORT

Values equal one of the following:

  • Constants.ENCRYPTION
  • Constants.SIGNATURE

Refer Section 6, “GSI Secure Transport”

6.Enables anonymous authentication. This option only applies to GSI Secure Conversation and GSI Transport.

Property:

org.globus.wsrf.security.Constants.GSI_ANONYMOUS 

Value equals one of following:

  1. Boolean.FALSE: Anonymous authentication is disabled.
  2. Boolean.TRUE: Anonymous authentication is enabled.

Refer Section 4, “GSI Secure Conversation” and Section 6, “GSI Secure Transport”

7.Enable GSI Secure Message with specified message protection level.

1. Property:

org.globus.wsrf.security.Constants.GSI_SEC_MSG

Values equal one of the following:

  • Constants.ENCRYPTION
  • Constants.SIGNATURE

2. Property:

org.globus.wsrf.security.Constants.GSI_SEC_MSG_SECREPLY_UNNECESSARY

If the value is set to Boolean.TRUE, the GSI Secure Message protection is not required in the reply message. By default, if the request was secured with GSI Secure Message, the response is also required to have the same protection.

3. Property:

org.globus.wsrf.security.Constants.GSI_SEC_MSG_SINGLECERT

If the value is set to Boolean.TRUE, only a single certificate is used for the GSI Secure Message request. By default, the whole certificate chain is sent.

4. Property:

You can set the SOAP Actor of the signed message using the x509Actor property, but we do not recommend this unless you know what you are doing.

Refer Section 5, “GSI Secure Message”.

8.Enable WS-Security username/password authentication.

Properties:

org.globus.wsrf.security.Constants.USERNAME

Value equals the username.

org.globus.wsrf.security.Constants.PASSWORD

Value equals the password.

Refer Section 7, “Username/Password”

9.Sets the credential that is used to encrypt the message (typically, the recipient's public key). Used for GSI Secure Message only.

Property:

org.globus.wsrf.impl.security.authentication
                          .Constants.PEER_SUBJECT        

Value equals the instance of javax.security.auth.Subject.

The credential object needs to be wrapped in org.globus.wsrf.impl.security.authentication.encryption and added to the set of public credentials of the Subject object.

For example, if publicKeyFilename was the file that had the recipient's public key:

Subject subject = new Subject();
X509Certificate serverCert = 
    CertUtil.loadCertificate(publicKeyFilename);
EncryptionCredentials encryptionCreds = 
    new EncryptionCredentials(
        new X509Certificate[] { serverCert });
subject.getPublicCredentials().add(encryptionCreds);
stub._setProperty(Constants.PEER_SUBJECT, subject);
              

Refer Section 5, “GSI Secure Message”

10.Sets the trusted certificates location.

Property:

org.globus.wsrf.security.TRUSTED_CERTIFICATES

Value should be a comma-separated list of directories and file names.

Refer Section 8, “Trusted credentials”
11.Sets the SAML Authorization Assertion to embed in SOAP Header.

Property:

org.globus.wsrf.impl.security.authentication.Constants.SAML_AUTHZ_ASSERTION

Value should be an instance of org.opensaml.SAMLAssertion.

Cannot be configured using descriptors.

Authorization domain-level interface

1. Interface introduction

Configuration on the server side is done using Introduction. Make sure you have read about security descriptors (in the aforementioned link) before continuing with this chapter. Custom authorization mechanisms can be written and used as a part of the GT framework. The next section describes the steps involved.

On the client side, in addition to the security descriptor, properties on the stub can be set to configure security properties. Properties and values are described in detail in the next section.

2. Syntax of the interface

2.1. Configuring client-side authorization on the stub

The property to use depends on the authentication scheme:

  • If GSI Secure Transport or GSI Secure Conversation is used, the org.globus.axis.gsi.GSIConstants.GSI_AUTHORIZATION property must be set on the stub. The value of this property must be an instance of an object that extends from org.globus.gsi.gssapi.auth.GSSAuthorization. All distributed authorization schemes have implementation in org.globus.gsi.gssapi.auth package.

  • For all other authentication schemes, the org.globus.wsrf.impl.security.Constants.AUTHORIZATION property must be set on the stub. The value of this property must be an instance of an object that implements the org.globus.wsrf.impl.security.authorization.Authorization interface.

  • Example:

          // Create endpoint reference EndpointReferenceType
          endpoint = new EndpointReferenceType(); 
          // Set address of service
          String counterAddr = 
             "http://localhost:8080/wsrf/services/CounterService";
          // Get handle to stub object
          CounterPortType port = 
               locator.getCounterPortTypePort(endpoint);
          // set client authorization to self 
          ((Stub)port)._setProperty(Constants.AUTHORIZATION, 
                       SelfAuthorization.getInstance());
                

2.2. Writing custom client-side authorization scheme

Other than the distributed client authorization scheme, custom client-side authorization schemes can be written and can be set as the value for the appropriate property on the stub.

[Note]Note

Security descriptors cannot be used to configure custom authorization schemes on the client side.

  • If the authentication scheme to be used is GSI Secure Transport or GSI Secure Conversation, the custom authorization scheme should extend from extends from org.globus.gsi.gssapi.auth.GSSAuthorization.

          public class TestAuthorization extends GSSAuthorization {
          
            // Provide some way to instantiate this class. Can use constructor
            // with arguments to pass in parameters.
             public TestAuthorization() {
    
             }
    
             public GSSName getExpectedName(GSSCredential cred, String host) 
                throws GSSException {
    
                // Return the expected GSSName of the remote entity.
             }
    
    
              public void authorize(GSSContext context, String host)
    	     throws AuthorizationException {      
    
                 // Perform the authorization steps.
                 // context.getSrcName() provides the local GSSName
                 // context.getTargName() provides the remote GSSName
    
                 // if authorization fails, throw AuthorizationException
             }
          }
          

    The following describes the steps done for client side authorization during context establishment:

    • Prior to initialization of context establishment the relevant handler (HTTPSSender in case of GSI Secure Transport or SecContextHandler in case of GSI Secure Conversation), invokes getExpectedName on the instance of GSSAuthorization set on the Stub.

    • During context establishment, if the expected target name from previous step is not null, it is compared with the remote peer's GSSName. If it is not a match, context establishment is abandoned and an error is thrown.

      If the expected target name is null, then a match is not done, unless the option of delegation is used. That is, if GSI Secure Conversation with delegation is used, then the expected target name cannot be null and must match the remote peer's identity.

    • Once the context has been established, the authorize method is invoked.

    [Note]Note

    Client authorization is done prior to invocation.

    To configure the custom authorization scheme:

          ((Stub)port)._setProperty(GSIConstants.GSI_AUTHORIZATION, 
                       new TestAuthorization());
          

    Various authorization scheme implementations in package org.globus.gsi.gssapi.auth would serve as examples. View CVS Link

  • For all authentication schemes other than those in previous step the org.globus.wsrf.impl.security.Constants.AUTHORIZATION property must be set on the stub. The value of this property must be an instance of an object that implements the org.globus.wsrf.impl.security.authorization.Authorization interface.

          public class TestAuthorization implements Authorization {
          
            // Provide some way to instantiate this class. Can use constructor
            // with arguments to pass in parameters.
             public TestAuthorization() {
    
             }
    
             public GSSName getName(MessageContext ctx) 
                throws GSSException {
    
                // Return the expected GSSName of the remote entity.
             }
    
    
              void authorize(Subject peerSubject, MessageContext context)
                                     throws AuthorizationException {
    
                 // Perform the authorization steps.
                 // peerSubject provides the remote Subject
                 // Use SecurityManager API to get local Subject
    
                 // if authorization fails, throw AuthorizationException
             }
          }
          

    The following describes the steps done for client side authorization:

    • The client side handler WSSecurityClientHandler, invokes authorize method on the authorization instance.

    [Note]Note

    Client authorization is done after the invocation.

    To configure the custom authorization scheme:

          ((Stub)port)._setProperty(Constants.AUTHORIZATION, 
                       new TestAuthorization());
          

    Various authorization scheme implementations in package org.globus.wsrf.impl.security.authorization would serve as examples. View CVS Link.

2.3. Writing a custom server-side authorization mechanism

The server side authorization framework can be configured to use custom authorization interceptors, bootstrap PIP, PIP and PDP. Detailed information on writing custom PDPs can be found in GT Java Authorization Framework. Also, the section Section 1, “Migrating Java WS Authorization Framework from GT 4.0” describes migrating from older PDP/PIP implementations.

For example, a custom PDP must implement the interface org.globus.security.authorization.PDP.

Example:

package org.foobar;

import ....;

public class FooPDP implements PDP
{
    private Principal authorizedIdentity;


    public Decision canAccess(RequestEntity requestEntity,
                              NonRequestEntity nonRequestEntity)
        throws AuthorizationException {
        
        // process and return decision
    }

    public Decision canAdminister(RequestEntity requestEntity,
                                  NonRequestEntity nonRequestEntity)
        throws AuthorizationException {

        // process and return decision
    }

}

To use the above PDP one would configure a service security descriptor with the following authorization settings:

<securityConfig xmlns="http://www.globus.org">
   ...
   <authz value="foo1:org.foobar.FooPDP"/>
   ...
<securityConfig/>

This security descriptor (identified as /.../foo-pdp-security-config.xml below) can then be used by a service. The association is created by adding a couple of parameters to the service's WSDD entry:

...
<service name="MyDummyService" 
             provider="Handler" 
             style="document">
   ...
   <parameter name="securityDescriptor" 
                     value="/.../foo-pdp-security-config.xml"/>
   <parameter name="foo1-authorizedIdentity" 
                     value="/DC=org/DC=doe/OU=People/CN=John D"/>
   ...
</service>

Note that the parameter <parameter>foo1-authorizedIdentity</parameter> in the above configures the identity the PDP uses for authorizing incoming requests. The parameter name is derived by composing the prefix (<parameter>foo1</parameter>) used when specifying the PDP in the security descriptor with the property (<parameter>authorizedIdentity</parameter>) used in the PDP code.

PDP Reference

1. Introduction

[fixme - what are PDPs?]

If you have a PDP you'd like to contribute to the Globus Toolkit, use the following template:

[Note]Note

The above files are in DocBook XML format. Simply click the link, save to your hard drive, edit the file in a text or xml editor and email to ?. Don't worry about getting the tags right, it's enough to enter the information where it makes sense and we'll clean up the tags where necessary.

2. Access Control List PDP

2.1. Class name

org.globus.wsrf.impl.security.authorization.AccessControlListPDP

2.2. Overview

The PDP uses configured access contol lists to ascertain if a subject can access an operation.

2.3. Configuration

accessConfigFile

Property to configure the file containing policy for accessing resource. If not configured, file access-acl.conf is used by default.

adminConfigFile

Property to configure file containing policy for administrating the resource. If not configured, file admin-acl.conf is used by default.

The PDP looks for the files in the following order:

  1. Current directory (.)

  2. /etc

  3. /etc/grid-security

  4. $GLOBUS_LOCATION

The configured files should have the following format:

subjectName=serviceName#method1,method2;testService2#method1,method2

  • Each subject DN should be a seperate line. Equal to signs (=) and spaces should be escaped with backslash (\)

  • An equal to must separate the subject DN and the service/operation name description.

  • List of service URL and method names separated by semi-colon (;)

  • Each service and method description should container service URL followed by hash sign (#) and list of methods the subject DN is allowed to access/admin.

  • Method names for each service separated by comma (,).

2.4. Decision Table

Bad configuration INDETERMINATE
No configurationINDETERMINATE
No policy for subjectDENY
Anonymous AccessDENY
No policy for subject to access service/operationDENY
Policy exists for subject to access service/operationPERMIT

2.5. Related interceptors

No interceptors are related other than the default bootstrap interceptor (X509 Bootstrap PIP), which is required to be used with this PDP.

3. GridMap Authorization

3.1. Class name

org.globus.wsrf.impl.security.authorization.GridMapPDP

3.2. Overview

This scheme checks the presence of a user's DN in a configured gridmap file. The grid map file contains a list of mappings from a user's DN to set of local user names that the user is mapped to. The DN and the list of comma-separated mappings are separated by a space. Each mapping is a separate new line by itself.

If the user is present in the configured gridmap file, the mappings are populated in the peer subject object as principals and the user is allowed access to the resource. Absence of DN in gridmap file yields a deny.

3.3. Configuration

The gridmap file location or an instance of GridMap object needs to be configured as a parameter to this PDP. The parameter names are:

gridmap-file

Property to configure the location of the gridmap file. (From CoG add details on how this file is read in, relative to current directory ?)]

gridmapObject

Property to configure an instance of GridMap class.

The PDP looks for the gridmap file in the following order:

  1. GridMap object property in the configuration.

  2. GridMap file property in the configuration.

  3. GridMap object in the container default properties.

  4. GridMap file property in the container default properties.

A default grid map file can be configured as described in Section 1, “Configuring Default GridMap File”.

3.4. Decision Table

No peer subject INDETERMINATE
Bad/No gridmap configurationINDETERMINATE
Failed girdmap refreshINDETERMINATE
Anonymous AccessDENY
No gridmap entryDENY
Gridmap entry presentPERMIT

3.5. Related interceptors

No interceptors are related other than the default bootstrap interceptor (X509 Bootstrap PIP), which is required to be used with this PDP.

4. Host Authorization

4.1. Class name

org.globus.wsrf.impl.security.authorization.HostAuthzPDP

4.2. Overview

PDP performs host-based authorization of the client, i.e expects the client to be running with host credential.

4.3. Configuration

url

Property that should be configured with the URL of the client.

service

Property that can be configured with the service, if service credentials are used rather than regular host credentials. By default the value is set to host.

4.4. Decision Table

No peer subject INDETERMINATE
Bad configurationINDETERMINATE
url property not configuredINDETERMINATE
Anonymous AccessDENY
Peer DN does not match expected DNDENY
Peer DN matches expected DNPERMIT

4.5. Related interceptors

No interceptors are related other than the default bootstrap interceptor (X509 Bootstrap PIP), which is required to be used with this PDP.

5. IdentityAuthorization

5.1. Class name

org.globus.wsrf.impl.security.authorization.IdentityAuthzPDP

5.2. Overview

Compares the peer subject with a specific configured subject DN.

5.3. Configuration

identity

Property that should be configured with the expected peer DN.

5.4. Decision Table

No peer subject DENY
No local subject INDETERMINATE
Peer subject does not match configured (expected) subject DNDENY
Peer subject matches the configured(expected) subject DNPERMIT

5.5. Related interceptors

No interceptors are related other than the default bootstrap interceptor (X509 Bootstrap PIP), which is required to be used with this PDP.

6. No Authorization

6.1. Class name

org.globus.wsrf.impl.security.authorization.NoAuthorization

6.2. Overview

This PDP always returns a permit.

6.3. Configuration

None.

6.4. Decision Table

Always returns a permit-

6.5. Related interceptors

No interceptors are related

7. ResourceProperties Authorization

7.1. Class name

org.globus.wsrf.impl.security.authorization.ResourcePropertiesPDP

7.2. Overview

The PDP enforces a parameter based authorization policy on GetResourceProperty, GetMultipleResourceProperties and SetResourceProperties. QueryResourceProperties is not protected by this PDP and to prevent malicious access of RPs through that method, access to that method must be protected using other schemes. GetMultipleResourceProperies access is allowed only if policy allows user access to all the RPs qeuried.

7.3. Configuration

get-rp-pdp-config

Property that should be configured with a file containing authorization policy for access to GetResourcePropery and GetMultipleResourceProperties method.

set-rp-pdp-config

Property that should be configured with a file containing authorization policy for access to SetResourceProperty method.

The format of the configuration files should be as follows:

subjectDN=qName1;qName2;qName3

All equal to signs and space in Subject DN should be escaped using backslash.

For example, if the set resource properties policy is defined as follows:

/C\=US/O\=Globus\ Alliance/OU\=User/CN\=101497d3dcd.3dcd5aef=\
{http://www.globus.org/tests/security}booleanVal;{http://www.globus.org\
/tests/security}intVal1

[Above should be a single line without any spaces. Spaces provided here for document formatting] This implies that subject DN "/C=US/O=Globus Alliance/OU=User/CN=101497d3dcd.3dcd5aef" can set value of the RPs {http://www.globus.org/tests/security}booleanVal and {http://www.globus.org/tests/security}intVal1

7.4. Decision Table

Policy for set RP and get RP not configured Initialize Exception
Erroneous configuration file INDETERMINATE
Missing parameter value attribute INDETERMINATE
No policy for user to access requested resource property. DENY
Policy found for user to access requested resource property.. PERMIT

7.5. Related interceptors

  • Default bootstrap interceptor (X509 Bootstrap PIP), is required to use this PDP.

  • Parameter PIP (Parameter PIP is required to use with this PDP to be able to collect information about the requested resource property. The ParameterPIP needs to be configured with the following :

    servicePath getMultipleResourceProperties{http://docs.oasis-open.org\
    /wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.xsd}\
    getMultipleResourceProperties
    
    servicePath getResourceProperty {http://docs.oasis-open.org/wsrf/2004/06/wsrf\
    -WS-ResourceProperties-1.2-draft-01.xsd}getResourceProperty
    
    servicePath setResourceProperties {http://docs.oasis-open.org/wsrf/2004/06/wsrf\
    -WS-ResourceProperties-1.2-draft-01.xsd}SetResourceProperties
    

    [Above should be a single line without any spaces. Spaces provided here for document formatting]

    The servicePath needs to be replaced with the service endpoint that required resource property access to be authorized based on parameters.

8. SAML Authorization Callout

8.1. Class name

org.globus.wsrf.impl.security.authorization.SAMLAuthorizationCallout

8.2. Overview

This PDP can be used to talk to any authorization service that implements the OGSA AuthZ interface. The steps involved include:

  1. Secure call is made to the authorization service

  2. Secure response is expected

  3. Identity of soap message siganture or tls connection is established

  4. If response is signed, identity of response signature is established.

  5. Issuer identity is determined from authz service is 4 or 5, in that order

  6. If there are any errors constructing request,contacting authz service or parsing response, an indeterminate decision is issued by container

  7. Response signature is verified.

  8. Every assertion in the response is verified to be issued by issuer identity (point 5)

  9. If any of the statement is not a permit on the particular subject, resource, action, a deny is returned by issuer identity. Otherwise a permit is returned.

  10. In the future, a delegation step from the issuer identity (in 5) to some other issuers could be set as policy on SAMLAuthzCallout to establish a chain.

8.3. Configuration

authzService

Property that points to the authorization service to contact. The value should be a URL.

securityMechanism

Property that indicates the security mechanism to use to contact authorization service. Should be either "msg" for GSI Secure Message or "conv" for GSI Secure Conversation. If authorization service URL container "https" as protocol, GSI Secure Transport is used to contact the authorization service.

protectionLevel

Property that indicates the protection level to use to contact the authorization service. Should be either "sig" for signature and "enc" for encryption.

authzServiceCertificate

Property that points to the authorization service public certificate file. This property is required only if "securityMechanism" is GSI Secure Message and "protectionLevel" is encryption.

authzServiceIdentity

Property that has the expected identity of the authorization service. This is used for authorizing the call to authorization service.

samlAuthzSimpleDecision

Property indicates if SimpleAuthorizationDecisionStatement as defined in OGSA AuthZ specification is being requested from the authorization service.

8.4. Decision Table

Error constructing local SAML data types. INDETERMINATE
Error converting EPR to stringINDETERMINATE
Error signing SAML RequestINDETERMINATE
Error accessing configured authorization service INDETERMINATE
Null response from configured authorization service INDETERMINATE
SAML exception from configured authorization service INDETERMINATE
SAML Response signed by identity different from expected identity ofconfigured authorization service INDETERMINATE
If decision returned from service is anything other than permit.DENY
If decision returned from service is permit.PERMIT

8.5. Related interceptors

No interceptors are related other than the default bootstrap interceptor (X509 Bootstrap PIP), which is required to be used with this PDP.

9. SAML Authorization Assertion PDP

9.1. Class name

org.globus.wsrf.impl.security.authorization.SAMLAuthzAssertionPDP

9.2. Overview

This PDP parses and enforces any SAML Authorization Decision Statements that are a part of the requester's attribute bag. Typically SAMLAuthzAssertionPIP is used in tandem with this PDP to collect those attributes.

The PDP expects the service name as SAML Resource and the operation name as action.

9.3. Configuration

No configuration is required.

9.4. Decision Table

No requester attributes NOT_APPLICABLE
No resource attributesINDETERMINATE
No action attributesINDETERMINATE
If atleast one of the SAML Decision statement is permit for access to said resource and actionPERMIT
If none of the SAML Decision statement is permit for access to said resource and actionDENY

9.5. Related interceptors

  • Default bootstrap interceptor (X509 Bootstrap PIP), is required to use this PDP.

  • SAML Authorization Assertion PIP (SAMLAuthzAssertPIP is required to use with this PDP to be able to collect SAML Authorization Assertions that are sent in as a part of the request.

10. Self Authorization

10.1. Class name

org.globus.wsrf.impl.security.authorization.SelfAuthzPDP

10.2. Overview

This PDP does self authorization and expects the peer subject to match the local subject, which is the current JAAS Subject associated with the service/resource. The current JAAS subject is determined by the value of the run-as element in the service security descriptor (see Configuring run-as mode).

10.3. Configuration

No configuration is required

10.4. Decision Table

No peer subject DENY
No local subjectINDETERMINATE
Peer subject matches local subjectPERMIT
Peer subject does not match local subjectDENY

10.5. Related interceptors

No interceptors are related other than the default bootstrap interceptor (X509 Bootstrap PIP), which is required to be used with this PDP.

11. Username Authorization

11.1. Class name

org.globus.wsrf.impl.security.authorization.UsernameAuthzPDP

11.2. Overview

Uses Java Login module to authorize based on user name and password used on the method call. The username and password are passed to the Login module using javax.security.auth.callback.NameCallback and javax.security.auth.callback.PasswordCallback.

Username authorization as part of the authorization framework for a service involves setting up a Configuration class that reads in the Login Module to be using. It is also possible to specify the login modules to be used by altering some parameters in the java.security file located at $JAVA_HOME/jre/lib/security which has been discussed under the general configuration section. Steps for username authorization using Login Modules configured via custom Configuration classes is described under the custom configuration section.

11.3. Configuration

Login modules can be setup for use by our application in two different ways. One, by adding the login module to the list of login modules used by the JVM. This method has been explained under the JVM Configuration. Second, by creating a custom configuration class to dynamically pick up the login module.

11.3.1. JVM Configuration

Some login module and configuration file needs to be configured (example: jre/lib/ext/jaasmod.jar and jre/lib/security/java.security). A sample configuration entry:

login.configuration.provider=com.sun.security.auth.login.ConfigFile 
login.config.url.1=file:${java.home}/lib/security/jaas.config

Sample jaas.config file:

Login {
	com.sun.security.auth.module.NTLoginModule required;
};

11.3.2. Custom Configuration

A configuration class is used to setup a specified login module for executing authorization. The class details are provided to the Toolkit through the security descriptor for the service that enforces username auhorization. In order for the username authorization handler to use a custom Login Configuration, a parameter with name "login-config" and a value containing the custom Configuration classname has to be specified along with the PDP in the security descriptor. The PDP in this case is "Username Authorization". The relevant snippet from the service security descriptor is shown below:

    <authzChain>
	<pdps>
        <interceptor name="prefix:org.globus.wsrf.impl.security.authorization.UsernameAuthzPDP">
	  <parameter>
	     <param:nameValueParam>
	     <param:parameter name="login-config" value="org.globus.wsrf.impl.security.authorization.LoginConfiguration"/>
	     </param:nameValueParam>
	  </parameter>
	</interceptor>			
	</pdps>
    </authzChain>

[Note]Internal Details

The usernameAuthorization PDP loads the Configuration specified in the parameter "login-config" and sets that as the current configuration.(These are internal details which may be disregarded safely for the purposes of writing up a custom configuration) org.globus.wsrf.impl.security.authorization.UsernameAuthzPDP

		String className = (String) this.chainConfig.getProperty(this.prefix, "login-config");
		Class config = ClassLoaderUtils.forName(className); 
		Object loginConfig = config.newInstance();
		if(loginConfig instanceof Configuration ){
		  Configuration.setConfiguration((Configuration) loginConfig);
		}
		

The custom Configuration class has to be a subclass of javax.security.auth.login.Configuration. An example custom Configuration class is available in the unit tests directory at org.globus.wsrf.impl.security.authorization.LoginConfiguration. The login module that has to be used is specified using a login.config file that the configuration class uses. The configuration class loads the appropriate properties from this file. A sample entry for this file is:

	Login {
	   org.globus.wsrf.impl.security.authorization.UsernameLoginModule required;
	};
	

More details regarding Login Configuration files can be found here. The next section focuses on the setup and usage of login modules.

11.4. Login Modules

The login modules can be used to handle the authorization of users. The details regarding writing login modules is beyond the scope of this document and can be found at in the Login Module Developers' guide

The unit tests have an example of a login module org.globus.impl.security.authorization.UsernameLoginModule. The username and password to authorize the client have to be passed via the client security descriptor similar to the one listed below. If the password type is not provided then it defaults to PasswordText. In that case, the passwords are sent unencrypted over the wire.

     <clientSecurityConfig xmlns="http://www.globus.org/security/descriptor/client">
       <GSISecureTransport>
      	 <integrity/>
       </GSISecureTransport> 

       <usernameType>
      	 <username value="globus"/>
      	   <passwordType>
              <password value="unittesting"/>
              <type value="http://docs.oasis open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest"/>
           </passwordType>
       </usernameType> 

       <authz value="none"/>

        </clientSecurityConfig>

This login module handles the authorization of usernames and passwords supplied either as Text (unencrypted format) or as a Digest (encrypted format.) by comparing them to the username and password stored on the server in a file. The format of the parameters in the password file used by our example Login Module is illustrated in the following example. ~/tests/unit/etc/Test-authz-pwd

name=globus
password=unittesting
usernames=globus

In summary, Login Modules can be used to implement username authorization. This can be done by either changing the java environment to invoke your login module or by programmatically setting the authorization framework to use your login module. The unit tests provide a good example of how this can be done programmatically which in most cases would prove beneficial.

11.5. Decision Table

If no error is returned from Login module PERMIT

11.6. Related interceptors

None.

PIP Reference

1. Introduction

[fixme - what are PIPs]

If you have a PIP you'd like to contribute to the Globus Toolkit, use the following template:

[Note]Note

The above files are in DocBook XML format. Simply save the link to your hard drive, edit the file in a text or xml editor and email to ?. Don't worry about getting the tags exactly right, it's enough to enter the information where it makes sense and we'll clean up the tags where necessary.

2. Container PIP

2.1. Class name

org.globus.wsrf.impl.security.authorization.ContainerPIP

2.2. Overview

This implements the BootstrapPIP interface [fixme link to PIP in glossary] and is used with in the toolkit to initialize the request entities. It collects information about the service and operation invoked. It is always invoked prior to any authorization processing.

2.3. Configuration

No configuration is required.

2.4. Attributes Collected

This PIP collects three attributes described in the following tables:

Table 1. Attribute I

Description of attributeMessage Context associated with the thread
Identity attributeIdentity attribute
Attribute IDConstants.MSG_CTX_ATTRIBUTE_URI
DatatypeConstants.MSG_CTX_DATATYPE_URI
Issuernull. The issuer is null since the message context is required to construct the container entity, which is the default issuer for attributes collected in the container.
Validity fromCurrent time
Validity toInfinity

Table 2. Attribute II

Description of attributeURL of the service invoked.
Identity attributeIdentity attribute
Attribute IDConstants.SERVICE_ATTRIBUTE_ID_URI
DatatypeConstants.STRING_DATATYPE_URI
IssuerContainer
Validity fromCurrent time
Validity toInfinity

Table 3. Attribute III

Description of attributeName of the operation invoked.
Identity attributeIdentity attribute
Attribute IDConstants.OPERATION_ATTRIBUTE_ID_URI
DatatypeConstants.STRING_DATATYPE_URI
IssuerContainer
Validity fromCurrent time
Validity toInfinity

This PIP also sets up the container issuer entity, which is used as the default issuer for attributes collected in the container. The entity has the following attributes:

Table 4. Attribute I

Description of attributeContainer id
Identity attributeIdentity attribute
Attribute IDConstants.CONTAINER_ATTRIBUTE_URI
DatatypeConstants.STRING_DATATYPE_URI
Issuernull
Validity fromCurrent time
Validity toInfinity

Table 5. Attribute II

Description of attributeJava Principals from container credential, only if credentials are configured.
Identity attributeIdentity attribute
Attribute IDConstants.PRINCIPAL_ATTRIBUTE_ID
DatatypeConstants.PRINCIPAL_DATATYPE_URI
Issuernull
Validity fromCurrent time
Validity toInfinity

Table 6. Attribute III

Description of attributeJava Subject from container credential, only if credentials are configured.
Identity attributeIdentity attribute
Attribute IDConstants.SUBJECT_ATTRIBUTE_ID
DatatypeConstants.SUBJECT_DATATYPE_URI
Issuernull
Validity fromCurrent time
Validity toInfinity

The container entity is created with the same attributes as above with the above entity as the issuer.

2.5. Related interceptors

None.

3. X509Bootstrap

3.1. Class name

org.globus.wsrf.impl.security.authorization.X509BootstrapPIP

3.2. Overview

This implements the BootstrapPIP interface [fixme PIP-glossary] which is used when X509 Certificates are used during authentication scheme. It collects peer entities' attributes obtained from the certificates presented by the peer.

3.3. Configuration

No configuration is required.

3.4. Attributes Collected

This PIP collects two attributes described in the following tables:

Table 7. Attribute I

Description of attributePeer's Subject object
Identity attributeIdentity attribute
Attribute IDConstants.SUBJECT_ATTRIBUTE_ID
DatatypeConstants.SUBJECT_DATATYPE_URI
IssuerContainer Issuer Entity
Validity fromCurrent time
Validity toInfinity

Table 8. Attribute II

Description of attributePeer's principals
Identity attributeIdentity attribute
Attribute IDConstants.PRINCIPAL_ATTRIBUTE_ID
DatatypeConstants.PRINCIPAL_DATATYPE_URI
IssuerContainer Issuer Entity
Validity fromCurrent time
Validity toInfinity

3.5. Related interceptors

If X509 Certificates are used for authentication, this bootstrap is used by the Authorization Framework by default.

4. SAML Authorization Assertion PIP

4.1. Class name

org.globus.wsrf.impl.security.authorization.SAMLAuthzAssertionPIP

4.2. Overview

The PIP extracts SAML Authorization Assertion from the request and adds it to the bag of attributes. The message context and the proxy certificate are checked to see if SAML Authorization Assertions are presents.

If the subject DN in the decision statement matches with the requestor's then the attribute is merged with the requestor's bag of attributes.

4.3. Configuration

No configuration information is required.

4.4. Attributes Collected

This PIP collects attributes described in the following tables:

Table 9. Attribute I

Description of attributeSubject DN from the subject in SAML Authorization Decision Statement (one attribute per statement in assertion)
Identity attributeIdentity attribute
Attribute IDConstants.PRINCIPAL_ATTRIBUTE_ID
DatatypeConstants.PRINCIPAL_DATATYPE_URI
IssuerContainer Issuer Entity
Validity fromExtracted from assertion
Validity toExtracted from assertion

Table 10. Attribute II

Description of attributeSAML Authoirzation Decision Statement (one attribute per statement in assertion)
Identity attributeNon-Identity attribute
Attribute IDConstants.SAML_AUTHZ_DECISION_ATTRIBUTE_ID
DatatypeConstants.SAML_AUTHZ_DECISION_DATA_TYPE
IssuerContainer Issuer Entity
Validity fromExtracted from assertion
Validity toExtracted from assertion

4.5. Related interceptors

This PIP can be used in tandem with SAMLAuthzAssertionPDP.

5. Parameter PIP

5.1. Class name

org.globus.wsrf.impl.security.authorization.ParameterPIP

5.2. Overview

This PIP extracts configured parameter element from the SOAPMessage. The parameter is added as an action attributes in the associated RequestAttribute.

5.3. Configuration

parameterConfig

Property pointing to configuration file with information about the service, method and parameter to extract as attributes. If configured file name is not absolute, an attempt is made to find the file as provided, if not an attempt is made to locate it relative to GLOBUS_LOCATION and if that fails, an attempt it made to locate it relative to current directory.

The configuration file is read and stored as SOAPParameter. This class is used to store a specific parameter element path for a given operation for a said service. servicePath operationName ParameterPath

The parameter path is a list of QNames, where each QName is QName of a child element of previous QName element. The parameterPath is a string with string representation of each QName, in the order it needs to be looked into with semicolon (;) as delimiter. For example, {http://temp.ns}element1;{http://temp.ns}nextElem2;{http://temp.ns}nextElem3 would represent the parameter {http://temp.ns}nextElem3. The SOAPBody element here is {http://temp.ns}element1, with nextElem2 as its child and nextElem3 as its child.

5.4. Attributes Collected

This PIP collects two attributes described in the following tables:

Table 11. Attribute I

Description of attributeConfigured parameter if it occurs in that operation. The value is an object of type org.w3c.dom.Node and represents the parameter of the operation.
Identity attributeIdentity attribute
Attribute IDParameter path as described in previous section.
DatatypeConstants.PARAMETER_PATH_DATA_TYPE
IssuerContainer Issuer Entity
Validity fromCurrent time
Validity toInfinity

5.5. Related interceptors

This PIP can be used in tandem with ResourcePropertiesPDP to parameter-based authorization for resource property access.

Configuring

Abstract

Java WS A&A is configured using security descriptors. The following describes configuration settings specific for authorization and authentication. You can read the entire Java WS A&A Security Descriptor documentation here.

1. Configuring authorization

1.1. Configuration overview

Security descriptors are mechanisms used to configure authorization mechanism and policy. The authorization on the server side can be configured at the container, service or resource level.

On the client side, authorization can be configured using security descriptors or as a property on the stub. This configuration can be done on a per invocation granularity

1.2. Server side authorization

The server side authorization can be configured at the container, service or resource level using

To write and configure a server-side custom authorization mechanism refer to Section 2.3, “Writing a custom server-side authorization mechanism”.

1.3. Client side authorization

The client side authorization can be configured for each invocation.

To write and configure custom authorization mechanism refer to Section 2.2, “Writing custom client-side authorization scheme”.

If no authorization mechanism has been specified, HostOrSelf authorization is used. In this scheme host authorization is tried first, if it fails, self authorization is attempted

2. Configuring authentication/message protection

2.1. Configuration overview

Configuration of service-side security settings can be achieved by using container or service security descriptor. Some of the security configuration, like the credential to use and trusted certificates location, can also be configured using CoG properties or rely on default location. The preferred way is to provide these settings in a security descriptor.

The next section provides details on the relevant properties. An overview of the syntax of security descriptors can be found in Java WS A&A Security Descriptor Framework. Available CoG security properties can be found in Configuring

2.2. Syntax of the interface

The following properties are relevant to authentication and message/transport security:

Table 1. Configuring server side authentication and message/transport security

NumberTask Descriptor Configuration Alternate Configuration
1CredentialsContainer or service descriptor configuration

If no explicit configuration is found, the default proxy is read from /tmp/x509_up_<uid>.

2Trusted CertificatesContainer security descriptor configurationCoG Configuration
3Limited proxy policy configurationContainer or service descriptor configurationNone.
4Replay Attack WindowContainer or service descriptor configurationNone.
5Replay Attack FilterContainer or service descriptor configurationNone.
6Replay timer intervalContainer descriptor configurationNone.
7Context timer intervalContainer descriptor configurationNone.

Environment variable interface

1. Environmental variables for WS Authentication & Authorization (Java)

Refer to Configuring for environment variables. Note that the above environment variables do not supersede any settings provided in security descriptors.

Appendix A. Errors

Table A.1. Java WS A&A Errors

Error CodeDefinitionPossible Solutions
[JWSSEC-248] Secure container requires valid credentialsThis error occurs when globus-start-container is run without any valid credentials. Either a proxy certificate or service/host certificate needs to be configured for the container to start up.
  1. If you are not looking to start up a container that uses GSI Secure Transport, which is used by the container by default, use globus-start-container -nosec. You will be able to use insecure clients and services. However, this also implies that if you have not configured individual services with credentials, you will not be able to securely access the service.

  2. If you are running a personal container, generate a proxy certificate with grid-proxy-init. If the proxy certificate is not in the default location, configure the container security descriptor as described in Configuring Container Security Descriptor.

  3. If you want to use host certificates, configure the container security descriptor as described Configuring Credentials.

Failed to start container: Container failed to initialize [Caused by: [JWSSEC-250] Failed to load certificate/key file]This error occurs if the file path to the container certificate and key configured are invalid.
  1. The path to the container certificate and key are configured in $GLOBUS_LOCATION/etc/globus_wsrf_core/ global_security_descriptor.xml. This file is loaded as described [here - fixme link]. Ensure that the path is correct.

Failed to start container: Container failed to initialize [Caused by: [JWSSEC-249] Failed to load proxy file]This error occurs if container proxy file configured is invalid.
  1. The path to the container proxy certificates are configured in $GLOBUS_LOCATION/etc/globus_wsrf_core/ global_security_descriptor.xml. This file is loaded as described [here - fixme link]. Ensure that the path is correct.

Failed to start container: Container failed to initialize [Caused by: [JWSSEC-245] Error parsing file: "etc/globus_wsrf_core/ global_security_descriptor.xml" [Caused by: ...]This error occurs if the container security descriptor configured is invalid.
  1. The container security descriptor should conform to the Container Security Descriptor Schema.

  2. Refer to the "Caused by: " section for details on the specific element that is not correct.

[JGLOBUS-77] Unknown CAThis error occurs if the CA certificate for the credentials being used is not installed correctly.
  1. If this issue occurs on the server side, the container is not configured with CA certificates. The container looks for trusted certificates in the default location as described Java CoG Toolkit FAQ

  2. On the server side, the trusted certificates can be configured as described in Trusted Certificates

  3. On the client side, trusted certificates can be configured as described in Configuring Trusted Credentials

Glossary

P

public key

The public part of a key pair used for cryptographic operations (e.g. signing, encrypting).