com.waveset.object
Class Keychain

java.lang.Object
  extended bycom.waveset.object.Keychain

public class Keychain
extends java.lang.Object

A class that encapsulates an SSO keychain. This will contain a list of PrivateKey objects. An instance of this class may be found on both a WSUser object and the UserInfo object.


Field Summary
static java.lang.String code_id
           
static java.lang.String ELEMENT
           
 
Constructor Summary
Keychain()
           
Keychain(org.w3c.dom.Element e)
           
 
Method Summary
 void addPrivateKey(int index, PrivateKey info)
          Add information about a private key.
 void addPrivateKey(PrivateKey info)
          Add a private key to the end of the keychain.
 void clearPrivateKeys()
          Remove all the private key objects from the user.
 PrivateKey getPrivateKey(int index)
          Return a key by number.
 PrivateKey getPrivateKey(java.lang.String url)
          Return the a private key associated with this url.
 PrivateKey[] getPrivateKeys()
          Return the array of PrivateKey objects.
 void movePrivateKey(int oldIndex, int newIndex)
          Moves and existing Private Key from the old index to the new index in the ordered list of keys
 void parseXml(org.w3c.dom.Element e)
           
 void removePrivateKey(int index)
          Remove the information for one private key at the specified index
 void removePrivateKey(PrivateKey key)
          Remove the information for one private key.
 void setPrivateKeys(java.util.List keys)
          Replace all the keys.
 void setPrivateKeys(PrivateKey[] keys)
          Replace all the keys.
 void toXml(java.lang.StringBuffer b, int indent)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

code_id

public static final java.lang.String code_id
See Also:
Constant Field Values

ELEMENT

public static final java.lang.String ELEMENT
See Also:
Constant Field Values
Constructor Detail

Keychain

public Keychain()

Keychain

public Keychain(org.w3c.dom.Element e)
         throws WavesetException
Method Detail

getPrivateKeys

public PrivateKey[] getPrivateKeys()
Return the array of PrivateKey objects.


setPrivateKeys

public void setPrivateKeys(PrivateKey[] keys)
Replace all the keys.


setPrivateKeys

public void setPrivateKeys(java.util.List keys)
Replace all the keys.


getPrivateKey

public PrivateKey getPrivateKey(int index)
Return a key by number.


getPrivateKey

public PrivateKey getPrivateKey(java.lang.String url)
                         throws WavesetException
Return the a private key associated with this url. A key will be returned using the following match algorithm. 1) look for exact match on the specified url, if not found 2) start at first private key looking for "best" match (using regular expression matching) on the specified url. This function supports the ability to have unique keys for apps requiring different logins within the same domain.

jsl - I took out partial matching, need more thought here...

Throws:
WavesetException

addPrivateKey

public void addPrivateKey(int index,
                          PrivateKey info)
                   throws WavesetException
Add information about a private key. Note that the name in a private key can include wildcards (e.g. /www.waveset.com/*) In addition, the caller will specify the index they want the private key stored at. Order will determine what "best match" means when getting a private key by name

Index values start at 0 and go to 'n'. Index may be equal to current length to append to the end.

Throws:
WavesetException

addPrivateKey

public void addPrivateKey(PrivateKey info)
                   throws WavesetException
Add a private key to the end of the keychain.

Throws:
WavesetException

movePrivateKey

public void movePrivateKey(int oldIndex,
                           int newIndex)
                    throws WavesetException
Moves and existing Private Key from the old index to the new index in the ordered list of keys

Index values start at 0 and go to 'n'.

Throws:
WavesetException

removePrivateKey

public void removePrivateKey(int index)
Remove the information for one private key at the specified index


removePrivateKey

public void removePrivateKey(PrivateKey key)
Remove the information for one private key.


clearPrivateKeys

public void clearPrivateKeys()
Remove all the private key objects from the user.


parseXml

public void parseXml(org.w3c.dom.Element e)
              throws WavesetException
Throws:
WavesetException

toXml

public void toXml(java.lang.StringBuffer b,
                  int indent)