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

WSITServerAuthModule

public class WSITServerAuthModule extends Object implements javax.security.auth.message.module.ServerAuthModule
author
kumar.jayanti

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

    
           
      
        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.AuthStatussecureResponse(javax.security.auth.message.MessageInfo messageInfo, javax.security.auth.Subject serviceSubject)

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

        return AuthStatus.SUCCESS;