jain.protocol.ip.sip
Class DigestChallenge

java.lang.Object
  |
  +--jain.protocol.ip.sip.Challenge
        |
        +--jain.protocol.ip.sip.DigestChallenge

public final class DigestChallenge
extends Challenge

This class represents a Digest Authentication scheme Challenge. The meanings of the values of the parameters are as follows:

  • Domain: A list of InetAddresses that defines the protection space. If this is omitted, the client should assume that the protection space consists of all URIs on the responding server. Domain is not meaningful in ProxyAuthenticateHeaders, for which the protection space is always the entire proxy; if present it should be ignored.
  • Nonce: A server-specified String which should be uniquely generated each time an UNAUTHORIZED or PROXY_AUTHENTICATION_REQUIRED ResponseMessage is made. It is recommended that this string be base64 or hexadecimal data. Specifically, since the string is passed in a Header as a quoted string, the double-quote character is not allowed. The contents of the Nonce are implementation dependent. The quality of the implementation depends on a good choice. An implementation might choose not to accept a previously used Nonce , in order to protect against a replay attack. The Nonce is opaque to the client.
  • Opaque: A String, specified by the server, which should be returned by the client unchanged in the (Proxy)AuthorizationHeader of subsequent RequestMessages with URIs in the same protection space. It is recommended that this string be base64 or hexadecimal data.
  • Stale: A flag, indicating that the previous RequestMessage from the client was rejected because the Nonce value was stale. If Stale is true, the client may wish to simply retry the RequestMessage with a new encrypted response, without reprompting the user for a new username and password. The server should only set Stale to true if it receives a RequestMessage for which the Nonce is invalid but with a valid digest for that Nonce (indicating that the client knows the correct username/password). If Stale is false, or the stale directive is not present, the username and/or password are invalid, and new values must be obtained.
  • Algorithm: A String indicating a pair of algorithms used to produce the digest and a checksum. If this is not present it is assumed to be "MD5". If the algorithm is not understood, the challenge should be ignored (and a different one used, if there is more than one).
  • Qop: This directive is optional, but is made so only for backward compatibility with RFC 2069 ; it should be used by all implementations compliant with this version of the Digest scheme. If present, it is an array of Strings indicating the "quality of protection" values supported by the server. The value "auth" indicates authentication; the value "auth-int" indicates authentication with integrity protection. Unrecognized options must be ignored.
  • Version:
    0.6
    See Also:
    Challenge, WWWAuthenticateHeader, ProxyAuthenticateHeader

    Constructor Summary
    DigestChallenge(java.lang.String realm, java.lang.String nonce)
              Creates a DigestChallenge based on given authentication realm and nonce
     
    Method Summary
     java.lang.String getAlgorithm()
              Gets algorithm of DigestChallenge
     java.net.InetAddress[] getDomain()
              Gets domain of DigestChallenge
     java.lang.String getNonce()
              Gets nonce of DigestChallenge
     java.lang.String getOpaque()
              Gets opaque of DigestChallenge
     java.lang.String[] getQop()
              Gets qop of DigestChallenge
     boolean getStale()
              Gets stale of DigestChallenge
     boolean hasAlgorithm()
              Gets boolean value to indicate if the DigestChallenge has algorithm
     boolean hasDomain()
              Gets boolean value to indicate if the DigestChallenge has domain
     boolean hasOpaque()
              Gets boolean value to indicate if the DigestChallenge has opaque
     boolean hasQop()
              Gets boolean value to indicate if the DigestChallenge has qop
     boolean hasStale()
              Gets boolean value to indicate if the DigestChallenge has stale
     void removeAlgorithm()
              Removes algorithm from DigestChallenge
     void removeDomain()
              Removes domain from DigestChallenge
     void removeOpaque()
              Removes opaque from DigestChallenge
     void removeQop()
              Removes qop from DigestChallenge
     void removeStale()
              Removes stale from DigestChallenge
     void setAlgorithm(java.lang.String algorithm)
              Sets algorithm of DigestChallenge
     void setDomain(java.net.InetAddress[] domain)
              Sets domain of DigestChallenge
     void setNonce(java.lang.String nonce)
              Sets nonce of DigestChallenge
     void setOpaque(java.lang.String opaque)
              Sets opaque of DigestChallenge
     void setQop(java.lang.String[] qop)
              Sets qop of DigestChallenge
     void setStale(boolean stale)
              Sets stale of DigestChallenge
     
    Methods inherited from class jain.protocol.ip.sip.Challenge
    clone, equals, getExtension, getExtensions, getRealm, getScheme, hasExtension, hasExtensions, removeExtension, removeExtensions, setExtension, setRealm, setScheme, toString
     
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
     

    Constructor Detail

    DigestChallenge

    public DigestChallenge(java.lang.String realm,
                           java.lang.String nonce)
                    throws java.lang.IllegalArgumentException
    Creates a DigestChallenge based on given authentication realm and nonce
    Parameters:
    realm - authentication realm
    nonce - nonce
    Throws:
    java.lang.IllegalArgumentException - if realm or nonce are null or zero-length
    Method Detail

    setNonce

    public void setNonce(java.lang.String nonce)
                  throws java.lang.IllegalArgumentException
    Sets nonce of DigestChallenge
    Parameters:
    nonce - nonce
    Throws:
    java.lang.IllegalArgumentException - if nonce is null or zero-length

    getNonce

    public java.lang.String getNonce()
    Gets nonce of DigestChallenge
    Returns:
    nonce of DigestChallenge

    getOpaque

    public java.lang.String getOpaque()
                               throws ParameterNotSetException
    Gets opaque of DigestChallenge
    Returns:
    opaque of DigestChallenge
    Throws:
    ParameterNotSetException - if opaque does not exist

    hasOpaque

    public boolean hasOpaque()
    Gets boolean value to indicate if the DigestChallenge has opaque
    Returns:
    boolean value to indicate if the DigestChallenge has opaque

    removeOpaque

    public void removeOpaque()
    Removes opaque from DigestChallenge

    setOpaque

    public void setOpaque(java.lang.String opaque)
                   throws java.lang.IllegalArgumentException
    Sets opaque of DigestChallenge
    Parameters:
    opaque - opaque
    Throws:
    java.lang.IllegalArgumentException - if opaque is null or zero-length

    getDomain

    public java.net.InetAddress[] getDomain()
                                     throws ParameterNotSetException
    Gets domain of DigestChallenge
    Returns:
    domain of DigestChallenge
    Throws:
    ParameterNotSetException - if domainv does not exist

    hasDomain

    public boolean hasDomain()
    Gets boolean value to indicate if the DigestChallenge has domain
    Returns:
    boolean value to indicate if the DigestChallenge has domain

    removeDomain

    public void removeDomain()
    Removes domain from DigestChallenge

    setDomain

    public void setDomain(java.net.InetAddress[] domain)
                   throws java.lang.IllegalArgumentException
    Sets domain of DigestChallenge
    Parameters:
    domain - domain
    Throws:
    java.lang.IllegalArgumentException - if domain is null or empty

    getQop

    public java.lang.String[] getQop()
                              throws ParameterNotSetException
    Gets qop of DigestChallenge
    Returns:
    qop of DigestChallenge
    Throws:
    ParameterNotSetException - if qop does not exist

    hasQop

    public boolean hasQop()
    Gets boolean value to indicate if the DigestChallenge has qop
    Returns:
    boolean value to indicate if the DigestChallenge has qop

    removeQop

    public void removeQop()
    Removes qop from DigestChallenge

    setQop

    public void setQop(java.lang.String[] qop)
                throws java.lang.IllegalArgumentException
    Sets qop of DigestChallenge
    Parameters:
    qop - qop
    Throws:
    java.lang.IllegalArgumentException - if qop is null or empty

    getStale

    public boolean getStale()
                     throws ParameterNotSetException
    Gets stale of DigestChallenge
    Returns:
    stale of DigestChallenge
    Throws:
    ParameterNotSetException - if stale does not exist

    hasStale

    public boolean hasStale()
    Gets boolean value to indicate if the DigestChallenge has stale
    Returns:
    boolean value to indicate if the DigestChallenge has stale

    removeStale

    public void removeStale()
    Removes stale from DigestChallenge

    setStale

    public void setStale(boolean stale)
    Sets stale of DigestChallenge
    Parameters:
    stale - stale

    getAlgorithm

    public java.lang.String getAlgorithm()
                                  throws ParameterNotSetException
    Gets algorithm of DigestChallenge
    Returns:
    algorithm of DigestChallenge
    Throws:
    ParameterNotSetException - if algorithm does not exist

    hasAlgorithm

    public boolean hasAlgorithm()
    Gets boolean value to indicate if the DigestChallenge has algorithm
    Returns:
    boolean value to indicate if the DigestChallenge has algorithm

    removeAlgorithm

    public void removeAlgorithm()
    Removes algorithm from DigestChallenge

    setAlgorithm

    public void setAlgorithm(java.lang.String algorithm)
                      throws java.lang.IllegalArgumentException
    Sets algorithm of DigestChallenge
    Parameters:
    algorithm - algorithm
    Throws:
    java.lang.IllegalArgumentException - if algorithm is null or zero-length


    If you have any comments or queries, please mail them to JAIN-SIP-interest@sun.com


    Copyright - 2000 Sun Microsystems