jain.protocol.ip.sip.header
Class EncryptionHeader

java.lang.Object
  |
  +--jain.protocol.ip.sip.header.Header
        |
        +--jain.protocol.ip.sip.header.GeneralHeader
              |
              +--jain.protocol.ip.sip.header.EncryptionHeader

public final class EncryptionHeader
extends GeneralHeader

This class represents the Encryption general-header. The EncryptionHeader specifies that the content has been encrypted. It is intended for end-to-end encryption of RequestMessages and ResponseMessages. RequestMessages are encrypted based on the public key belonging to the entity named in the ToHeader. ResponseMessages are encrypted based on the public key conveyed in the ResponseKeyHeader. Note that the public keys themselves may not be used for the encryption. This depends on the particular algorithms used.

For any encrypted Message, at least the Message body and possibly other Message Headers are encrypted. An application receiving a RequestMessage or ResponseMessage containing an EncryptionHeader decrypts the body using the private key, which returns the decrypted Message with decrypted body plus any decrypted Headers. Message Headers in the decrypted part completely replace those with the same field name in the unencrypted part. Note that the RequestMessage method and RequestURI cannot be encrypted.

Encryption only provides privacy; the recipient has no guarantee that the RequestMessage or ResponseMessage came from the party listed in the FromHeader, only that the sender used the recipient's public key. However, proxies will not be able to modify the RequestMessage or ResponseMessage.

Since proxies can base their forwarding decision on any combination of Headers, there is no guarantee that an encrypted RequestMessage "hiding" Headers will reach the same destination as an otherwise identical un-encrypted RequestMessage.

Version:
0.6

Field Summary
static java.lang.String token
          Token of EncryptionHeader
 
Fields inherited from class jain.protocol.ip.sip.header.Header
ENTITY_HEADER, GENERAL_HEADER, REQUEST_HEADER, RESPONSE_HEADER
 
Constructor Summary
EncryptionHeader(java.lang.String scheme)
          Creates an EncryptionHeader based on given scheme
 
Method Summary
 java.lang.Object clone()
          Creates and returns a copy of EncryptionHeader
 boolean equals(EncryptionHeader encryptionHeader)
          Indicates whether some other EncryptionHeader is "equal to" this one
 java.lang.String getParameter(java.lang.String parameter)
          Gets the value of specified parameter in EncryptionHeader
 java.lang.String[] getParameters()
          Gets an array of EncryptionHeader's parameter names
 java.lang.String getScheme()
          Gets scheme of EncryptionHeader
 java.lang.String getValue()
          Gets value of EncryptionHeader
 boolean hasParameter(java.lang.String parameter)
          Gets boolean value to indicate if the EncryptionHeader has specified parameter
 boolean hasParameters()
          Gets boolean value to indicate if the EncryptionHeader has parameters
 void removeParameter(java.lang.String parameter)
          Removes specified parameter from EncryptionHeader
 void removeParameters()
          Removes all parameters from EncryptionHeader
 void setParameter(java.lang.String parameter, java.lang.String value)
          Sets value of parameter to value in EncryptionHeader
 void setScheme(java.lang.String scheme)
          Sets scheme of EncryptionHeader
 
Methods inherited from class jain.protocol.ip.sip.header.Header
equals, getHeaderType, getToken, setValue, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

token

public static final java.lang.String token
Token of EncryptionHeader
Constructor Detail

EncryptionHeader

public EncryptionHeader(java.lang.String scheme)
                 throws java.lang.IllegalArgumentException
Creates an EncryptionHeader based on given scheme
Parameters:
scheme - scheme
Throws:
java.lang.IllegalArgumentException - if scheme is null or zero-length
Method Detail

getParameter

public java.lang.String getParameter(java.lang.String parameter)
                              throws ParameterNotSetException
Gets the value of specified parameter in EncryptionHeader
Parameters:
parameter - parameter to retrieve
Returns:
the value of specified parameter in EncryptionHeader
Throws:
ParameterNotSetException - if the extension does not exist

hasParameters

public boolean hasParameters()
Gets boolean value to indicate if the EncryptionHeader has parameters
Returns:
boolean value to indicate if the EncryptionHeader has parameters

hasParameter

public boolean hasParameter(java.lang.String parameter)
Gets boolean value to indicate if the EncryptionHeader has specified parameter
Returns:
boolean value to indicate if the EncryptionHeader has specified parameter

setParameter

public void setParameter(java.lang.String parameter,
                         java.lang.String value)
Sets value of parameter to value in EncryptionHeader
Parameters:
parameter - name of parameter
value - value of parameter
Throws:
java.lang.IllegalArgumentException - if parameter or value are null or zero-length

getParameters

public java.lang.String[] getParameters()
                                 throws ParameterNotSetException
Gets an array of EncryptionHeader's parameter names
Returns:
an array of EncryptiontHeader's parameter names
Throws:
ParameterNotSetException - if no parameters exist

removeParameter

public void removeParameter(java.lang.String parameter)
Removes specified parameter from EncryptionHeader
Parameters:
parameter - parameter to remove from EncryptionHeader

removeParameters

public void removeParameters()
Removes all parameters from EncryptionHeader
Parameters:
parameter - parameter to remove from EncryptionHeader

setScheme

public void setScheme(java.lang.String scheme)
               throws java.lang.IllegalArgumentException
Sets scheme of EncryptionHeader
Parameters:
scheme - scheme
Throws:
java.lang.IllegalArgumentException - if scheme is null or zero-length

getScheme

public java.lang.String getScheme()
Gets scheme of EncryptionHeader
Returns:
scheme of EncryptionHeader

getValue

public java.lang.String getValue()
Gets value of EncryptionHeader
Overrides:
getValue in class Header
Returns:
value of EncryptionHeader

clone

public java.lang.Object clone()
Creates and returns a copy of EncryptionHeader
Overrides:
clone in class Header

equals

public boolean equals(EncryptionHeader encryptionHeader)
Indicates whether some other EncryptionHeader is "equal to" this one
Parameters:
encryptionHeader - the EncryptionHeader with which to compare


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


Copyright - 2000 Sun Microsystems