org.jasig.cas.client.proxy
Class AbstractEncryptedProxyGrantingTicketStorageImpl

java.lang.Object
  extended by org.jasig.cas.client.proxy.AbstractEncryptedProxyGrantingTicketStorageImpl
All Implemented Interfaces:
ProxyGrantingTicketStorage

public abstract class AbstractEncryptedProxyGrantingTicketStorageImpl
extends Object
implements ProxyGrantingTicketStorage

Provides encryption capabilities. Not entirely safe to configure since we have no way of controlling the key and cipher being set.

Since:
3.2.0
Version:
$Revision$ $Date$
Author:
Scott Battaglia

Field Summary
static String DEFAULT_ENCRYPTION_ALGORITHM
           
 
Constructor Summary
AbstractEncryptedProxyGrantingTicketStorageImpl()
           
 
Method Summary
 String retrieve(String proxyGrantingTicketIou)
          Method to retrieve a ProxyGrantingTicket based on the ProxyGrantingTicketIou.
protected abstract  String retrieveInternal(String proxyGrantingTicketIou)
           
 void save(String proxyGrantingTicketIou, String proxyGrantingTicket)
          Method to save the ProxyGrantingTicket to the backing storage facility.
protected abstract  void saveInternal(String proxyGrantingTicketIou, String proxyGrantingTicket)
           
 void setCipherAlgorithm(String cipherAlgorithm)
          Note: you MUST call this method before calling setSecretKey if you're not using the default algorithm.
 void setSecretKey(Key key)
           
 void setSecretKey(String key)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jasig.cas.client.proxy.ProxyGrantingTicketStorage
cleanUp
 

Field Detail

DEFAULT_ENCRYPTION_ALGORITHM

public static final String DEFAULT_ENCRYPTION_ALGORITHM
See Also:
Constant Field Values
Constructor Detail

AbstractEncryptedProxyGrantingTicketStorageImpl

public AbstractEncryptedProxyGrantingTicketStorageImpl()
Method Detail

setSecretKey

public final void setSecretKey(String key)
                        throws NoSuchAlgorithmException,
                               InvalidKeyException,
                               InvalidKeySpecException
Throws:
NoSuchAlgorithmException
InvalidKeyException
InvalidKeySpecException

setSecretKey

public final void setSecretKey(Key key)

setCipherAlgorithm

public final void setCipherAlgorithm(String cipherAlgorithm)
Note: you MUST call this method before calling setSecretKey if you're not using the default algorithm. You've been warned.

Parameters:
cipherAlgorithm - the cipher algorithm.

save

public final void save(String proxyGrantingTicketIou,
                       String proxyGrantingTicket)
Description copied from interface: ProxyGrantingTicketStorage
Method to save the ProxyGrantingTicket to the backing storage facility.

Specified by:
save in interface ProxyGrantingTicketStorage
Parameters:
proxyGrantingTicketIou - used as the key
proxyGrantingTicket - used as the value

retrieve

public final String retrieve(String proxyGrantingTicketIou)
Description copied from interface: ProxyGrantingTicketStorage
Method to retrieve a ProxyGrantingTicket based on the ProxyGrantingTicketIou. Note that implementations are not guaranteed to return the same result if retrieve is called twice with the same proxyGrantingTicketIou.

Specified by:
retrieve in interface ProxyGrantingTicketStorage
Parameters:
proxyGrantingTicketIou - used as the key
Returns:
the ProxyGrantingTicket Id or null if it can't be found

saveInternal

protected abstract void saveInternal(String proxyGrantingTicketIou,
                                     String proxyGrantingTicket)

retrieveInternal

protected abstract String retrieveInternal(String proxyGrantingTicketIou)


Copyright © 2006-2011 Jasig. All Rights Reserved.