Examples of WSSPolicy


Examples of com.sun.xml.wss.impl.policy.mls.WSSPolicy

      }
     @SuppressWarnings("unchecked")
      private Collection getUsernamePolicies(MessagePolicy mPolicy, CallbackHandler handler, boolean senderConfiguration)
          throws PolicyGenerationException {
          Collection requiredElements = new ArrayList();             
          WSSPolicy encryptUsernamePolicy = null;
          Iterator it = mPolicy.iterator();
          while (it.hasNext()) {
              WSSPolicy policy = (WSSPolicy)it.next();
              if (PolicyTypeUtil.authenticationTokenPolicy(policy)) {
                  if ((policy.getFeatureBinding() != null) &&
                      (PolicyTypeUtil.usernameTokenPolicy(policy.getFeatureBinding()))) {
                      if (senderConfiguration && !runtimeUsernamePassword) {
                          setUsernamePassword((AuthenticationTokenPolicy)policy, handler);
                      }
                      requiredElements.add(policy);
                  }
View Full Code Here

Examples of com.sun.xml.wss.impl.policy.mls.WSSPolicy

     @SuppressWarnings("unchecked")
     private Collection getEncryptUsernamePolicies(
          MessagePolicy mPolicy, CallbackHandler handler, boolean senderConfiguration)
          throws PolicyGenerationException {
          Collection requiredElements = new ArrayList();             
          WSSPolicy eBU =  getEncryptBodyUsernamePolicy(mPolicy);
          if (eBU != null) {
              Collection ePolicies = getNonBodyUsernameEncryptPolicies(
                  mPolicy, handler, senderConfiguration);
              requiredElements.addAll(ePolicies);
              requiredElements.add(getUsernamePolicy(mPolicy, handler, senderConfiguration));
View Full Code Here

Examples of com.sun.xml.wss.impl.policy.mls.WSSPolicy

     @SuppressWarnings("unchecked")
     private Collection getUsernameEncryptPolicies(
          MessagePolicy mPolicy, CallbackHandler handler, boolean senderConfiguration)
          throws PolicyGenerationException {
          Collection requiredElements = new ArrayList();             
          WSSPolicy eUB =  getEncryptUsernameBodyPolicy(mPolicy);
          if (eUB != null) {
              requiredElements.add(getUsernamePolicy(mPolicy, handler, senderConfiguration));
              requiredElements.add(eUB);
              Collection ePolicies = getNonBodyUsernameEncryptPolicies(
                  mPolicy, handler, senderConfiguration);
View Full Code Here

Examples of com.sun.xml.wss.impl.policy.mls.WSSPolicy

          }
          return requiredElements;
      }
      private WSSPolicy getTimestampPolicy(
          MessagePolicy mPolicy, CallbackHandler handler, boolean senderConfiguration) {
          WSSPolicy timestampPolicy = null;
          Iterator it = mPolicy.iterator();
          while (it.hasNext()) {
              WSSPolicy policy = (WSSPolicy)it.next();
              if (PolicyTypeUtil.timestampPolicy(policy)) {
                  timestampPolicy = (policy);
                  break;
              }
          }
View Full Code Here

Examples of com.sun.xml.wss.impl.policy.mls.WSSPolicy

              } else {
                 mPolicy = dConfiguration.senderSettings();
                 senderConfiguration = !senderConfiguration;
              }
              Collection newMPolicy = null;
              WSSPolicy ts = getTimestampPolicy(mPolicy, handler, senderConfiguration);
              boolean requireTimestampPolicy = false;
              switch (requiredState) {
                 case AUTHENTICATE_RECIPIENT_ONLY:
                                  // Resultant List:  (encrypt+)
                                  newMPolicy = getEncryptPolicies(mPolicy, handler, senderConfiguration);
View Full Code Here

Examples of com.sun.xml.wss.impl.policy.mls.WSSPolicy

           if (uri.startsWith("#")) {
               fragment = uri.substring(1);
           }
           Iterator it = mPolicy.iterator();
           while (it.hasNext()) {
              WSSPolicy policy = (WSSPolicy)it.next();
              if (PolicyTypeUtil.authenticationTokenPolicy(policy)) {
                  MLSPolicy feature = policy.getFeatureBinding();
                  if ((feature != null) && PolicyTypeUtil.usernameTokenPolicy(feature)) {
                      AuthenticationTokenPolicy.UsernameTokenBinding fb =
                          (AuthenticationTokenPolicy.UsernameTokenBinding)feature;
                      if (fragment.equals(fb.getUUID())) {
                          return true;
View Full Code Here

Examples of com.sun.xml.wss.impl.policy.mls.WSSPolicy

               }
           }
           return false;
       }
       private WSSPolicy getEncryptBodyUsernamePolicy(MessagePolicy mPolicy) {
           WSSPolicy ret = null;
           Iterator it = mPolicy.iterator();
           while (it.hasNext()) {
              WSSPolicy policy = (WSSPolicy)it.next();
              if (PolicyTypeUtil.encryptionPolicy(policy)) {
                  EncryptionPolicy.FeatureBinding fb =
                      (EncryptionPolicy.FeatureBinding)policy.getFeatureBinding();
                  int numTargets = fb.getTargetBindings().size();
                  if (numTargets <= 1) {
                     continue;
                  }
                  if (hasBodyFollowedByUsername((ArrayList)fb.getTargetBindings())) {
View Full Code Here

Examples of com.sun.xml.wss.impl.policy.mls.WSSPolicy

              }
           }
           return ret;
       }
       private WSSPolicy getEncryptUsernameBodyPolicy(MessagePolicy mPolicy) {
           WSSPolicy ret = null;
           Iterator it = mPolicy.iterator();
           while (it.hasNext()) {
              WSSPolicy policy = (WSSPolicy)it.next();
              if (PolicyTypeUtil.encryptionPolicy(policy)) {
                  EncryptionPolicy.FeatureBinding fb =
                      (EncryptionPolicy.FeatureBinding)policy.getFeatureBinding();
                  int numTargets = fb.getTargetBindings().size();
                  if (numTargets <= 1) {
                     continue;
                  }
                  if (hasUsernameFollowedByBody((ArrayList)fb.getTargetBindings())) {
View Full Code Here

Examples of com.sun.xml.wss.impl.policy.mls.WSSPolicy

            MessagePolicy mPolicy, CallbackHandler handler, boolean senderConfiguration) {
           Collection requiredElements = new ArrayList();
                                                                                                          
           Iterator it = mPolicy.iterator();
           while (it.hasNext()) {
              WSSPolicy policy = (WSSPolicy)it.next();
              if (PolicyTypeUtil.encryptionPolicy(policy)) {
                  if (!hasEncryptBodyPolicy((EncryptionPolicy)policy) &&
                      !hasEncryptUsernamePolicy((EncryptionPolicy)policy, mPolicy)) {
                      requiredElements.add(policy);
                  }
View Full Code Here

Examples of com.sun.xml.wss.impl.policy.mls.WSSPolicy

      private void augmentSignAlias(MessagePolicy mPolicy, String signAlias) {
          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
TOP
Copyright © 2018 www.massapi.com. 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.