PAJES 2.3.9

org.pajes.security
Class QueryParameters

java.lang.Object
  extended byorg.pajes.security.QueryParameters
All Implemented Interfaces:
java.io.Serializable

public class QueryParameters
extends java.lang.Object
implements java.io.Serializable

Table to hold query parameters in the session.

See Also:
Serialized Form

Field Summary
static java.lang.String QUERY_STRING_PARAMETER_NAME
          The name of the query string parameter that will contain a pointer to a single encrypted query string value.
 
Method Summary
static java.lang.String[] decrypt(java.lang.String[] encryptedValues, javax.servlet.http.HttpSession session)
          Accepts an array of encrypted values and returns an array of the query string parameters that were encrypted using encrypt(java.lang.String, javax.servlet.http.HttpSession).
static java.lang.String decrypt(java.lang.String encryptedValue, javax.servlet.http.HttpSession session)
          Accepts an encrypted value and returns the query string that was encrypted using encrypt(java.lang.String, javax.servlet.http.HttpSession).
static java.lang.String encrypt(java.lang.String url, javax.servlet.http.HttpSession session)
          Accepts an URL and returns it with any parameters encrypted.
static QueryParameters get(javax.servlet.http.HttpSession session)
          Returns the QueryParameters object from the Session, or if it does not exist, creates a new one.
static QueryParameters get(javax.servlet.http.HttpSession session, javax.servlet.ServletContext context)
          Returns the QueryParameters object from the Session, or if it does not exist, creates a new one.
 boolean isEncryptionEnabled()
          Determines whether this QueryParameters instance will encrypt query parameters or not.
 void setEncryptionEnabled(boolean enabled)
          Determines whether this QueryParameters instance will encrypt query parameters or not.
 java.lang.String toString()
          Over-rides toString() from Object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

QUERY_STRING_PARAMETER_NAME

public static final java.lang.String QUERY_STRING_PARAMETER_NAME
The name of the query string parameter that will contain a pointer to a single encrypted query string value.

See Also:
Constant Field Values
Method Detail

decrypt

public static java.lang.String decrypt(java.lang.String encryptedValue,
                                       javax.servlet.http.HttpSession session)
                                throws java.io.IOException
Accepts an encrypted value and returns the query string that was encrypted using encrypt(java.lang.String, javax.servlet.http.HttpSession).

Parameters:
encryptedValue - the value to be decrypted.
session - the user's session.
Returns:
the query string.
Throws:
java.io.IOException - if an I/O error occurs.

decrypt

public static java.lang.String[] decrypt(java.lang.String[] encryptedValues,
                                         javax.servlet.http.HttpSession session)
                                  throws QueryParametersDecryptionException
Accepts an array of encrypted values and returns an array of the query string parameters that were encrypted using encrypt(java.lang.String, javax.servlet.http.HttpSession).

Parameters:
encryptedValues - the array of values to be decrypted.
session - the user's session.
Returns:
an array of decrypted query parameters.
Throws:
QueryParametersDecryptionException - if an encrypted value cannot be decoded.

encrypt

public static java.lang.String encrypt(java.lang.String url,
                                       javax.servlet.http.HttpSession session)
Accepts an URL and returns it with any parameters encrypted.

Note that if the Browser.USE_ENCRYPTED_QUERY_PARAMETERS_ATTRIBUTE in the web application deployment descriptor is missing of false, the parameters will NOT be encrypted, unless encryption is explictly turned on in the QueryParameters object retrieved from the HttpSession.

The parameters will be automatically decrypted by PajeServlet.

Parameters:
url - the URL to be secured.
session - the user's session.
Returns:
the updated URL.

get

public static QueryParameters get(javax.servlet.http.HttpSession session)
Returns the QueryParameters object from the Session, or if it does not exist, creates a new one.

Parameters:
session - the user's session.
Returns:
the QueryParameters object.

get

public static QueryParameters get(javax.servlet.http.HttpSession session,
                                  javax.servlet.ServletContext context)
Returns the QueryParameters object from the Session, or if it does not exist, creates a new one.

Parameters:
session - The user's session.
context - The servlet context to determine whether encryption is enabled or not, if a new QueryParameters object is created.
Returns:
the QueryParameters object.

setEncryptionEnabled

public void setEncryptionEnabled(boolean enabled)
Determines whether this QueryParameters instance will encrypt query parameters or not.

Parameters:
enabled - true if encryption is enabled.

isEncryptionEnabled

public boolean isEncryptionEnabled()
Determines whether this QueryParameters instance will encrypt query parameters or not.

Returns:
true if encryption is enabled.

toString

public java.lang.String toString()
Over-rides toString() from Object.

Returns:
a String representation of this object.

PAJES 2.3.9

Copyright © 2002-2003 Viridian Pty Limited. All Rights Reserved.