com.novell.ecb.secretstore
Class SharedValue

java.lang.Object
  |
  +--com.novell.ecb.secretstore.SharedValue
All Implemented Interfaces:
java.io.Serializable

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

Represents the value of a SharedSecret object. This is a convenience object used by CreateSecret and ReadSecret beans. This object encodes all the keys and values in 16-bit Little Endian Unicode as mandated by SharedSecret format.

SharedSecret value consists of key-value pairs in the following format: [key][delimiter][value][linefeed]...[key][delimiter][value][linefeed][null]

The total size of all the pairs togather cannot exceed 60 KB. Keys are treated as case-ignore strings; in values, case is honored. No duplicate keys may exist. Duplicate values are allowed. Duplicate values should be discarded by SSO apps, if they are encountered. Following are the reserved characters, Backslash('\'), Colon(':'), Equals('='), Linefeed (0x0A) and Null terminator (0x00). All reserved characters used in the key or value must be escaped. Linefeed (0x0A) and Null terminator (0x00) are not allowed as part of key or value.

Version:
1.0
See Also:
ReadSecret, CreateSecret, Serialized Form

Constructor Summary
SharedValue()
          Constructs a SharedValue object.
 
Method Summary
 void addValue(java.lang.String key, java.lang.String value)
          Adds a key value pair to the SharedValue.
 java.lang.String[] getCredSetValues()
          Returns all the values for "SS_CredSet" key-value pair of the SharedValue.
 java.lang.String getValue(java.lang.String key)
          Returns the value from a key-value pair of the SharedValue.
 java.util.Iterator keys()
          Returns all the keys in the SharedValue including SS_CredSet key.
 void removeCredSetValues()
          Removes all the values for "SS_CredSet" key-value pairs from the SharedValue.
 void removeValue(java.lang.String key)
          Removes a key value pair with the key specified from the SharedValue.
 java.lang.String toString()
          Returns the SharedValue in the string format.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SharedValue

public SharedValue()
Constructs a SharedValue object.

Method Detail

addValue

public void addValue(java.lang.String key,
                     java.lang.String value)
Adds a key value pair to the SharedValue. There can't be multiple occurrences of the same key until unless it is "SS_CredSet" key.

Parameters:
key - key for a value.
value - a value in a SharedSecret.
Throws:
java.lang.IllegalArgumentException - if key is empty or null or if value is null.

removeValue

public void removeValue(java.lang.String key)
Removes a key value pair with the key specified from the SharedValue. Use removeCredSetValues() for removing SecretType.CREDENTIAL values.

Parameters:
key - key for a value.

removeCredSetValues

public void removeCredSetValues()
Removes all the values for "SS_CredSet" key-value pairs from the SharedValue.


getValue

public java.lang.String getValue(java.lang.String key)
Returns the value from a key-value pair of the SharedValue.

Parameters:
key - key for a value.
Returns:
String the value part of a pair. Returns null value, if key is SS_CredSet. Use getCredSetValue() for retrieving SS_CredSet values.

getCredSetValues

public java.lang.String[] getCredSetValues()
Returns all the values for "SS_CredSet" key-value pair of the SharedValue.

Returns:
String array of the values of SS_CredSet key-value pairs.

keys

public java.util.Iterator keys()
Returns all the keys in the SharedValue including SS_CredSet key. Presence of this key indicates the presence of SS_CredSet key-value pair.

Returns:
Iterator of the keys in the SharedValue.

toString

public java.lang.String toString()
Returns the SharedValue in the string format.

Overrides:
toString in class java.lang.Object
Returns:
String the SharedValue the following format: [key][delimiter][value][linefeed]...[key][delimiter][value][linefeed][null] .


Copyright © 2001-2003 Novell, Inc. All Rights Reserved.