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

gov.nist.javax.sip.header.ims
Class SecurityAgree

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.ims.SecurityAgree
All Implemented Interfaces:
HeaderExt, SIPHeaderNames, Serializable, Cloneable, Header, Parameters
Direct Known Subclasses:
SecurityClient, SecurityServer, SecurityVerify

public abstract class SecurityAgree
extends ParametersHeader

"Security Mechanism Agreemet for SIP Sessions" - sec-agree: RFC 3329 + 3GPP TS33.203 (Annex H).

Headers: Security-Server + Security-Client + Security-Verify

Author:
Miguel Freitas (IT) PT-Inovacao
See Also:
Serialized Form

Field Summary
 
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
SecurityAgree()
          Default constructor
SecurityAgree(String name)
          Constructor
 
Method Summary
 Object clone()
          Clones this object.
 String encodeBody()
          Encode the body of this header (the stuff that follows headerName).
 boolean equals(Object other)
          An introspection based equality predicate for SIPObjects.
 String getAlgorithm()
          Get Algorithm
 String getEncryptionAlgorithm()
          Get Encryption Algorithm
 String getMode()
          Get Mode
 int getPortClient()
          Get Client Port
 int getPortServer()
          Get Server Port
 float getPreference()
          Get Preference
 String getProtocol()
          Get Protocol
 String getSecurityMechanism()
          Get Security Mechanism
 int getSPIClient()
          Get Client SPI
 int getSPIServer()
          Get Server SPI
 void setAlgorithm(String alg)
          Set Algorithm (alg parameter)
 void setEncryptionAlgorithm(String ealg)
          Set Encryption Algorithm (ealg parameter)
 void setMode(String mod)
          Set Mode (mod parameter)
 void setParameter(String name, String value)
          Sets the value of the specified parameter.
 void setPortClient(int portC)
          Set Client Port (port-c parameter)
 void setPortServer(int portS)
          Set Server Port (port-s parameter)
 void setPreference(float q)
          Set Preference.
 void setProtocol(String prot)
          Set Protocol (prot paramater)
 void setSecurityMechanism(String secMech)
          Set security mechanism.
 void setSPIClient(int spic)
          Set Client SPI (spi-c parameter)
 void setSPIServer(int spis)
          Set Server SPI (spi-s parameter)
 
Methods inherited from class gov.nist.javax.sip.header.ParametersHeader
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, 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
 

Constructor Detail

SecurityAgree

public SecurityAgree(String name)
Constructor

Parameters:
name - - name of the Security Agree header to create

SecurityAgree

public SecurityAgree()
Default constructor

Method Detail

setParameter

public void setParameter(String name,
                         String value)
                  throws ParseException
Description copied from class: ParametersHeader
Sets the value of the specified parameter. If the parameter already had a value it will be overwritten. A zero-length String indicates flag parameter.

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

encodeBody

public String encodeBody()
Description copied from class: SIPHeader
Encode the body of this header (the stuff that follows headerName). A.K.A headerValue.


setSecurityMechanism

public void setSecurityMechanism(String secMech)
                          throws ParseException
Set security mechanism.

eg: Security-Client: ipsec-3gpp

Parameters:
secMech - - security mechanism name
Throws:
ParseException

setEncryptionAlgorithm

public void setEncryptionAlgorithm(String ealg)
                            throws ParseException
Set Encryption Algorithm (ealg parameter)

Parameters:
ealg - - encryption algorithm value
Throws:
ParseException

setAlgorithm

public void setAlgorithm(String alg)
                  throws ParseException
Set Algorithm (alg parameter)

Parameters:
alg - - algorithm value
Throws:
ParseException

setProtocol

public void setProtocol(String prot)
                 throws ParseException
Set Protocol (prot paramater)

Parameters:
prot - - protocol value
Throws:
ParseException

setMode

public void setMode(String mod)
             throws ParseException
Set Mode (mod parameter)

Parameters:
mod - - mode value
Throws:
ParseException

setSPIClient

public void setSPIClient(int spic)
                  throws InvalidArgumentException
Set Client SPI (spi-c parameter)

Parameters:
spic - - spi-c value
Throws:
InvalidArgumentException

setSPIServer

public void setSPIServer(int spis)
                  throws InvalidArgumentException
Set Server SPI (spi-s parameter)

Parameters:
spis - - spi-s value
Throws:
InvalidArgumentException - - when value is not valid

setPortClient

public void setPortClient(int portC)
                   throws InvalidArgumentException
Set Client Port (port-c parameter)

Parameters:
portC - - port-c value
Throws:
InvalidArgumentException - - when value is not valid

setPortServer

public void setPortServer(int portS)
                   throws InvalidArgumentException
Set Server Port (port-s parameter)

Parameters:
portS - - port-s value
Throws:
InvalidArgumentException - - when value is not valid

setPreference

public void setPreference(float q)
                   throws InvalidArgumentException

Set Preference. The "q" parameter indicates a relative preference for the particular mechanism. The higher the value the more preferred the mechanism is. Range from 0.001 to 0.999.

Parameters:
q - - q parameter value
Throws:
InvalidArgumentException - - when value is not valid

getSecurityMechanism

public String getSecurityMechanism()
Get Security Mechanism

Returns:
security mechanims value

getEncryptionAlgorithm

public String getEncryptionAlgorithm()
Get Encryption Algorithm

Returns:
ealg parameter value

getAlgorithm

public String getAlgorithm()
Get Algorithm

Returns:
alg parameter value

getProtocol

public String getProtocol()
Get Protocol

Returns:
prot parameter value

getMode

public String getMode()
Get Mode

Returns:
mod parameter value

getSPIClient

public int getSPIClient()
Get Client SPI

Returns:
spi-c parameter value

getSPIServer

public int getSPIServer()
Get Server SPI

Returns:
spi-s parameter value

getPortClient

public int getPortClient()
Get Client Port

Returns:
port-c parameter value

getPortServer

public int getPortServer()
Get Server Port

Returns:
port-s parameter value

getPreference

public float getPreference()
Get Preference

Returns:
q parameter value

equals

public boolean equals(Object other)
Description copied from class: SIPObject
An introspection based equality predicate for SIPObjects.

Specified by:
equals in interface Header
Overrides:
equals in class SIPObject
Parameters:
other - the other object to test against.
Returns:
true if the objects are euqal and false otherwise

clone

public Object clone()
Description copied from class: gov.nist.core.GenericObject
Clones this object.

Specified by:
clone in interface Header
Overrides:
clone in class ParametersHeader
Returns:
a deep copy of Header

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.