imitations for SIP. The next-nonce mechanism, for example, does not support pipelined requests. The nonce-count mechanism should be used for replay protection. Another limitation of HTTP digest is the scope of realms. Digest is valuable when a user wants to authenticate themselves to a resource with which they have a pre-existing association, like a service provider of which the user is a customer (which is a common scenario and thus digest provides an extremely C 2009 by Taylor & Francis Group, LLC SIP Handbook: Services, Technologies, and Security useful function). By way of contrast, the scope of TLS is interdomain or multi-realm, since certificates are often globally verifiable, SO that the UA can authenticate the server with no pre-existing association [18]. 22.3.4.2.3 Application layer security mechanisms Encrypting entire SIP messages end-to-end for the purpose of confidentiality is not appropri- ate because network intermediaries (like proxy servers) need to view certain header fields in order to route messages correctly, and if these intermediaries are excluded from security associations, then SIP messages will essentially be non-routable. However, S/MIME allows SIP UAs to encrypt MIME bod- ies within SIP, securing these bodies end-to-end without affecting message headers [19]. S/MIME can be used to provide end-to-end confidentiality and integrity for the bodies of messages, as well as mutual authentication. Fur- thermore, S/MIME can be used to provide some form of integrity and confi- dentiality for SIP header fields with SIP message tunneling. The most significant defect of the S/MIME mechanism is the absence of a prevalent public key infrastructure for end users. If self-signed certificates (or certificates that cannot be verified by a participant in a dialogue) are employed, the SIP-based key exchange mechanism is open to a man-in-the- middle attack. Thus an attacker can potentially inspect and modify S/MIME bodies [19]. The approach is for the attacker to intercept the first exchange of keys between