Package secParser

Examples of secParser.SecurityPolicyToken


  public Object doEncryptedElements(SecurityProcessorContext spc) {
    System.out.println("Processing "
        + spc.readCurrentSecurityToken().getTokenName() + ": "
        + SecurityProcessorContext.ACTION_NAMES[spc.getAction()]);

    SecurityPolicyToken spt = spc.readCurrentSecurityToken();
    switch (spc.getAction()) {

    case SecurityProcessorContext.START:
      if (!initializedEncryptedElements) {
        try {
          initializeEncryptedElements(spt);
          initializedEncryptedElements = true;
        } catch (NoSuchMethodException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
          return new Boolean(false);
        }
      }
      System.out.println(spt.getTokenName());
      PrimitiveAssertion pa = spc.getAssertion();
      String text = pa.getStrValue();
      if (text != null) {
        text = text.trim();
        System.out.println("Value: '" + text.toString() + "'");
View Full Code Here


  public void initializeUsernameToken(SecurityPolicyToken spt)
      throws NoSuchMethodException {
    // SecurityPolicyToken spt = secPol.usernameToken.copy();
    // spt.setProcessTokenMethod(handler);

    SecurityPolicyToken tmpSpt = SecurityPolicy.wssUsernameToken10.copy();
    tmpSpt.setProcessTokenMethod(this);
    spt.setChildToken(tmpSpt);

    tmpSpt = SecurityPolicy.wssUsernameToken11.copy();
    tmpSpt.setProcessTokenMethod(this);
    spt.setChildToken(tmpSpt);
  }
View Full Code Here

  public Object doUsernameToken(SecurityProcessorContext spc) {
    System.out.println("Processing "
        + spc.readCurrentSecurityToken().getTokenName() + ": "
        + SecurityProcessorContext.ACTION_NAMES[spc.getAction()]);

    SecurityPolicyToken spt = spc.readCurrentSecurityToken();
    switch (spc.getAction()) {

    case SecurityProcessorContext.START:
      if (!initializedUsernameToken) {
        try {
          initializeUsernameToken(spt);
          initializedUsernameToken = true;
        } catch (NoSuchMethodException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
          return new Boolean(false);
        }
      }
      System.out.println(spt.getTokenName());
      PrimitiveAssertion pa = spc.getAssertion();
      String text = pa.getStrValue();
      if (text != null) {
        text = text.trim();
        System.out.println("Value: '" + text.toString() + "'");
View Full Code Here

   *            The token that will hold the child tokens.
   * @throws NoSuchMethodException
   */
  private void initializeSignedSupportingTokens(SecurityPolicyToken spt)
      throws NoSuchMethodException {
    SecurityPolicyToken tmpSpt = SecurityPolicy.x509Token.copy();
    tmpSpt.setProcessTokenMethod(new X509TokenProcessor());
    spt.setChildToken(tmpSpt);

    tmpSpt = SecurityPolicy.usernameToken.copy();
    tmpSpt.setProcessTokenMethod(new UsernameTokenProcessor());
    spt.setChildToken(tmpSpt);

    tmpSpt = SecurityPolicy.algorithmSuite.copy();
    tmpSpt.setProcessTokenMethod(new AlgorithmSuiteProcessor());
    spt.setChildToken(tmpSpt);

    SignedPartsElementsProcessor spep = new SignedPartsElementsProcessor();
    tmpSpt = SecurityPolicy.signedParts.copy();
    tmpSpt.setProcessTokenMethod(spep);
    spt.setChildToken(tmpSpt);

    tmpSpt = SecurityPolicy.signedElements.copy();
    tmpSpt.setProcessTokenMethod(spep);
    spt.setChildToken(tmpSpt);

    EncryptedPartsElementsProcessor epep = new EncryptedPartsElementsProcessor();
    tmpSpt = SecurityPolicy.encryptedParts.copy();
    tmpSpt.setProcessTokenMethod(epep);
    spt.setChildToken(tmpSpt);

    tmpSpt = SecurityPolicy.encryptedElements.copy();
    tmpSpt.setProcessTokenMethod(epep);
    spt.setChildToken(tmpSpt);

  }
View Full Code Here

  public Object doSignedSupportingTokens(SecurityProcessorContext spc) {
    System.out.println("Processing "
        + spc.readCurrentSecurityToken().getTokenName() + ": "
        + SecurityProcessorContext.ACTION_NAMES[spc.getAction()]);
    SecurityPolicyToken spt = spc.readCurrentSecurityToken();

    switch (spc.getAction()) {

    case SecurityProcessorContext.START:
      if (!initializedSignedSupportingTokens) {
View Full Code Here

   *            The token that will hold the child tokens.
   * @throws NoSuchMethodException
   */
  public void initializeWss10(SecurityPolicyToken spt)
      throws NoSuchMethodException {
    SecurityPolicyToken tmpSpt = SecurityPolicy.mustSupportRefKeyIdentifier
        .copy();
    tmpSpt.setProcessTokenMethod(this);
    spt.setChildToken(tmpSpt);

    tmpSpt = SecurityPolicy.mustSupportRefIssuerSerial.copy();
    tmpSpt.setProcessTokenMethod(this);
    spt.setChildToken(tmpSpt);

    tmpSpt = SecurityPolicy.mustSupportRefExternalUri.copy();
    tmpSpt.setProcessTokenMethod(this);
    spt.setChildToken(tmpSpt);

    tmpSpt = SecurityPolicy.mustSupportRefEmbeddedToken.copy();
    tmpSpt.setProcessTokenMethod(this);
    spt.setChildToken(tmpSpt);
  }
View Full Code Here

  public Object doWss10(SecurityProcessorContext spc) {
    System.out.println("Processing "
        + spc.readCurrentSecurityToken().getTokenName() + ": "
        + SecurityProcessorContext.ACTION_NAMES[spc.getAction()]);

    SecurityPolicyToken spt = spc.readCurrentSecurityToken();

    switch (spc.getAction()) {

    case SecurityProcessorContext.START:
      if (!initializedWss10) {
View Full Code Here

   *            The token that will hold the child tokens.
   * @throws NoSuchMethodException
   */
  private void initializeSignatureToken(SecurityPolicyToken spt)
      throws NoSuchMethodException {
    SecurityPolicyToken tmpSpt = SecurityPolicy.x509Token.copy();
    tmpSpt.setProcessTokenMethod(new X509TokenProcessor());
    spt.setChildToken(tmpSpt);
  }
View Full Code Here

   *            The token that will hold the child tokens.
   * @throws NoSuchMethodException
   */
  private void initializeEncryptionToken(SecurityPolicyToken spt)
      throws NoSuchMethodException {
    SecurityPolicyToken tmpSpt = SecurityPolicy.x509Token.copy();
    tmpSpt.setProcessTokenMethod(new X509TokenProcessor());
    spt.setChildToken(tmpSpt);
  }
View Full Code Here

   *            The token that will hold the child tokens.
   * @throws NoSuchMethodException
   */
  private void initializeProtectionToken(SecurityPolicyToken spt)
      throws NoSuchMethodException {
    SecurityPolicyToken tmpSpt = SecurityPolicy.x509Token.copy();
    tmpSpt.setProcessTokenMethod(new X509TokenProcessor());
    spt.setChildToken(tmpSpt);
  }
View Full Code Here

TOP

Related Classes of secParser.SecurityPolicyToken

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.