Coverage Report - org.kuali.rice.ksb.config.xfire.XFireWSS4JInHandler
 
Classes in this File Line Coverage Branch Coverage Complexity
XFireWSS4JInHandler
0%
0/1
N/A
0
 
 1  
 /*
 2  
  * Copyright 2006-2011 The Kuali Foundation
 3  
  *
 4  
  * Licensed under the Educational Community License, Version 2.0 (the "License");
 5  
  * you may not use this file except in compliance with the License.
 6  
  * You may obtain a copy of the License at
 7  
  *
 8  
  * http://www.opensource.org/licenses/ecl2.php
 9  
  *
 10  
  * Unless required by applicable law or agreed to in writing, software
 11  
  * distributed under the License is distributed on an "AS IS" BASIS,
 12  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 13  
  * See the License for the specific language governing permissions and
 14  
  * limitations under the License.
 15  
  */
 16  
 
 17  
 package org.kuali.rice.ksb.config.xfire;
 18  
 
 19  
 /*
 20  
 import org.codehaus.xfire.MessageContext;
 21  
 import org.codehaus.xfire.fault.XFireFault;
 22  
 import org.codehaus.xfire.security.wss4j.WSS4JInHandler;
 23  
 */
 24  
 
 25  
 
 26  
 /**
 27  
  *
 28  
  * @author Kuali Rice Team (rice.collab@kuali.org)
 29  
  */
 30  
 
 31  
 //TODO: Replace this class with cxf wss4j in interceptor
 32  0
 public class XFireWSS4JInHandler{}
 33  
 /*
 34  
 public class XFireWSS4JInHandler extends WSS4JInHandler {
 35  
 
 36  
         private static final Logger LOG = Logger.getLogger(XFireWSS4JInHandler.class);
 37  
         private ServiceInfo serviceInfo;
 38  
 
 39  
         public XFireWSS4JInHandler(ServiceInfo serviceInfo) {
 40  
                 this.serviceInfo = serviceInfo;
 41  
                 this.setProperty(WSHandlerConstants.ACTION, WSHandlerConstants.SIGNATURE);
 42  
                 this.setProperty(WSHandlerConstants.PW_CALLBACK_CLASS, CryptoPasswordCallbackHandler.class.getName());
 43  
                 this.setProperty(WSHandlerConstants.SIG_KEY_ID, "IssuerSerial");
 44  
                 this.setProperty(WSHandlerConstants.USER, ConfigContext.getCurrentContextConfig().getKeystoreAlias());
 45  
         }
 46  
 
 47  
         @Override
 48  
         public Crypto loadSignatureCrypto(RequestData reqData) {
 49  
                 try {
 50  
                         return new Merlin(getMerlinProperties(), ClassLoaderUtils.getDefaultClassLoader());
 51  
                 } catch (Exception e) {
 52  
                         throw new RiceRuntimeException(e);
 53  
                 }
 54  
         }
 55  
 
 56  
         @Override
 57  
         public Crypto loadDecryptionCrypto(RequestData reqData) {
 58  
                 return loadSignatureCrypto(reqData);
 59  
         }
 60  
 
 61  
         protected Properties getMerlinProperties() {
 62  
                 Properties props = new Properties();
 63  
                 props.put("org.apache.ws.security.crypto.merlin.keystore.type", "jks");
 64  
                 props.put("org.apache.ws.security.crypto.merlin.keystore.password", ConfigContext.getCurrentContextConfig().getKeystorePassword());
 65  
                 props.put("org.apache.ws.security.crypto.merlin.alias.password", ConfigContext.getCurrentContextConfig().getKeystorePassword());
 66  
                 props.put("org.apache.ws.security.crypto.merlin.keystore.alias", ConfigContext.getCurrentContextConfig().getKeystoreAlias());
 67  
                 props.put("org.apache.ws.security.crypto.merlin.file", ConfigContext.getCurrentContextConfig().getKeystoreFile());
 68  
 
 69  
                 if (LOG.isDebugEnabled()) {
 70  
                         LOG.debug("Using keystore location " + ConfigContext.getCurrentContextConfig().getKeystoreFile());
 71  
                 }
 72  
                 return props;
 73  
         }
 74  
 
 75  
         @Override
 76  
         public void invoke(MessageContext context) throws XFireFault {
 77  
                 if (getServiceInfo().getServiceDefinition().getBusSecurity()) {
 78  
                         super.invoke(context);
 79  
                 }
 80  
         }
 81  
 
 82  
         public ServiceInfo getServiceInfo() {
 83  
                 return serviceInfo;
 84  
         }
 85  
 
 86  
         public void setServiceInfo(ServiceInfo serviceInfo) {
 87  
                 this.serviceInfo = serviceInfo;
 88  
         }
 89  
 
 90  
 }
 91  
 */