NIST-SIP: The Reference Implementation for JAIN-SIP 1.2

gov.nist.javax.sip.header
Class AuthenticationHeader

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

public abstract class AuthenticationHeader
extends ParametersHeader

The generic AuthenticationHeader

Since:
1.1
Version:
1.2 $Revision: 1.12 $ $Date: 2009/07/17 18:57:26 $
Author:
Olivier Deruelle, M. Ranganathan
See Also:
Serialized Form

Field Summary
static String ALGORITHM
           
static String CK
           
static String CNONCE
           
static String DOMAIN
           
static String IK
           
static String INTEGRITY_PROTECTED
           
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, JOIN, MAX_FORWARDS, MIME_VERSION, MIN_EXPIRES, MIN_SE, ORGANIZATION, PRIORITY, PROXY_AUTHENTICATE, PROXY_AUTHORIZATION, PROXY_REQUIRE, RACK, REASON, RECORD_ROUTE, REFERRED_BY, REPLACES, REPLY_TO, REQUIRE, RETRY_AFTER, ROUTE, RSEQ, SERVER, SESSION_EXPIRES, SIP_ETAG, SIP_IF_MATCH, SUBJECT, SUBSCRIPTION_STATE, SUPPORTED, TIMESTAMP, TO, UNSUPPORTED, USER_AGENT, VIA, WARNING, WWW_AUTHENTICATE
 
Constructor Summary
AuthenticationHeader()
           
AuthenticationHeader(String name)
           
 
Method Summary
 String encodeBody()
          Encode in canonical form.
 String getAlgorithm()
          Returns the Algorithm value of this WWWAuthenicateHeader.
 String getCK()
           
 String getCNonce()
          Get the CNonce.
 String getDomain()
          Returns the Domain value of this WWWAuthenicateHeader.
 String getIK()
           
 String getIntegrityProtected()
           
 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 setCK(String ck)
           
 void setCNonce(String cnonce)
          Set the CNonce.
 void setDomain(String domain)
          Sets the Domain of the WWWAuthenicateHeader to the domain parameter value.
 void setIK(String ik)
           
 void setIntegrityProtected(String integrityProtected)
           
 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
clone, getNameValue, getParameter, getParameterNames, getParameters, getParameterValue, hasParameter, hasParameters, removeParameter, removeParameters, setParameter, setParameters, setQuotedParameter
 
Methods inherited from class gov.nist.javax.sip.header.SIPHeader
encode, encode, getHeaderName, getHeaderValue, getName, getValue, hashCode, isHeaderList, setHeaderName, toString
 
Methods inherited from class gov.nist.javax.sip.header.SIPObject
dbgPrint, debugDump, debugDump, equals, match
 
Methods inherited from class gov.nist.core.GenericObject
getClassFromName, getMatcher, isMySubclass, makeClone, merge, setMatcher
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.sip.header.Header
equals
 

Field Detail

DOMAIN

public static final String DOMAIN
See Also:
Constant Field Values

REALM

public static final String REALM
See Also:
Constant Field Values

OPAQUE

public static final String OPAQUE
See Also:
Constant Field Values

ALGORITHM

public static final String ALGORITHM
See Also:
Constant Field Values

QOP

public static final String QOP
See Also:
Constant Field Values

STALE

public static final String STALE
See Also:
Constant Field Values

SIGNATURE

public static final String SIGNATURE
See Also:
Constant Field Values

RESPONSE

public static final String RESPONSE
See Also:
Constant Field Values

SIGNED_BY

public static final String SIGNED_BY
See Also:
Constant Field Values

NC

public static final String NC
See Also:
Constant Field Values

URI

public static final String URI
See Also:
Constant Field Values

USERNAME

public static final String USERNAME
See Also:
Constant Field Values

CNONCE

public static final String CNONCE
See Also:
Constant Field Values

NONCE

public static final String NONCE
See Also:
Constant Field Values

IK

public static final String IK
See Also:
Constant Field Values

CK

public static final String CK
See Also:
Constant Field Values

INTEGRITY_PROTECTED

public static final String INTEGRITY_PROTECTED
See Also:
Constant Field Values
Constructor Detail

AuthenticationHeader

public AuthenticationHeader(String name)

AuthenticationHeader

public AuthenticationHeader()
Method Detail

setParameter

public void setParameter(String name,
                         String value)
                  throws ParseException
set the specified parameter. Bug reported by Dominic Sparks.

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.

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.

getScheme

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

Returns:
the string value of the challenge information.

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.

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 AuthenicationHeader.
Since:
v1.1 Note that since 1.2 this is no longer applicable to the WWW-Authenticate and Proxy-Authenticate headers

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 Note that since 1.2 this is no longer applicable to the WWW-Authenticate and Proxy-Authenticate headers

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.
Throws:
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

Throws:
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.
Throws:
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.

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.

setIK

public void setIK(String ik)
           throws ParseException
Throws:
ParseException

getIK

public String getIK()

setCK

public void setCK(String ck)
           throws ParseException
Throws:
ParseException

getCK

public String getCK()

setIntegrityProtected

public void setIntegrityProtected(String integrityProtected)
                           throws ParseException
Throws:
ParseException

getIntegrityProtected

public String getIntegrityProtected()

NIST-SIP: The Reference Implementation for JAIN-SIP 1.2

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