    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.

##

dsigparser

##

Label()
  Creates a new, empty Label.

##

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

##

dsigparser

     public DSigParser dsigparser

##

Label

     public Label()

  Creates a new, empty Label.

##

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

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.

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.

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.

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

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

getService

     public String getService()

  Returns the Service URL associated with this Label.

  Returns:
    A String containing the Service URL.

setService

     public void setService(String serURL)

  Changes the Service URL associated with this Label.

  Parameters:
    serURL - The new Service URL.

getRatings

     public Hashtable getRatings()

  Returns all of the ratings in a Label.

  Returns:
    A Hashtable mapping keys to Vectors of Rating objects.

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.

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.

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

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.

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.

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.

getResInfo

     public ResInfoExtension getResInfo()

  Get the DSig Resource Information (resinfo).

setResInfo

     public void setResInfo(ResInfoExtension resinfo)

  Set the DSig Resource Information (resinfo).

getSigBlock

     public SigBlockExtension getSigBlock()

  Get the DSig Signature Block (sigblock)

setSigBlock

     public void setSigBlock(SigBlockExtension sigblock)

  Set the DSig Signature Block (sigblock)

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.

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.

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.

getFor

     public String getFor()

  Return the URL specified in the 'for' option of this label or null if none is present.

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