All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class w3c.pics.parser.Label

java.lang.Object
   |
   +----w3c.pics.parser.Label

public class Label
extends Object
implements Serializable, Cloneable, DSigLabelInterface
A class that represents a single PICS label.


Variable Index

 o dsigparser

Constructor Index

 o Label()
Creates a new, empty Label.

Method Index

 o addMExtension(String, String)
Adds a mandatory extension to this Label.
 o addOExtension(String, String)
Adds an optional extension to this Label.
 o getCategory(String)
Returns the ratings for a particular category in this Label.
 o getFor()
Return the URL specified in the 'for' option of this label or null if none is present.
 o getMExtension(String)
Returns the requested one of the Label's mandatory extensions.
 o getOExtension(String)
Returns the requested one of the Label's optional extensions.
 o getOption(String)
Returns the requested one of the Label's options.
 o getRatings()
Returns all of the ratings in a Label.
 o getResInfo()
Get the DSig Resource Information (resinfo).
 o getService()
Returns the Service URL associated with this Label.
 o getSigBlock()
Get the DSig Signature Block (sigblock)
 o initDSig()
Parse the two DSig extension fields (resinfo and sigblock) out of the Label object.
 o setOption(String, String)
Changes the value of one of the Label's options.
 o setRating(String, Vector)
Changes the rating(s) for a particular category.
 o setResInfo(ResInfoExtension)
Set the DSig Resource Information (resinfo).
 o setService(String)
Changes the Service URL associated with this Label.
 o setSigBlock(SigBlockExtension)
Set the DSig Signature Block (sigblock)
 o sign(SignatureSuite, PrivateKey)
Sign the label using the appropriate private key class recognized by the signature suite.
 o toDSigString()
Returns a String containing the canonical PICS 1.1 representation of this Label, suitable for signing.
 o toExcludedDSigString(Hashtable)
Returns the canonicallized form of the DSig label with fields selectively included or excluded according the sigdata.
 o toString()
Returns a String containing the PICS 1.1 representation of this Label.
 o updateDSig()
The change made in ResInfo and SigBlock extension is not automatic; calling this method updates the original PICS1.1 Label and reflect the changes in resinfo and sigblock.
 o verify()
Verify the label using the user's default policy.
 o verifyAll()
Verify the complete Signature Label.

Variables

 o dsigparser
 public DSigParser dsigparser

Constructors

 o Label
 public Label()
Creates a new, empty Label.

Methods

 o getOption
 public String getOption(String optionName)
Returns the requested one of the Label's options.

Parameters:
optionName - The option to return.
Returns:
A String, the value of the option optionName
 o setOption
 public void setOption(String optionName,
                       String value)
Changes the value of one of the Label's options.

Parameters:
optionName - The option to change.
value - The new value.
 o addMExtension
 public void addMExtension(String exName,
                           String data)
Adds a mandatory extension to this Label.

Parameters:
exName - The name of the extension.
data - The extension data.
 o addOExtension
 public void addOExtension(String exName,
                           String data)
Adds an optional extension to this Label.

Parameters:
exName - The name of the extension.
data - The extension data.
 o getMExtension
 public String getMExtension(String exName)
Returns the requested one of the Label's mandatory extensions.

Parameters:
exName - The extension to return.
Returns:
A String, the data of the mandatory extension exName
 o getOExtension
 public String getOExtension(String exName)
Returns the requested one of the Label's optional extensions.

Parameters:
exName - The extension to return.
Returns:
A String, the data of the optional extension exName
 o getService
 public String getService()
Returns the Service URL associated with this Label.

Returns:
A String containing the Service URL.
 o setService
 public void setService(String serURL)
Changes the Service URL associated with this Label.

Parameters:
serURL - The new Service URL.
 o getRatings
 public Hashtable getRatings()
Returns all of the ratings in a Label.

Returns:
A Hashtable mapping keys to Vectors of Rating objects.
 o setRating
 public void setRating(String name,
                       Vector rating)
Changes the rating(s) for a particular category.

Parameters:
name - The name of the Category to change.
rating - A Vector containing one or more Rating objects.
 o getCategory
 public Vector getCategory(String categoryName)
Returns the ratings for a particular category in this Label.

Parameters:
categoryName - The category whose ratings are to be returned.
Returns:
A Vector, containing the Rating objects for the category categoryName.
 o toString
 public String toString()
Returns a String containing the PICS 1.1 representation of this Label.

Returns:
A String with a valid PICS 1.1 label representation of this Label object.
Overrides:
toString in class Object
 o toDSigString
 public String toDSigString()
Returns a String containing the canonical PICS 1.1 representation of this Label, suitable for signing.

Returns:
A String with a valid canonicalized PICS 1.1 label representation of this Label object.
 o initDSig
 public void initDSig() throws ParseError, DSigException
Parse the two DSig extension fields (resinfo and sigblock) out of the Label object. It is necessary to call this method after the Label object is created by the PICS parser and before any signing or verification takes place.

Throws: ParseError
if the DSig extensions cannot be parsed correctly.
Throws: DSigException
if the DSig extensions cannot be parsed correctly.
 o updateDSig
 public void updateDSig()
The change made in ResInfo and SigBlock extension is not automatic; calling this method updates the original PICS1.1 Label and reflect the changes in resinfo and sigblock.

 o getResInfo
 public ResInfoExtension getResInfo()
Get the DSig Resource Information (resinfo).

 o setResInfo
 public void setResInfo(ResInfoExtension resinfo)
Set the DSig Resource Information (resinfo).

 o getSigBlock
 public SigBlockExtension getSigBlock()
Get the DSig Signature Block (sigblock)

 o setSigBlock
 public void setSigBlock(SigBlockExtension sigblock)
Set the DSig Signature Block (sigblock)

 o sign
 public void sign(SignatureSuite sigsuite,
                  PrivateKey privkey)
Sign the label using the appropriate private key class recognized by the signature suite. Signing automatically sets the ByName property to "[anonymous]", that should be set appropriately after signing. If this signature suite object already contains a signature, it will be replaced by the new one.

 o verifyAll
 public Trivalue verifyAll()
Verify the complete Signature Label. This will verify all message digests present in the resinfo and all signatures present in the sigblock. Therefore, this is a computationally rather expensive operation that is often not required. Still, this function is provided to allow verification with just one function call. For other methods to verify the label see the documentation.

 o verify
 public Trivalue verify()
Verify the label using the user's default policy. Currently this is defined to be the same as verifyAll(), but this will change.

 o getFor
 public String getFor()
Return the URL specified in the 'for' option of this label or null if none is present.

 o toExcludedDSigString
 public String toExcludedDSigString(Hashtable sigdata) throws DSigException
Returns the canonicallized form of the DSig label with fields selectively included or excluded according the sigdata. Please refer to the DSig Label specification for more detail.

Throws: DSigException
if the format of the sigdata is incorrect.

All Packages  Class Hierarchy  This Package  Previous  Next  Index