Sun GlassFish Communications Server 2.0 Developer's Guide

Creating a Custom Trust Handler for P-Asserted Identity Authentication

A trust handler is invoked for every SIP message that the Communications Server receives from or sends to the network. You can create a P-asserted identity trust configuration with a trust handler in one of these ways:

A custom trust handler must implement the com.sun.enterprise.security.auth.TrustHandler and com.sun.enterprise.security.auth.PrincipalMapper interfaces along with the following methods:

public boolean isTrusted(String asserterAddress, String trustedAs, 
X509Certificate securityid, Principal [] pAssertedValues);

This method determines if the container can trust the network entity from which the message with the P-Asserted-Identity header was received. This method also validates whether the identity used to secure the message is trusted. If the network entity and identity can both be trusted, this method returns true. Parameters are as follows:

public Principal [] mapIdentity(Principal [] assrtId);

This method accepts P-Asserted-Identity header values and returns them in a format understood by the SIP container.