FileDocCategorySizeDatePackage
WSITClientAuthModule.javaAPI DocExample6025Tue May 29 16:57:22 BST 2007com.sun.xml.wss.provider.wsit

WSITClientAuthModule

public class WSITClientAuthModule extends Object implements javax.security.auth.message.module.ClientAuthModule
author
kumar.jayanti

Fields Summary
private static final Logger
log
private Class[]
supported
protected static final String
DEBUG
private boolean
debug
Constructors Summary
public WSITClientAuthModule()
Creates a new instance of WSITClientAuthModule

    
           
      
        supported[0] = SOAPMessage.class;
        supported[1] = Message.class;
    
Methods Summary
public voidcleanSubject(javax.security.auth.message.MessageInfo messageInfo, javax.security.auth.Subject subject)

        if (subject == null) {
            // log
            log.log(Level.SEVERE, LogStringsMessages.WSITPVD_0037_NULL_SUBJECT());
            throw new AuthException(LogStringsMessages.WSITPVD_0037_NULL_SUBJECT());
        }
        
        if (!subject.isReadOnly()) {
            // log
            //subject = new Subject();
            return;
        }
        
        Set principals = subject.getPrincipals();
        Set privateCredentials = subject.getPrivateCredentials();
        Set publicCredentials = subject.getPublicCredentials();
        
        try {
            principals.clear();
        } catch (UnsupportedOperationException uoe) {
            // log
        }
        
        Iterator pi = privateCredentials.iterator();
        while (pi.hasNext()) {
            try {
                Destroyable dstroyable =
                        (Destroyable)pi.next();
                dstroyable.destroy();
            } catch (DestroyFailedException dfe) {
                // log
            } catch (ClassCastException cce) {
                // log
            }
        }
        
        Iterator qi = publicCredentials.iterator();
        while (qi.hasNext()) {
            try {
                Destroyable dstroyable =
                        (Destroyable)qi.next();
                dstroyable.destroy();
            } catch (DestroyFailedException dfe) {
                // log
            } catch (ClassCastException cce) {
                // log
            }
        }
    
public java.lang.Class[]getSupportedMessageTypes()

        return supported;
    
public voidinitialize(javax.security.auth.message.MessagePolicy requestPolicy, javax.security.auth.message.MessagePolicy responsePolicy, javax.security.auth.callback.CallbackHandler handler, java.util.Map options)

        String bg = (String)options.get(DEBUG);
        if (bg !=null && bg.equals("true")) debug = true;
    
public javax.security.auth.message.AuthStatussecureRequest(javax.security.auth.message.MessageInfo messageInfo, javax.security.auth.Subject clientSubject)

        return AuthStatus.SUCCESS;
    
public javax.security.auth.message.AuthStatusvalidateResponse(javax.security.auth.message.MessageInfo messageInfo, javax.security.auth.Subject clientSubject, javax.security.auth.Subject serviceSubject)

        return AuthStatus.SUCCESS;