uk.ac.soton.itinnovation.grid.comms.wstrust
Class WSTrustUtils

java.lang.Object
  extended by uk.ac.soton.itinnovation.grid.comms.wstrust.WSTrustUtils

public class WSTrustUtils
extends Object

Useful methods for dealing with WS-Trust services.


Constructor Summary
WSTrustUtils()
           
 
Method Summary
static Document createIssuanceResponse(String resourceID, X509Certificate user, int expiryTime, Key privateKey, URL serviceAddress)
          Create the WS-Trust response document for token issuance (containing a SAML assertion).
static Element createTokenSourcePolicy(org.apache.axis.message.addressing.EndpointReferenceType sourceEPR)
           
static Document createValidationResponse(String code, String reason)
          Create a RequestSecurityTokenResponse for a status validation.
static void ensureValidationSuccessful(Document response)
          Process a WS-Trust validation response.
static Element getSecurityTokenFromResponse(Document requestSecurityTokenResponse)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WSTrustUtils

public WSTrustUtils()
Method Detail

createIssuanceResponse

public static Document createIssuanceResponse(String resourceID,
                                              X509Certificate user,
                                              int expiryTime,
                                              Key privateKey,
                                              URL serviceAddress)
Create the WS-Trust response document for token issuance (containing a SAML assertion).

Parameters:
resourceID - the UUID of the membership group
user - the certificate of the user we are making the assertion about
expiryTime - how long the token is valid till (milliseconds)
privateKey - the private key of the service making the assertion
serviceAddress - the address of the service making the assertion

createValidationResponse

public static Document createValidationResponse(String code,
                                                String reason)
Create a RequestSecurityTokenResponse for a status validation.

Parameters:
code - should be WSTrust.WSTRUST_STATUS_VALID or WSTrust.WSTRUST_STATUS_INVALID
reason - a human-readable reason, or null
Returns:
a RequestSecurityTokenResponse

ensureValidationSuccessful

public static void ensureValidationSuccessful(Document response)
                                       throws TokenInvalidException
Process a WS-Trust validation response.

Parameters:
response - from a validation operation
Throws:
TokenInvalidException - if the response code is not WSTrust.WSTRUST_STATUS_VALID

getSecurityTokenFromResponse

public static Element getSecurityTokenFromResponse(Document requestSecurityTokenResponse)

createTokenSourcePolicy

public static Element createTokenSourcePolicy(org.apache.axis.message.addressing.EndpointReferenceType sourceEPR)


Copyright © 2001-2008 University of Southampton IT Innovation Centre. All Rights Reserved.