001/**
002 * Copyright 2005-2016 The Kuali Foundation
003 *
004 * Licensed under the Educational Community License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.opensource.org/licenses/ecl2.php
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016package org.kuali.rice.ksb.config.xfire;
017
018/*
019import org.codehaus.xfire.MessageContext;
020import org.codehaus.xfire.fault.XFireFault;
021import org.codehaus.xfire.security.wss4j.WSS4JInHandler;
022*/
023
024
025/**
026 *
027 * @author Kuali Rice Team (rice.collab@kuali.org)
028 */
029
030//TODO: Replace this class with cxf wss4j in interceptor
031public class XFireWSS4JInHandler{}
032/*
033public class XFireWSS4JInHandler extends WSS4JInHandler {
034
035        private static final Logger LOG = Logger.getLogger(XFireWSS4JInHandler.class);
036        private ServiceInfo serviceInfo;
037
038        public XFireWSS4JInHandler(ServiceInfo serviceInfo) {
039                this.serviceInfo = serviceInfo;
040                this.setProperty(WSHandlerConstants.ACTION, WSHandlerConstants.SIGNATURE);
041                this.setProperty(WSHandlerConstants.PW_CALLBACK_CLASS, CryptoPasswordCallbackHandler.class.getName());
042                this.setProperty(WSHandlerConstants.SIG_KEY_ID, "IssuerSerial");
043                this.setProperty(WSHandlerConstants.USER, ConfigContext.getCurrentContextConfig().getKeystoreAlias());
044        }
045
046        @Override
047        public Crypto loadSignatureCrypto(RequestData reqData) {
048                try {
049                        return new Merlin(getMerlinProperties(), ClassLoaderUtils.getDefaultClassLoader());
050                } catch (Exception e) {
051                        throw new RiceRuntimeException(e);
052                }
053        }
054
055        @Override
056        public Crypto loadDecryptionCrypto(RequestData reqData) {
057                return loadSignatureCrypto(reqData);
058        }
059
060        protected Properties getMerlinProperties() {
061                Properties props = new Properties();
062                props.put("org.apache.ws.security.crypto.merlin.keystore.type", "jks");
063                props.put("org.apache.ws.security.crypto.merlin.keystore.password", ConfigContext.getCurrentContextConfig().getKeystorePassword());
064                props.put("org.apache.ws.security.crypto.merlin.alias.password", ConfigContext.getCurrentContextConfig().getKeystorePassword());
065                props.put("org.apache.ws.security.crypto.merlin.keystore.alias", ConfigContext.getCurrentContextConfig().getKeystoreAlias());
066                props.put("org.apache.ws.security.crypto.merlin.file", ConfigContext.getCurrentContextConfig().getKeystoreFile());
067
068                if (LOG.isDebugEnabled()) {
069                        LOG.debug("Using keystore location " + ConfigContext.getCurrentContextConfig().getKeystoreFile());
070                }
071                return props;
072        }
073
074        @Override
075        public void invoke(MessageContext context) throws XFireFault {
076                if (getServiceInfo().getServiceDefinition().getBusSecurity()) {
077                        super.invoke(context);
078                }
079        }
080
081        public ServiceInfo getServiceInfo() {
082                return serviceInfo;
083        }
084
085        public void setServiceInfo(ServiceInfo serviceInfo) {
086                this.serviceInfo = serviceInfo;
087        }
088
089}
090*/