コード例 #1
0
  public List<SelectItem> getSecurityMechanismForWscList() {
    List<SelectItem> items = new ArrayList<SelectItem>();

    for (int i = 0; i < getWspSecurityMechanisms().length; i++) {
      SecurityMechanism securityMechanism =
          SecurityMechanism.valueOf(getWspSecurityMechanisms()[i]);
      items.add(new SelectItem(securityMechanism.toInt(), securityMechanism.toLocaleString()));
    }

    // STS Security is always an option for the WSC
    items.add(
        new SelectItem(
            SecurityMechanism.STS_SECURITY.toInt(),
            SecurityMechanism.STS_SECURITY.toLocaleString()));

    return items;
  }
コード例 #2
0
  private void initialize() {

    this.setWspServiceEndPoint("http://<wsp-host-name:portnumber>/<webService>");
    this.setWspSecurityMechanisms(
        new Integer[] {
          SecurityMechanism.SAML2_HOK.toInt(),
          SecurityMechanism.SAML2_SV.toInt(),
          SecurityMechanism.USERNAME_TOKEN.toInt(),
          SecurityMechanism.X509_TOKEN.toInt()
        });
    this.setWspAuthenticationChain(null);

    this.setResponseSigned(false);
    this.setResponseEncrypted(false);
    this.setRequestSignatureVerified(true);
    this.setRequestHeaderDecrypted(false);
    this.setRequestDecrypted(false);

    this.setWscServiceName("WebServiceName");
    this.setWscSecurityMechanism(SecurityMechanism.STS_SECURITY.toInt());
    this.setConfigureWsc(false);

    this.setEncryptionAlgorithm(EncryptionAlgorithm.AES_256.toInt());
    this.setUserNameTokenUserName(null);
    this.setUserNameTokenPassword(null);
    this.setX509TokenSigningReferenceType(X509SigningRefType.DIRECT.toInt());
    this.setKerberosDomain(null);
    this.setKerberosDomainServer(null);
    this.setKerberosServicePrincipal(null);
    this.setKerberosTicketCache(null);

    List<SelectItem> stsConfigs = this.getStsConfigurationNameList();
    if (stsConfigs.size() == 1) {
      SelectItem stsConfig = stsConfigs.iterator().next();
      this.setStsConfigurationName((String) stsConfig.getValue());
    } else {
      this.setStsConfigurationName(null);
    }

    List<SelectItem> aliases = this.getPrivateKeyAliasList();
    if (aliases.size() == 1) {
      SelectItem alias = aliases.iterator().next();
      this.setPrivateKeyAlias(alias.getLabel());
    } else {
      this.setPrivateKeyAlias(null);
    }

    aliases = this.getPublicKeyAliasList();
    if (aliases.size() == 1) {
      SelectItem alias = aliases.iterator().next();
      this.setPublicKeyAlias(alias.getLabel());
    } else {
      this.setPublicKeyAlias(null);
    }

    this.setSummaryRealm(new WssCreateWizardSummaryRealm(this));
    this.setSummaryServiceEndPoint(new WssCreateWizardSummaryServiceEndPoint(this));
    this.setSummaryWspSecurity(new WssCreateWizardSummaryWspSecurity(this));
    this.setSummaryServiceName(new WssCreateWizardSummaryServiceName(this));
    this.setSummaryWscSecurity(new WssCreateWizardSummaryWscSecurity(this));
    this.setSummarySignEncrypt(new WssCreateWizardSummarySignEncrypt(this));
    this.setSummaryKeyAliases(new WssCreateWizardSummaryKeyAliases(this));
    this.setSummaryEncryptAlgorithm(new WssCreateWizardSummaryEncryptAlgorithm(this));
  }