NIST SIP Parser and Stack (v1.2) API

gov.nist.javax.sip.header
Class AuthenticationHeader

java.lang.Object
  |
  +--gov.nist.core.GenericObject
        |
        +--gov.nist.javax.sip.header.SIPObject
              |
              +--gov.nist.javax.sip.header.SIPHeader
                    |
                    +--gov.nist.javax.sip.header.ParametersHeader
                          |
                          +--gov.nist.javax.sip.header.AuthenticationHeader
All Implemented Interfaces:
Cloneable, Header, Parameters, Serializable, SIPHeaderNames
Direct Known Subclasses:
Authorization, ProxyAuthenticate, ProxyAuthorization, WWWAuthenticate

public abstract class AuthenticationHeader
extends ParametersHeader

The generic AuthenticationHeader

Author:
Olivier Deruelle , M. Ranganathan
This code is in the public domain.
See Also:
Serialized Form

Field Summary
static String ALGORITHM
           
static String CNONCE
           
static String DOMAIN
           
static String NC
           
static String NONCE
           
static String OPAQUE
           
static String QOP
           
static String REALM
           
static String RESPONSE
           
static String SIGNATURE
           
static String SIGNED_BY
           
static String STALE
           
static String URI
           
static String USERNAME
           
 
Fields inherited from interface gov.nist.javax.sip.header.SIPHeaderNames
ACCEPT, ACCEPT_ENCODING, ACCEPT_LANGUAGE, ALERT_INFO, ALLOW, ALLOW_EVENTS, AUTHENTICATION_INFO, AUTHORIZATION, CALL_ID, CALL_INFO, CONTACT, CONTENT_DISPOSITION, CONTENT_ENCODING, CONTENT_LANGUAGE, CONTENT_LENGTH, CONTENT_TYPE, CSEQ, DATE, ERROR_INFO, EVENT, EXPIRES, FROM, IN_REPLY_TO, MAX_FORWARDS, MIME_VERSION, MIN_EXPIRES, ORGANIZATION, PRIORITY, PROXY_AUTHENTICATE, PROXY_AUTHORIZATION, PROXY_REQUIRE, RACK, REASON, RECORD_ROUTE, REPLY_TO, REQUIRE, RETRY_AFTER, ROUTE, RSEQ, SERVER, SUBJECT, SUBSCRIPTION_STATE, SUPPORTED, TIMESTAMP, TO, UNSUPPORTED, USER_AGENT, VIA, WARNING, WWW_AUTHENTICATE
 
Constructor Summary
AuthenticationHeader(String name)
           
 
Method Summary
 String encodeBody()
          Encode in canonical form.
 String getAlgorithm()
          Returns the Algorithm value of this WWWAuthenicateHeader.
 String getCNonce()
          Get the CNonce.
 String getDomain()
          Returns the Domain value of this WWWAuthenicateHeader.
 String getNonce()
          Returns the Nonce value of this WWWAuthenicateHeader.
 int getNonceCount()
           
 String getOpaque()
          Returns the Opaque value of this WWWAuthenicateHeader.
 String getQop()
          Returns the Qop value of this WWWAuthenicateHeader.
 String getRealm()
          Returns the Realm value of this WWWAuthenicateHeader.
 String getResponse()
          Get the RESPONSE value (or null if it does not exist).
 String getScheme()
          Returns the scheme of the challenge information for this AuthenticationHeaderHeader.
 URI getURI()
          Returns the URI value of this WWWAuthenicateHeader, for example DigestURI.
 String getUsername()
          Returns the Username value of this AuthorizationHeader.
 boolean isStale()
          Returns the boolean value of the state paramater of this WWWAuthenicateHeader.
 void setAlgorithm(String algorithm)
          Sets the Algorithm of the WWWAuthenicateHeader to the new algorithm parameter value.
 void setChallenge(Challenge challenge)
          This is only used for the parser interface.
 void setCNonce(String cnonce)
          Set the CNonce.
 void setDomain(String domain)
          Sets the Domain of the WWWAuthenicateHeader to the domain parameter value.
 void setNonce(String nonce)
          Sets the Nonce of the WWWAuthenicateHeader to the nonce parameter value.
 void setNonceCount(int param)
          Set the nonce count pakrameter.
 void setOpaque(String opaque)
          Sets the Opaque value of the WWWAuthenicateHeader to the new opaque parameter value.
 void setParameter(String name, String value)
          set the specified parameter.
 void setQop(String qop)
          Sets the Qop value of the WWWAuthenicateHeader to the new qop parameter value.
 void setRealm(String realm)
          Sets the Realm of the WWWAuthenicateHeader to the realm parameter value.
 void setResponse(String response)
          Set the Response.
 void setScheme(String scheme)
          Sets the scheme of the challenge information for this AuthenticationHeaderHeader.
 void setStale(boolean stale)
          Sets the value of the stale parameter of the WWWAuthenicateHeader to the stale parameter value.
 void setURI(URI uri)
          Sets the URI of the WWWAuthenicateHeader to the uri parameter value.
 void setUsername(String username)
          Sets the Username of the AuthorizationHeader to the username parameter value.
 
Methods inherited from class gov.nist.javax.sip.header.ParametersHeader
getParameter, getParameterNames, getParameters, getParameterValue, hasParameter, hasParameters, removeParameter, removeParameters, setParameter, setParameters, setQuotedParameter
 
Methods inherited from class gov.nist.javax.sip.header.SIPHeader
encode, getHeaderName, getHeaderValue, getName, getValue, isHeaderList, setHeaderName
 
Methods inherited from class gov.nist.javax.sip.header.SIPObject
clone, dbgPrint, debugDump, debugDump, equals, match, merge, replace, replace, replace, replace, toString
 
Methods inherited from class gov.nist.core.GenericObject
getClassFromName, getMatcher, isMySubclass, setMatcher
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.sip.header.Header
clone, equals, toString
 

Field Detail

DOMAIN

public static String DOMAIN

REALM

public static String REALM

OPAQUE

public static String OPAQUE

ALGORITHM

public static String ALGORITHM

QOP

public static String QOP

STALE

public static String STALE

SIGNATURE

public static String SIGNATURE

RESPONSE

public static String RESPONSE

SIGNED_BY

public static String SIGNED_BY

NC

public static String NC

URI

public static String URI

USERNAME

public static String USERNAME

CNONCE

public static String CNONCE

NONCE

public static String NONCE
Constructor Detail

AuthenticationHeader

public AuthenticationHeader(String name)
Method Detail

setParameter

public void setParameter(String name,
                         String value)
                  throws ParseException
set the specified parameter.

Specified by:
setParameter in interface Parameters
Overrides:
setParameter in class ParametersHeader
Parameters:
name - -- name of the parameter
value - -- value of the parameter.
Throws:
ParseException - which signals that an error has been reached unexpectedly while parsing the parameter name or value.

setChallenge

public void setChallenge(Challenge challenge)
This is only used for the parser interface.

Parameters:
challenge - -- the challenge from which the parameters are extracted.

encodeBody

public String encodeBody()
Encode in canonical form.

Overrides:
encodeBody in class ParametersHeader
Returns:
canonical string.

setScheme

public void setScheme(String scheme)
Sets the scheme of the challenge information for this AuthenticationHeaderHeader. For example, Digest.

Parameters:
scheme - - the new string value that identifies the challenge information scheme.
Since:
v1.1

getScheme

public String getScheme()
Returns the scheme of the challenge information for this AuthenticationHeaderHeader.

Returns:
the string value of the challenge information.
Since:
v1.1

setRealm

public void setRealm(String realm)
              throws ParseException
Sets the Realm of the WWWAuthenicateHeader to the realm parameter value. Realm strings MUST be globally unique. It is RECOMMENDED that a realm string contain a hostname or domain name. Realm strings SHOULD present a human-readable identifier that can be rendered to a user.

Parameters:
realm - the new Realm String of this WWWAuthenicateHeader.
Throws:
ParseException - which signals that an error has been reached unexpectedly while parsing the realm.
Since:
v1.1

getRealm

public String getRealm()
Returns the Realm value of this WWWAuthenicateHeader. This convenience method returns only the realm of the complete Challenge.

Returns:
the String representing the Realm information, null if value is not set.
Since:
v1.1

setNonce

public void setNonce(String nonce)
              throws ParseException
Sets the Nonce of the WWWAuthenicateHeader to the nonce parameter value.

Parameters:
nonce - - the new nonce String of this WWWAuthenicateHeader.
Throws:
ParseException - which signals that an error has been reached unexpectedly while parsing the nonce value.
Since:
v1.1

getNonce

public String getNonce()
Returns the Nonce value of this WWWAuthenicateHeader.

Returns:
the String representing the nonce information, null if value is not set.
Since:
v1.1

setURI

public void setURI(URI uri)
Sets the URI of the WWWAuthenicateHeader to the uri parameter value.

Parameters:
uri - - the new URI of this WWWAuthenicateHeader.
Since:
v1.1

getURI

public URI getURI()
Returns the URI value of this WWWAuthenicateHeader, for example DigestURI.

Returns:
the URI representing the URI information, null if value is not set.
Since:
v1.1

setAlgorithm

public void setAlgorithm(String algorithm)
                  throws ParseException
Sets the Algorithm of the WWWAuthenicateHeader to the new algorithm parameter value.

Parameters:
algorithm - - the new algorithm String of this WWWAuthenicateHeader.
Throws:
ParseException - which signals that an error has been reached unexpectedly while parsing the algorithm value.
Since:
v1.1

getAlgorithm

public String getAlgorithm()
Returns the Algorithm value of this WWWAuthenicateHeader.

Returns:
the String representing the Algorithm information, null if the value is not set.
Since:
v1.1

setQop

public void setQop(String qop)
            throws ParseException
Sets the Qop value of the WWWAuthenicateHeader to the new qop parameter value.

Parameters:
qop - - the new Qop string of this WWWAuthenicateHeader.
Throws:
ParseException - which signals that an error has been reached unexpectedly while parsing the Qop value.
Since:
v1.1

getQop

public String getQop()
Returns the Qop value of this WWWAuthenicateHeader.

Returns:
the string representing the Qop information, null if the value is not set.
Since:
v1.1

setOpaque

public void setOpaque(String opaque)
               throws ParseException
Sets the Opaque value of the WWWAuthenicateHeader to the new opaque parameter value.

Parameters:
opaque - - the new Opaque string of this WWWAuthenicateHeader.
Throws:
ParseException - which signals that an error has been reached unexpectedly while parsing the opaque value.
Since:
v1.1

getOpaque

public String getOpaque()
Returns the Opaque value of this WWWAuthenicateHeader.

Returns:
the String representing the Opaque information, null if the value is not set.
Since:
v1.1

setDomain

public void setDomain(String domain)
               throws ParseException
Sets the Domain of the WWWAuthenicateHeader to the domain parameter value.

Parameters:
domain - - the new Domain string of this WWWAuthenicateHeader.
Throws:
ParseException - which signals that an error has been reached unexpectedly while parsing the domain.
Since:
v1.1

getDomain

public String getDomain()
Returns the Domain value of this WWWAuthenicateHeader.

Returns:
the String representing the Domain information, null if value is not set.
Since:
v1.1

setStale

public void setStale(boolean stale)
Sets the value of the stale parameter of the WWWAuthenicateHeader to the stale parameter value.

Parameters:
stale - - the new boolean value of the stale parameter.
Since:
v1.1

isStale

public boolean isStale()
Returns the boolean value of the state paramater of this WWWAuthenicateHeader.

Returns:
the boolean representing if the challenge is stale.
Since:
v1.1

setCNonce

public void setCNonce(String cnonce)
               throws ParseException
Set the CNonce.

Parameters:
cnonce - -- a nonce string.
ParseException

getCNonce

public String getCNonce()
Get the CNonce.

Returns:
the cnonce value.

getNonceCount

public int getNonceCount()

setNonceCount

public void setNonceCount(int param)
                   throws ParseException
Set the nonce count pakrameter. Bug fix sent in by Andreas Byström

ParseException

getResponse

public String getResponse()
Get the RESPONSE value (or null if it does not exist).

Returns:
String response parameter value.

setResponse

public void setResponse(String response)
                 throws ParseException
Set the Response.

Parameters:
response - to set.
ParseException

getUsername

public String getUsername()
Returns the Username value of this AuthorizationHeader. This convenience method returns only the username of the complete Response.

Returns:
the String representing the Username information, null if value is not set.
Since:
JAIN SIP v1.1

setUsername

public void setUsername(String username)
                 throws ParseException
Sets the Username of the AuthorizationHeader to the username parameter value.

Parameters:
username - the new Username String of this AuthorizationHeader.
Throws:
ParseException - which signals that an error has been reached unexpectedly while parsing the username.
Since:
JAIN SIP v1.1

NIST SIP Parser and Stack (v1.2) API

A product of the NIST/ITL Advanced Networking Technologies Division.
See conditions of use.
Get the latest distribution.
Submit a bug report or feature request.