    All Packages  Class Hierarchy  This Package  Previous  Next  Index

# Class w3c.www.dsig.SigSuiteDSS

    java.lang.Object
       |
       +----w3c.www.dsig.SignatureSuite
               |
               +----w3c.www.dsig.SigSuiteDSS

public final class SigSuiteDSS
extends SignatureSuite

This class implements the DSS signature suite for the W3C's DSig as defined in `http://www.w3.org/TR/1998/REC-DSig-label/DSS-1_0`.

Application programmers should never access this class via its name `w3c.www.dsig.SigSuiteDSS`. You should use `SigSuiteRegistry.getInstance()`, `sigblock.getSigSuite()`, etc.

This class does not the implement the cryptographic DSS algorithm itself, it requires that a Java security provider implementing it is already installed.

##

DSSURL
  The string defined to indentify the DSS (DSA with SHA-1) signature suite implemented by this class, `http://www.w3.org/TR/1998/REC-DSig-label/DSS-1_0`.

##

SigSuiteDSS()
  Constructor for use by `w3c.www.dsig.SigSuiteRegistry.getInstance()`.

##

getBy()
  Return the By information itself.
getByType()
  Return the type of the By information given in this signature suite.
getKeyLength()
  Return the length of the key used to generate this signature.
setBy(String, Object)
  Set the By information for this signature suite to the type type and the value to signer.
sign(DSigLabelInterface, PrivateKey)
  Sign the given label using the given private key, which needs to be an instance of a DSAPublicKey.
verify(DSigLabelInterface, PublicKey)
  Verify if this signature suite object correctly signs the given label with the given public key.

##

DSSURL

     public static final String DSSURL

  The string defined to indentify the DSS (DSA with SHA-1) signature suite implemented by this class, `http://www.w3.org/TR/1998/REC-DSig-label/DSS-1_0`.

##

SigSuiteDSS

     public SigSuiteDSS() throws NoSuchAlgorithmException

  Constructor for use by `w3c.www.dsig.SigSuiteRegistry.getInstance()`. Application programmers should not need to access this constructor directly.

  Throws: NoSuchAlgorithmException
    if the signature algorithm DSA cannot be found

##

getKeyLength

     public int getKeyLength()

  Return the length of the key used to generate this signature. To be more precise, return the length of the number p, which is only one part of the key. Note that the keylength will only be available after `sign()` or `verify()` has been called, otherwise this method will return -1.

  Overrides:
    getKeyLength in class SignatureSuite

sign

     public DSigLabelInterface sign(DSigLabelInterface label,
                                    PrivateKey privkey)

  Sign the given label using the given private key, which needs to be an instance of a DSAPublicKey. 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.

  Overrides:
    sign in class SignatureSuite

verify

     public Trivalue verify(DSigLabelInterface label,
                            PublicKey pubkey)

  Verify if this signature suite object correctly signs the given label with the given public key. pubkey must either be an instance of DSAPublicKey or null. In that case the public key will be extracted from the signature suite if it is specified either as ByKey or as ByName (trying a certificate lookup). If no valid public key can be found, verify returns unknown. Else the signature will be verified using that public key returning unknown if there was any other problem verifying the signature or one of true/ false to indicate the result.

  Overrides:
    verify in class SignatureSuite

getByType

     public String getByType()

  Return the type of the By information given in this signature suite. This will return either one of the string "ByName", "ByKey", or "ByHash" or null.

  Overrides:
    getByType in class SignatureSuite

getBy

     public Object getBy()

  Return the By information itself. For ByName, this will return the name as string, for ByKey it will return the name as a DSAPublicKey, and for ByHash it will return the hash data as a byte array. In case of any error or if no known by information was found this method return null.

  Overrides:
    getBy in class SignatureSuite

setBy

     public SignatureSuite setBy(String type,
                                 Object signer)

  Set the By information for this signature suite to the type type and the value to signer. Supported by this signature suite are "ByName", which uses signer.toString() as the value; and "ByKey" and "ByHash", in which cases signer has to be an instance of DSAPublicKey. The method returns this signature suite itself for success or null if there was an error. NOTE: This method has to be called after signing in order to have any effect.

  Overrides:
    setBy in class SignatureSuite

    All Packages  Class Hierarchy  This Package  Previous  Next  Index