Package org.apache.ws.security.policy.parser

Examples of org.apache.ws.security.policy.parser.SecurityPolicyToken


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


  public Object doSignedParts(SecurityProcessorContext spc) {
    log.debug("Processing "
        + spc.readCurrentSecurityToken().getTokenName() + ": "
        + SecurityProcessorContext.ACTION_NAMES[spc.getAction()]);

    SecurityPolicyToken spt = spc.readCurrentSecurityToken();

    switch (spc.getAction()) {

    case SecurityProcessorContext.START:
      if (!initializedSignedParts) {
        try {
          initializeSignedParts(spt);
                    SignedEncryptedParts parts = (SignedEncryptedParts) spc
                            .readCurrentPolicyEngineData();
                    PolicyEngineData parent = spc
                            .readPreviousPolicyEngineData();
                    if (parent instanceof SupportingToken) {
                        // Parent is a supporting token
                        ((SupportingToken) parent).setSignedParts(parts);
                    }
          initializedSignedParts = true;
        } catch (NoSuchMethodException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
          return new Boolean(false);
        }
      }
      log.debug(spt.getTokenName());
      PrimitiveAssertion pa = spc.getAssertion();
      String text = pa.getStrValue();
      if (text != null) {
        text = text.trim();
        log.debug("Value: '" + text.toString() + "'");
View Full Code Here

  public Object doSignedElements(SecurityProcessorContext spc) {
    log.debug("Processing "
        + spc.readCurrentSecurityToken().getTokenName() + ": "
        + SecurityProcessorContext.ACTION_NAMES[spc.getAction()]);

    SecurityPolicyToken spt = spc.readCurrentSecurityToken();

    switch (spc.getAction()) {

    case SecurityProcessorContext.START:
      if (!initializedSignedElements) {
        try {
          initializeSignedElements(spt);
                    SignedEncryptedElements elements = (SignedEncryptedElements) spc
                            .readCurrentPolicyEngineData();
                    PolicyEngineData parent = spc
                            .readPreviousPolicyEngineData();
                    if (parent instanceof SupportingToken) {
                        // Parent is a supporting token
                        ((SupportingToken) parent)
                                .setSignedElements(elements);
                    }
          initializedSignedElements = true;
        } catch (NoSuchMethodException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
          return new Boolean(false);
        }
      }
      log.debug(spt.getTokenName());
      PrimitiveAssertion pa = spc.getAssertion();
      String text = pa.getStrValue();
      if (text != null) {
        text = text.trim();
        log.debug("Value: '" + text.toString() + "'");
View Full Code Here

   * @throws NoSuchMethodException
   */
  private void initializeX509Token(SecurityPolicyToken spt)
      throws NoSuchMethodException {

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

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

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

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

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

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

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

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

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

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

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

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

                .debug("Processing "
                        + spc.readCurrentSecurityToken().getTokenName()
                        + ": "
                        + SecurityProcessorContext.ACTION_NAMES[spc.getAction()]);

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

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

   */
  private void initializeAsymmetricBinding(SecurityPolicyToken spt)
      throws NoSuchMethodException {

    InitiatorRecipientTokenProcessor irt = new InitiatorRecipientTokenProcessor();
    SecurityPolicyToken tmpSpt = SecurityPolicy.initiatorToken.copy();
    tmpSpt.setProcessTokenMethod(irt);
    spt.setChildToken(tmpSpt);

    tmpSpt = SecurityPolicy.recipientToken.copy();
    tmpSpt.setProcessTokenMethod(irt);
    spt.setChildToken(tmpSpt);

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

    tmpSpt = SecurityPolicy.layout.copy();
    tmpSpt.setProcessTokenMethod(new LayoutProcessor());
    spt.setChildToken(tmpSpt);

//    tmpSpt = SecurityPolicy.supportingTokens.copy();
//    tmpSpt.setProcessTokenMethod(new SupportingTokensProcessor());
//    spt.setChildToken(tmpSpt);
//
//    tmpSpt = SecurityPolicy.signedSupportingTokens.copy();
//    tmpSpt.setProcessTokenMethod(new SignedSupportingTokensProcessor());
//    spt.setChildToken(tmpSpt);
//
//    tmpSpt = SecurityPolicy.endorsingSupportingTokens.copy();
//    tmpSpt.setProcessTokenMethod(new EndorsingSupportingTokensProcessor());
//    spt.setChildToken(tmpSpt);
//
//    tmpSpt = SecurityPolicy.signedEndorsingSupportingTokens.copy();
//    tmpSpt.setProcessTokenMethod(new SignedEndorsingSupportingTokensProcessor());
//    spt.setChildToken(tmpSpt);

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

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

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

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

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

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

  }
View Full Code Here

  public Object doAsymmetricBinding(SecurityProcessorContext spc) {
    log.debug("Processing "
        + spc.readCurrentSecurityToken().getTokenName() + ": "
        + SecurityProcessorContext.ACTION_NAMES[spc.getAction()]);
    SecurityPolicyToken spt = spc.readCurrentSecurityToken();

    switch (spc.getAction()) {

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

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

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

  }
View Full Code Here

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

  public Object doEncryptedParts(SecurityProcessorContext spc) {
    log.debug("Processing "
        + spc.readCurrentSecurityToken().getTokenName() + ": "
        + SecurityProcessorContext.ACTION_NAMES[spc.getAction()]);

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

    case SecurityProcessorContext.START:
      if (!initializedEncryptedParts) {
        try {
          initializeEncryptedParts(spt);
                    SignedEncryptedParts parts = (SignedEncryptedParts) spc
                            .readCurrentPolicyEngineData();
                    PolicyEngineData parent = spc.readPreviousPolicyEngineData();
                    if(parent instanceof SupportingToken) {
                        //Parent is a supporting token
                        ((SupportingToken)parent).setEncryptedParts(parts);
                    }
          initializedEncryptedParts = true;
        } catch (NoSuchMethodException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
          return new Boolean(false);
        }
      }
      log.debug(spt.getTokenName());
      PrimitiveAssertion pa = spc.getAssertion();
      String text = pa.getStrValue();
      if (text != null) {
        text = text.trim();
        log.debug("Value: '" + text.toString() + "'");
View Full Code Here

TOP

Related Classes of org.apache.ws.security.policy.parser.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.