Package com.sun.xml.wss.impl.policy

Examples of com.sun.xml.wss.impl.policy.SecurityPolicy


            SignatureMethod sm = (SignatureMethod) method;
            List list = keyInfo.getContent();
            JAXBFilterProcessingContext wssContext = (JAXBFilterProcessingContext) context.get(MessageConstants.WSS_PROCESSING_CONTEXT);

            SecurityPolicy securityPolicy = wssContext.getSecurityPolicy();
            boolean isBSP = false;
            if (securityPolicy != null) {
                if (PolicyTypeUtil.messagePolicy(securityPolicy)) {
                    isBSP = ((MessagePolicy) securityPolicy).isBSP();
                } else {
View Full Code Here


    private static Key resolve(JAXBElement securityTokenReference, XMLCryptoContext context, Purpose purpose) throws KeySelectorException {
        try {
            JAXBFilterProcessingContext wssContext = (JAXBFilterProcessingContext) context.get(MessageConstants.WSS_PROCESSING_CONTEXT);
            boolean isPolicyRecipient = (wssContext.getMode() == JAXBFilterProcessingContext.WSDL_POLICY);

            SecurityPolicy securityPolicy = wssContext.getSecurityPolicy();
            boolean isBSP = false;
            if (securityPolicy != null) {
                if (PolicyTypeUtil.messagePolicy(securityPolicy)) {
                    isBSP = ((MessagePolicy) securityPolicy).isBSP();
                } else {
View Full Code Here

           
            return declarations;
           
        } else if (DECLARATIVE_CONFIGURATION_ELEMENT_QNAME.equals(qname)) {
            if (dynamicPolicy(configData)) {
                SecurityPolicy declarations = new DynamicSecurityPolicy();
                return declarations;
            }
            DeclarativeSecurityConfiguration declarations =
                    new DeclarativeSecurityConfiguration();
            readContainerForBaseConfigurationData(
View Full Code Here

                    "Empty/Missing algorithm attribute on " +
                    keyEncSettings.getTagName());
           
        }
        checkCompatibility(algorithm, keyEncSettings);
        SecurityPolicy keyBinding = encryptionPolicy.getKeyBinding();
        if (keyBinding == null) {
            keyBinding =
                    encryptionPolicy.newX509CertificateKeyBinding();
            ((AuthenticationTokenPolicy.X509CertificateBinding)keyBinding).
                    setReferenceType(MessageConstants.DIRECT_REFERENCE_TYPE);
View Full Code Here

                    "Empty/Missing algorithm attribute on " +
                    sigMethodSettings.getTagName());
           
        }
       
        SecurityPolicy keyBinding = signaturePolicy.getKeyBinding();
        if (keyBinding == null) {
            keyBinding =
                    signaturePolicy.newX509CertificateKeyBinding();
            ((AuthenticationTokenPolicy.X509CertificateBinding)keyBinding).
                    setReferenceType(MessageConstants.DIRECT_REFERENCE_TYPE);
View Full Code Here

    throws XWSSecurityException {
       
        HarnessUtil.validateContext(context);
        FilterProcessingContext fpContext = new FilterProcessingContext(context);
        fpContext.isInboundMessage(true);
        SecurityPolicy pol = fpContext.getSecurityPolicy();
        MessagePolicy msgPolicy = null;
        List<MessagePolicy> messagePolicies = null;

        //we have to retain this stuff for old Metro 2.0 style backward compatibility
        if (pol instanceof MessagePolicy) {
View Full Code Here

          if (signAlias == null) {
              return;
          }
          for (Iterator it = mPolicy.iterator(); it.hasNext();) {
              WSSPolicy sp = (WSSPolicy)it.next();
              SecurityPolicy keyBinding = sp.getKeyBinding();
              if (sp instanceof SignaturePolicy) {
                  if ((keyBinding != null) && (keyBinding instanceof AuthenticationTokenPolicy.X509CertificateBinding)) {
                      AuthenticationTokenPolicy.X509CertificateBinding x509KB =
                          (AuthenticationTokenPolicy.X509CertificateBinding)keyBinding;
                      String certId = x509KB.getCertificateIdentifier();
View Full Code Here

          if (encryptAlias == null) {
              return;
          }
          for (Iterator it = mPolicy.iterator(); it.hasNext();) {
              WSSPolicy sp = (WSSPolicy)it.next();
              SecurityPolicy keyBinding = sp.getKeyBinding();
              if (sp instanceof EncryptionPolicy) {
                  if ((keyBinding != null) && (keyBinding instanceof AuthenticationTokenPolicy.X509CertificateBinding)) {
                      AuthenticationTokenPolicy.X509CertificateBinding x509KB =
                          (AuthenticationTokenPolicy.X509CertificateBinding)keyBinding;
                      String certId = x509KB.getCertificateIdentifier();
View Full Code Here

                MessagePolicy policy = sph.getMessagePolicy();
                ArrayList list = policy.getPrimaryPolicies();
                Iterator i = list.iterator();
                boolean breakOuterLoop = false;
                while (i.hasNext()) {
                    SecurityPolicy primaryPolicy = (SecurityPolicy) i.next();
                    if (PolicyTypeUtil.encryptionPolicy(primaryPolicy)) {
                        EncryptionPolicy encPolicy = (EncryptionPolicy) primaryPolicy;
                        EncryptionPolicy.FeatureBinding featureBinding = (EncryptionPolicy.FeatureBinding) encPolicy.getFeatureBinding();
                        ArrayList targetList = featureBinding.getTargetBindings();
                        ListIterator iterator = targetList.listIterator();
View Full Code Here

    public static void validateMessage(ProcessingContext context)
    throws XWSSecurityException {
       
        HarnessUtil.validateContext(context);
       
        SecurityPolicy policy = context.getSecurityPolicy();
        StaticPolicyContext staticContext = context.getPolicyContext();
       
        FilterProcessingContext fpContext = new FilterProcessingContext(context);
        fpContext.isInboundMessage(true);

        //MessagePolicy msgPolicy = (MessagePolicy) fpContext.getSecurityPolicy();
        if(true /*msgPolicy.enableWSS11Policy()*/){
            // set a property in context to determine if its WSS11
            fpContext.setExtraneousProperty("EnableWSS11PolicyReceiver","true");
        }

        //TODO: enable this after policy is available for incoming msgs
        if (true /*msgPolicy.enableSignatureConfirmation()*/) {
            //For SignatureConfirmation
            //Set a list in extraneous property which will store all the received SignatureValues
            //If there was no Signature in incoming message this list will be empty
            List scList = new ArrayList();
            fpContext.setExtraneousProperty("receivedSignValues", scList);
        }       
        if (policy != null) {
           
            if ( PolicyTypeUtil.messagePolicy(policy) &&
                    !PolicyTypeUtil.applicationSecurityConfiguration(policy) &&
                    ((MessagePolicy)policy).enableDynamicPolicy() &&
                    ((MessagePolicy)policy).size() == 0) {
                policy = new com.sun.xml.wss.impl.policy.mls.DynamicSecurityPolicy();
            }
           
            if (PolicyTypeUtil.dynamicSecurityPolicy(policy)) {
               
                // create dynamic callback context
                DynamicApplicationContext dynamicContext = new DynamicApplicationContext(staticContext);
                dynamicContext.setMessageIdentifier(context.getMessageIdentifier());
                dynamicContext.inBoundMessage(true);
                ProcessingContext.copy(dynamicContext.getRuntimeProperties(), context.getExtraneousProperties());
               
                // make dynamic policy callback
                DynamicPolicyCallback dpCallback = new DynamicPolicyCallback(policy, dynamicContext);
                HarnessUtil.makeDynamicPolicyCallback(dpCallback,
                        context.getSecurityEnvironment().getCallbackHandler());
               
               
                SecurityPolicy result = dpCallback.getSecurityPolicy();
                fpContext.setSecurityPolicy(result);
                fpContext.setMode(FilterProcessingContext.ADHOC);
               
                if (PolicyTypeUtil.messagePolicy(result)) {
                    processMessagePolicy(fpContext);
View Full Code Here

TOP

Related Classes of com.sun.xml.wss.impl.policy.SecurityPolicy

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.