ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gi...@apache.org
Subject svn commit: r1172285 [24/48] - in /webservices/wss4j/branches/swssf: ./ cxf-integration/ cxf-integration/src/ cxf-integration/src/main/ cxf-integration/src/main/java/ cxf-integration/src/main/java/org/ cxf-integration/src/main/java/org/swssf/ cxf-integ...
Date Sun, 18 Sep 2011 13:51:36 GMT
Added: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/securityToken/SAMLSecurityToken.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/securityToken/SAMLSecurityToken.java?rev=1172285&view=auto
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/securityToken/SAMLSecurityToken.java (added)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/securityToken/SAMLSecurityToken.java Sun Sep 18 13:51:23 2011
@@ -0,0 +1,112 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.swssf.impl.securityToken;
+
+import org.opensaml.common.SAMLVersion;
+import org.swssf.crypto.Crypto;
+import org.swssf.ext.Constants;
+import org.swssf.ext.SecurityContext;
+import org.swssf.ext.SecurityToken;
+import org.swssf.ext.WSSecurityException;
+import org.swssf.impl.saml.SAMLKeyInfo;
+
+import javax.security.auth.callback.CallbackHandler;
+import java.security.Key;
+import java.security.PublicKey;
+import java.security.cert.CertificateExpiredException;
+import java.security.cert.CertificateNotYetValidException;
+import java.security.cert.X509Certificate;
+
+/**
+ * @author $Author$
+ * @version $Revision$ $Date$
+ */
+public class SAMLSecurityToken extends AbstractAlgorithmSuiteSecurityEventFiringSecurityToken {
+
+    private SAMLVersion samlVersion;
+    private SAMLKeyInfo samlKeyInfo;
+    private X509Certificate[] x509Certificate;
+
+    public SAMLSecurityToken(SAMLVersion samlVersion, SAMLKeyInfo samlKeyInfo, SecurityContext securityContext, Crypto crypto, CallbackHandler callbackHandler, String id, Object processor) {
+        super(securityContext, crypto, callbackHandler, id, processor);
+        this.samlVersion = samlVersion;
+        this.samlKeyInfo = samlKeyInfo;
+    }
+
+    public boolean isAsymmetric() {
+        return true;
+    }
+
+    public Key getSecretKey(String algorithmURI, Constants.KeyUsage keyUsage) throws WSSecurityException {
+        super.getSecretKey(algorithmURI, keyUsage);
+        return samlKeyInfo.getPrivateKey();
+    }
+
+    public PublicKey getPublicKey(Constants.KeyUsage keyUsage) throws WSSecurityException {
+        super.getPublicKey(keyUsage);
+        PublicKey publicKey = samlKeyInfo.getPublicKey();
+        if (publicKey == null) {
+            publicKey = getX509Certificates()[0].getPublicKey();
+        }
+        return publicKey;
+    }
+
+    public X509Certificate[] getX509Certificates() throws WSSecurityException {
+        if (this.x509Certificate == null) {
+            this.x509Certificate = samlKeyInfo.getCerts();
+        }
+        return this.x509Certificate;
+    }
+
+    public void verify() throws WSSecurityException {
+        try {
+            X509Certificate[] x509Certificates = getX509Certificates();
+            if (x509Certificates != null && x509Certificates.length > 0) {
+                x509Certificates[0].checkValidity();
+                getCrypto().verifyTrust(x509Certificates);
+            }
+        } catch (CertificateExpiredException e) {
+            throw new WSSecurityException(WSSecurityException.ErrorCode.FAILED_CHECK, e);
+        } catch (CertificateNotYetValidException e) {
+            throw new WSSecurityException(WSSecurityException.ErrorCode.FAILED_CHECK, e);
+        }
+    }
+
+    public SecurityToken getKeyWrappingToken() {
+        return null;
+    }
+
+    public String getKeyWrappingTokenAlgorithm() {
+        return null;
+    }
+
+    public Constants.TokenType getTokenType() {
+        if (samlVersion == SAMLVersion.VERSION_10) {
+            return Constants.TokenType.Saml10Token;
+        } else if (samlVersion == SAMLVersion.VERSION_11) {
+            return Constants.TokenType.Saml11Token;
+        }
+        return Constants.TokenType.Saml20Token;
+    }
+
+    public SAMLKeyInfo getSamlKeyInfo() {
+        //todo AlgoSecEvent?
+        return samlKeyInfo;
+    }
+}

Propchange: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/securityToken/SAMLSecurityToken.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/securityToken/SecurityTokenFactory.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/securityToken/SecurityTokenFactory.java?rev=1172285&view=auto
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/securityToken/SecurityTokenFactory.java (added)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/securityToken/SecurityTokenFactory.java Sun Sep 18 13:51:23 2011
@@ -0,0 +1,163 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.swssf.impl.securityToken;
+
+import org.apache.commons.codec.binary.Base64;
+import org.oasis_open.docs.wss._2004._01.oasis_200401_wss_wssecurity_secext_1_0.BinarySecurityTokenType;
+import org.oasis_open.docs.wss._2004._01.oasis_200401_wss_wssecurity_secext_1_0.KeyIdentifierType;
+import org.oasis_open.docs.wss._2004._01.oasis_200401_wss_wssecurity_secext_1_0.SecurityTokenReferenceType;
+import org.oasis_open.docs.wss._2004._01.oasis_200401_wss_wssecurity_secext_1_0.UsernameTokenType;
+import org.opensaml.common.SAMLVersion;
+import org.swssf.crypto.Crypto;
+import org.swssf.ext.*;
+import org.swssf.impl.saml.SAMLKeyInfo;
+import org.w3._2000._09.xmldsig_.KeyInfoType;
+
+import javax.security.auth.callback.CallbackHandler;
+import javax.xml.stream.events.XMLEvent;
+import java.util.Deque;
+
+/**
+ * Factory to create SecurityToken Objects from keys in XML
+ *
+ * @author $Author$
+ * @version $Revision$ $Date$
+ */
+public class SecurityTokenFactory {
+
+    private SecurityTokenFactory() {
+    }
+
+    public synchronized static SecurityTokenFactory newInstance() throws WSSecurityException {
+        return new SecurityTokenFactory();
+    }
+
+    public SecurityToken getSecurityToken(KeyInfoType keyInfoType, Crypto crypto, final CallbackHandler callbackHandler, SecurityContext securityContext, Object processor) throws WSSecurityException {
+        if (keyInfoType != null) {
+            return getSecurityToken(keyInfoType.getSecurityTokenReferenceType(), crypto, callbackHandler, securityContext, processor);
+        } else if (crypto.getDefaultX509Alias() != null) {
+            return new X509DefaultSecurityToken(securityContext, crypto, callbackHandler, crypto.getDefaultX509Alias(), crypto.getDefaultX509Alias(), processor);
+        }
+        throw new WSSecurityException(WSSecurityException.ErrorCode.INVALID_SECURITY, "noKeyinfo");
+    }
+
+    public SecurityToken getSecurityToken(SecurityTokenReferenceType securityTokenReferenceType, Crypto crypto, final CallbackHandler callbackHandler, SecurityContext securityContext, Object processor) throws WSSecurityException {
+        try {
+            if (securityTokenReferenceType == null) {
+                throw new WSSecurityException(WSSecurityException.ErrorCode.INVALID_SECURITY, "noSecTokRef");
+            }
+
+            if (securityTokenReferenceType.getX509DataType() != null) {
+                return new DelegatingSecurityToken(Constants.KeyIdentifierType.ISSUER_SERIAL, new X509DataSecurityToken(securityContext, crypto, callbackHandler, securityTokenReferenceType.getX509DataType(), securityTokenReferenceType.getId(), processor));
+            }
+            //todo this is not supported by outputProcessor but can be implemented. We'll have a look at the spec if this is allowed
+            else if (securityTokenReferenceType.getKeyIdentifierType() != null) {
+                KeyIdentifierType keyIdentifierType = securityTokenReferenceType.getKeyIdentifierType();
+
+                String valueType = keyIdentifierType.getValueType();
+                String encodingType = keyIdentifierType.getEncodingType();
+
+                byte[] binaryContent = null;
+                if (Constants.SOAPMESSAGE_NS10_BASE64_ENCODING.equals(encodingType)) {
+                    binaryContent = Base64.decodeBase64(keyIdentifierType.getValue());
+                }
+
+                if (Constants.NS_X509_V3_TYPE.equals(valueType)) {
+                    return new X509_V3SecurityToken(securityContext, crypto, callbackHandler, binaryContent, securityTokenReferenceType.getId(), processor);
+                } else if (Constants.NS_X509SubjectKeyIdentifier.equals(valueType)) {
+                    return new X509SubjectKeyIdentifierSecurityToken(securityContext, crypto, callbackHandler, binaryContent, securityTokenReferenceType.getId(), processor);
+                } else if (Constants.NS_THUMBPRINT.equals(valueType)) {
+                    return new ThumbprintSHA1SecurityToken(securityContext, crypto, callbackHandler, binaryContent, securityTokenReferenceType.getId(), processor);
+                } else if (Constants.NS_SAML10_TYPE.equals(valueType) || Constants.NS_SAML20_TYPE.equals(valueType)) {
+                    SecurityTokenProvider securityTokenProvider = securityContext.getSecurityTokenProvider(keyIdentifierType.getValue());
+                    if (securityTokenProvider == null) {
+                        throw new WSSecurityException(WSSecurityException.ErrorCode.SECURITY_TOKEN_UNAVAILABLE, "noToken", keyIdentifierType.getValue());
+                    }
+                    return securityTokenProvider.getSecurityToken(crypto);
+                }
+            } else if (securityTokenReferenceType.getReferenceType() != null) {
+
+                String uri = securityTokenReferenceType.getReferenceType().getURI();
+                if (uri == null) {
+                    throw new WSSecurityException("badReferenceURI");
+                }
+                uri = Utils.dropReferenceMarker(uri);
+                //embedded BST:
+                if (securityTokenReferenceType.getReferenceType().getBinarySecurityTokenType() != null
+                        && uri.equals(securityTokenReferenceType.getReferenceType().getBinarySecurityTokenType().getId())) {
+                    BinarySecurityTokenType binarySecurityTokenType = securityTokenReferenceType.getReferenceType().getBinarySecurityTokenType();
+                    return new DelegatingSecurityToken(Constants.KeyIdentifierType.BST_EMBEDDED, getSecurityToken(binarySecurityTokenType, securityContext, crypto, callbackHandler, processor));
+                } else {//referenced BST:
+                    //we have to search BST somewhere in the doc. First we will check for a BST already processed and
+                    //stored in the context. Otherwise we will abort now.
+
+                    //prevent recursive key reference DOS:
+                    Integer invokeCount = securityContext.<Integer>get("" + Thread.currentThread().hashCode());
+                    if (invokeCount == null) {
+                        invokeCount = 0;
+                    }
+                    invokeCount++;
+                    if (invokeCount == 10) {
+                        throw new WSSecurityException(WSSecurityException.ErrorCode.INVALID_SECURITY_TOKEN);
+                    }
+                    securityContext.put("" + Thread.currentThread().hashCode(), invokeCount);
+
+                    SecurityTokenProvider securityTokenProvider = securityContext.getSecurityTokenProvider(uri);
+                    if (securityTokenProvider == null) {
+                        throw new WSSecurityException(WSSecurityException.ErrorCode.SECURITY_TOKEN_UNAVAILABLE, "noToken", uri);
+                    }
+                    return new DelegatingSecurityToken(Constants.KeyIdentifierType.BST_DIRECT_REFERENCE, securityTokenProvider.getSecurityToken(crypto));
+                }
+            }
+            throw new WSSecurityException(WSSecurityException.ErrorCode.INVALID_SECURITY, "noKeyinfo");
+        } finally {
+            securityContext.remove("" + Thread.currentThread().hashCode());
+        }
+    }
+
+    public SecurityToken getSecurityToken(BinarySecurityTokenType binarySecurityTokenType, SecurityContext securityContext, Crypto crypto, CallbackHandler callbackHandler, Object processor) throws WSSecurityException {
+
+        //only Base64Encoding is supported
+        if (!Constants.SOAPMESSAGE_NS10_BASE64_ENCODING.equals(binarySecurityTokenType.getEncodingType())) {
+            throw new WSSecurityException(WSSecurityException.ErrorCode.INVALID_SECURITY_TOKEN, "badEncoding", binarySecurityTokenType.getEncodingType());
+        }
+
+        byte[] securityTokenData = Base64.decodeBase64(binarySecurityTokenType.getValue());
+
+        if (Constants.NS_X509_V3_TYPE.equals(binarySecurityTokenType.getValueType())) {
+            return new X509_V3SecurityToken(securityContext, crypto, callbackHandler, securityTokenData, binarySecurityTokenType.getId(), processor);
+        } else if (Constants.NS_X509PKIPathv1.equals(binarySecurityTokenType.getValueType())) {
+            return new X509PKIPathv1SecurityToken(securityContext, crypto, callbackHandler, securityTokenData, binarySecurityTokenType.getId(), processor);
+        } else {
+            throw new WSSecurityException(WSSecurityException.ErrorCode.INVALID_SECURITY_TOKEN, "invalidValueType", binarySecurityTokenType.getValueType());
+        }
+    }
+
+    public SecurityToken getSecurityToken(UsernameTokenType usernameTokenType, SecurityContext securityContext, Object processor) throws WSSecurityException {
+        return new UsernameSecurityToken(usernameTokenType, securityContext, usernameTokenType.getId(), processor);
+    }
+
+    public SecurityToken getSecurityToken(SAMLVersion samlVersion, SAMLKeyInfo samlKeyInfo, SecurityContext securityContext, Crypto crypto, CallbackHandler callbackHandler, String id, Object processor) throws WSSecurityException {
+        return new SAMLSecurityToken(samlVersion, samlKeyInfo, securityContext, crypto, callbackHandler, id, processor);
+    }
+
+    public SecurityToken getSecurityToken(String referencedTokenId, Deque<XMLEvent> xmlEvents, Crypto crypto, CallbackHandler callbackHandler, SecurityContext securityContext, String id, Object processor) throws WSSecurityException {
+        return new SecurityTokenReference(securityContext.getSecurityTokenProvider(referencedTokenId).getSecurityToken(crypto), xmlEvents, crypto, callbackHandler, id, processor);
+    }
+}

Propchange: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/securityToken/SecurityTokenFactory.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/securityToken/SecurityTokenReference.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/securityToken/SecurityTokenReference.java?rev=1172285&view=auto
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/securityToken/SecurityTokenReference.java (added)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/securityToken/SecurityTokenReference.java Sun Sep 18 13:51:23 2011
@@ -0,0 +1,83 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.swssf.impl.securityToken;
+
+import org.swssf.crypto.Crypto;
+import org.swssf.ext.Constants;
+import org.swssf.ext.SecurityToken;
+import org.swssf.ext.WSSecurityException;
+
+import javax.security.auth.callback.CallbackHandler;
+import javax.xml.stream.events.XMLEvent;
+import java.security.Key;
+import java.security.PublicKey;
+import java.security.cert.X509Certificate;
+import java.util.Deque;
+
+/**
+ * @author $Author$
+ * @version $Revision$ $Date$
+ */
+public class SecurityTokenReference extends AbstractSecurityToken {
+
+    private SecurityToken securityToken;
+    private Deque<XMLEvent> xmlEvents;
+
+    public SecurityTokenReference(SecurityToken securityToken, Deque<XMLEvent> xmlEvents, Crypto crypto, CallbackHandler callbackHandler, String id, Object processor) {
+        super(crypto, callbackHandler, id, processor);
+        this.securityToken = securityToken;
+        this.xmlEvents = xmlEvents;
+    }
+
+    public Deque<XMLEvent> getXmlEvents() {
+        return xmlEvents;
+    }
+
+    public boolean isAsymmetric() {
+        return securityToken.isAsymmetric();
+    }
+
+    public Key getSecretKey(String algorithmURI, Constants.KeyUsage keyUsage) throws WSSecurityException {
+        return securityToken.getSecretKey(algorithmURI, keyUsage);
+    }
+
+    public PublicKey getPublicKey(Constants.KeyUsage keyUsage) throws WSSecurityException {
+        return securityToken.getPublicKey(keyUsage);
+    }
+
+    public X509Certificate[] getX509Certificates() throws WSSecurityException {
+        return securityToken.getX509Certificates();
+    }
+
+    public void verify() throws WSSecurityException {
+        securityToken.verify();
+    }
+
+    public SecurityToken getKeyWrappingToken() {
+        return securityToken.getKeyWrappingToken();
+    }
+
+    public String getKeyWrappingTokenAlgorithm() {
+        return securityToken.getKeyWrappingTokenAlgorithm();
+    }
+
+    public Constants.TokenType getTokenType() {
+        return securityToken.getTokenType();
+    }
+}

Propchange: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/securityToken/SecurityTokenReference.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/securityToken/SecurityTokenReference.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/securityToken/ThumbprintSHA1SecurityToken.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/securityToken/ThumbprintSHA1SecurityToken.java?rev=1172285&view=auto
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/securityToken/ThumbprintSHA1SecurityToken.java (added)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/securityToken/ThumbprintSHA1SecurityToken.java Sun Sep 18 13:51:23 2011
@@ -0,0 +1,47 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.swssf.impl.securityToken;
+
+import org.swssf.crypto.Crypto;
+import org.swssf.ext.Constants;
+import org.swssf.ext.SecurityContext;
+import org.swssf.ext.WSSecurityException;
+
+import javax.security.auth.callback.CallbackHandler;
+
+/**
+ * @author $Author$
+ * @version $Revision$ $Date$
+ */
+public class ThumbprintSHA1SecurityToken extends X509SecurityToken {
+    private String alias = null;
+    private byte[] binaryContent;
+
+    ThumbprintSHA1SecurityToken(SecurityContext securityContext, Crypto crypto, CallbackHandler callbackHandler, byte[] binaryContent, String id, Object processor) {
+        super(Constants.TokenType.X509V3Token, securityContext, crypto, callbackHandler, id, processor);
+        this.binaryContent = binaryContent;
+    }
+
+    protected String getAlias() throws WSSecurityException {
+        if (this.alias == null) {
+            this.alias = getCrypto().getAliasForX509CertThumb(binaryContent);
+        }
+        return this.alias;
+    }
+}

Propchange: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/securityToken/ThumbprintSHA1SecurityToken.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/securityToken/UsernameSecurityToken.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/securityToken/UsernameSecurityToken.java?rev=1172285&view=auto
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/securityToken/UsernameSecurityToken.java (added)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/securityToken/UsernameSecurityToken.java Sun Sep 18 13:51:23 2011
@@ -0,0 +1,258 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.swssf.impl.securityToken;
+
+import org.apache.commons.codec.binary.Base64;
+import org.oasis_open.docs.wss._2004._01.oasis_200401_wss_wssecurity_secext_1_0.UsernameTokenType;
+import org.swssf.config.JCEAlgorithmMapper;
+import org.swssf.ext.Constants;
+import org.swssf.ext.SecurityContext;
+import org.swssf.ext.SecurityToken;
+import org.swssf.ext.WSSecurityException;
+
+import javax.crypto.Mac;
+import javax.crypto.spec.SecretKeySpec;
+import java.io.UnsupportedEncodingException;
+import java.security.*;
+import java.util.Hashtable;
+import java.util.Map;
+
+/**
+ * @author $Author$
+ * @version $Revision$ $Date$
+ */
+public class UsernameSecurityToken extends AbstractAlgorithmSuiteSecurityEventFiringSecurityToken {
+
+    private static final int DEFAULT_ITERATION = 1000;
+
+    private String username;
+    private String password;
+    private String created;
+    private byte[] nonce;
+    private byte[] salt;
+    private Integer iteration;
+
+    UsernameSecurityToken(UsernameTokenType usernameTokenType, SecurityContext securityContext, String id, Object processor) {
+        super(securityContext, id, processor);
+        this.username = usernameTokenType.getUsername();
+        this.password = usernameTokenType.getPassword();
+        this.created = usernameTokenType.getCreated();
+        this.nonce = usernameTokenType.getNonce() != null ? Base64.decodeBase64(usernameTokenType.getNonce()) : null;
+        this.salt = usernameTokenType.getSalt() != null ? Base64.decodeBase64(usernameTokenType.getSalt()) : null;
+        this.iteration = usernameTokenType.getIteration() != null ? Integer.parseInt(usernameTokenType.getIteration()) : null;
+    }
+
+    public UsernameSecurityToken(String username, String password, String created, byte[] nonce, byte[] salt, Integer iteration, SecurityContext securityContext, String id, Object processor) {
+        super(securityContext, id, processor);
+        this.username = username;
+        this.password = password;
+        this.created = created;
+        this.nonce = nonce;
+        this.salt = salt;
+        this.iteration = iteration;
+    }
+
+    public String getUsername() {
+        return username;
+    }
+
+    public String getPassword() {
+        return password;
+    }
+
+    public String getCreated() {
+        return created;
+    }
+
+    public byte[] getNonce() {
+        return nonce;
+    }
+
+    public byte[] getSalt() {
+        return salt;
+    }
+
+    public Integer getIteration() {
+        return iteration;
+    }
+
+    /**
+     * This method generates a derived key as defined in WSS Username
+     * Token Profile.
+     *
+     * @param rawPassword The password to include in the key generation
+     * @param salt        The Salt value
+     * @param iteration   The Iteration value. If zero (0) is given the method uses the
+     *                    default value
+     * @return Returns the derived key a byte array
+     * @throws org.swssf.ext.WSSecurityException
+     *
+     */
+    public byte[] generateDerivedKey(String rawPassword, byte[] salt, int iteration) throws WSSecurityException {
+        if (iteration == 0) {
+            iteration = DEFAULT_ITERATION;
+        }
+        byte[] pwBytes = null;
+        try {
+            pwBytes = rawPassword.getBytes("UTF-8");
+        } catch (final java.io.UnsupportedEncodingException e) {
+            throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, e);
+        }
+
+        byte[] pwSalt = new byte[salt.length + pwBytes.length];
+        System.arraycopy(pwBytes, 0, pwSalt, 0, pwBytes.length);
+        System.arraycopy(salt, 0, pwSalt, pwBytes.length, salt.length);
+
+        MessageDigest sha = null;
+        try {
+            sha = MessageDigest.getInstance("SHA-1");
+        } catch (NoSuchAlgorithmException e) {
+            throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "noSHA1availabe", e);
+        }
+        sha.reset();
+
+        // Make the first hash round with start value
+        byte[] k = sha.digest(pwSalt);
+
+        // Perform the 1st up to iteration-1 hash rounds
+        for (int i = 1; i < iteration; i++) {
+            k = sha.digest(k);
+        }
+        return k;
+    }
+
+    /**
+     * Gets the secret key as per WS-Trust spec.
+     *
+     * @param keylen      How many bytes to generate for the key
+     * @param labelString the label used to generate the seed
+     * @return a secret key constructed from information contained in this
+     *         username token
+     */
+    private byte[] getSecretKey(String rawPassword, int keylen, String labelString) throws WSSecurityException {
+        byte[] key = null;
+        try {
+            Mac mac = Mac.getInstance("HmacSHA1");
+            byte[] password = rawPassword.getBytes("UTF-8");
+            byte[] label = labelString.getBytes("UTF-8");
+            byte[] nonce = getNonce();
+            byte[] created = getCreated().getBytes("UTF-8");
+            byte[] seed = new byte[label.length + nonce.length + created.length];
+
+            int offset = 0;
+            System.arraycopy(label, 0, seed, offset, label.length);
+            offset += label.length;
+
+            System.arraycopy(nonce, 0, seed, offset, nonce.length);
+            offset += nonce.length;
+
+            System.arraycopy(created, 0, seed, offset, created.length);
+
+            key = P_hash(password, seed, mac, keylen);
+
+        } catch (NoSuchAlgorithmException e) {
+            throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "noHMACSHA1available", e);
+        } catch (UnsupportedEncodingException e) {
+            throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, e);
+        }
+        return key;
+    }
+
+    /**
+     * P_hash as defined in RFC 2246 for TLS.
+     *
+     * @param secret   is the key for the HMAC
+     * @param seed     the seed value to start the generation - A(0)
+     * @param mac      the HMAC algorithm
+     * @param required number of bytes to generate
+     * @return a byte array that contains a secret key
+     * @throws Exception
+     */
+    private byte[] P_hash(byte[] secret, byte[] seed, Mac mac, int required) throws WSSecurityException {
+        byte[] out = new byte[required];
+        int offset = 0;
+        int toCopy;
+        byte[] a, tmp;
+
+        try {
+            // a(0) is the seed
+            a = seed;
+            SecretKeySpec key = new SecretKeySpec(secret, "HmacSHA1");
+            mac.init(key);
+            while (required > 0) {
+                mac.update(a);
+                a = mac.doFinal();
+                mac.update(a);
+                mac.update(seed);
+                tmp = mac.doFinal();
+                toCopy = Math.min(required, tmp.length);
+                System.arraycopy(tmp, 0, out, offset, toCopy);
+                offset += toCopy;
+                required -= toCopy;
+            }
+        } catch (InvalidKeyException e) {
+            throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, e);
+        }
+        return out;
+    }
+
+    public boolean isAsymmetric() {
+        return false;
+    }
+
+    private Map<String, Key> keyTable = new Hashtable<String, Key>();
+
+    public Key getSecretKey(String algorithmURI, Constants.KeyUsage keyUsage) throws WSSecurityException {
+        super.getSecretKey(algorithmURI, keyUsage);
+        byte[] secretToken = null;
+        if (getSalt() != null && getIteration() != null) {
+            int iteration = getIteration();
+            byte[] salt = getSalt();
+            secretToken = generateDerivedKey(getPassword(), salt, iteration);
+        } else {
+            secretToken = getSecretKey(getPassword(), Constants.WSE_DERIVED_KEY_LEN, Constants.LABEL_FOR_DERIVED_KEY);
+        }
+
+        if (keyTable.containsKey(algorithmURI)) {
+            return keyTable.get(algorithmURI);
+        } else {
+            String algoFamily = JCEAlgorithmMapper.getJCERequiredKeyFromURI(algorithmURI);
+            Key key = new SecretKeySpec(secretToken, algoFamily);
+            keyTable.put(algorithmURI, key);
+            return key;
+        }
+    }
+
+    public PublicKey getPublicKey(Constants.KeyUsage keyUsage) throws WSSecurityException {
+        super.getPublicKey(keyUsage);
+        return null;
+    }
+
+    public SecurityToken getKeyWrappingToken() {
+        return null;
+    }
+
+    public String getKeyWrappingTokenAlgorithm() {
+        return null;
+    }
+
+    public Constants.TokenType getTokenType() {
+        return null;
+    }
+}

Propchange: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/securityToken/UsernameSecurityToken.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/securityToken/X509DataSecurityToken.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/securityToken/X509DataSecurityToken.java?rev=1172285&view=auto
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/securityToken/X509DataSecurityToken.java (added)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/securityToken/X509DataSecurityToken.java Sun Sep 18 13:51:23 2011
@@ -0,0 +1,48 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.swssf.impl.securityToken;
+
+import org.swssf.crypto.Crypto;
+import org.swssf.ext.Constants;
+import org.swssf.ext.SecurityContext;
+import org.swssf.ext.WSSecurityException;
+import org.w3._2000._09.xmldsig_.X509DataType;
+
+import javax.security.auth.callback.CallbackHandler;
+
+/**
+ * @author $Author$
+ * @version $Revision$ $Date$
+ */
+public class X509DataSecurityToken extends X509SecurityToken {
+    private String alias = null;
+    protected X509DataType x509DataType;
+
+    X509DataSecurityToken(SecurityContext securityContext, Crypto crypto, CallbackHandler callbackHandler, X509DataType x509DataType, String id, Object processor) {
+        super(Constants.TokenType.X509V3Token, securityContext, crypto, callbackHandler, id, processor);
+        this.x509DataType = x509DataType;
+    }
+
+    protected String getAlias() throws WSSecurityException {
+        if (this.alias == null) {
+            this.alias = getCrypto().getAliasForX509Cert(x509DataType.getX509IssuerSerialType().getX509IssuerName(), x509DataType.getX509IssuerSerialType().getX509SerialNumber());
+        }
+        return this.alias;
+    }
+}

Propchange: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/securityToken/X509DataSecurityToken.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/securityToken/X509DefaultSecurityToken.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/securityToken/X509DefaultSecurityToken.java?rev=1172285&view=auto
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/securityToken/X509DefaultSecurityToken.java (added)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/securityToken/X509DefaultSecurityToken.java Sun Sep 18 13:51:23 2011
@@ -0,0 +1,43 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.swssf.impl.securityToken;
+
+import org.swssf.crypto.Crypto;
+import org.swssf.ext.Constants;
+import org.swssf.ext.SecurityContext;
+import org.swssf.ext.WSSecurityException;
+
+import javax.security.auth.callback.CallbackHandler;
+
+/**
+ * @author $Author$
+ * @version $Revision$ $Date$
+ */
+public class X509DefaultSecurityToken extends X509SecurityToken {
+    private String alias = null;
+
+    X509DefaultSecurityToken(SecurityContext securityContext, Crypto crypto, CallbackHandler callbackHandler, String alias, String id, Object processor) {
+        super(Constants.TokenType.X509V3Token, securityContext, crypto, callbackHandler, id, processor);
+        this.alias = alias;
+    }
+
+    protected String getAlias() throws WSSecurityException {
+        return this.alias;
+    }
+}

Propchange: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/securityToken/X509DefaultSecurityToken.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/securityToken/X509PKIPathv1SecurityToken.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/securityToken/X509PKIPathv1SecurityToken.java?rev=1172285&view=auto
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/securityToken/X509PKIPathv1SecurityToken.java (added)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/securityToken/X509PKIPathv1SecurityToken.java Sun Sep 18 13:51:23 2011
@@ -0,0 +1,56 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.swssf.impl.securityToken;
+
+import org.swssf.crypto.Crypto;
+import org.swssf.ext.Constants;
+import org.swssf.ext.SecurityContext;
+import org.swssf.ext.WSSecurityException;
+
+import javax.security.auth.callback.CallbackHandler;
+import java.security.cert.X509Certificate;
+
+/**
+ * @author $Author$
+ * @version $Revision$ $Date$
+ */
+public class X509PKIPathv1SecurityToken extends X509SecurityToken {
+    private String alias = null;
+    private X509Certificate[] x509Certificates;
+
+    X509PKIPathv1SecurityToken(SecurityContext securityContext, Crypto crypto, CallbackHandler callbackHandler, byte[] binaryContent, String id, Object processor) throws WSSecurityException {
+        super(Constants.TokenType.X509PkiPathV1Token, securityContext, crypto, callbackHandler, id, processor);
+        X509Certificate[] x509Certificates = crypto.getX509Certificates(binaryContent, false);
+        if (x509Certificates != null && x509Certificates.length > 0) {
+            this.x509Certificates = x509Certificates;
+        }
+    }
+
+    protected String getAlias() throws WSSecurityException {
+        if (this.alias == null) {
+            this.alias = getCrypto().getAliasForX509Cert(this.x509Certificates[0]);
+        }
+        return this.alias;
+    }
+
+    @Override
+    public X509Certificate[] getX509Certificates() throws WSSecurityException {
+        return this.x509Certificates;
+    }
+}

Propchange: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/securityToken/X509PKIPathv1SecurityToken.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/securityToken/X509SecurityToken.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/securityToken/X509SecurityToken.java?rev=1172285&view=auto
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/securityToken/X509SecurityToken.java (added)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/securityToken/X509SecurityToken.java Sun Sep 18 13:51:23 2011
@@ -0,0 +1,98 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.swssf.impl.securityToken;
+
+import org.swssf.crypto.Crypto;
+import org.swssf.ext.*;
+
+import javax.security.auth.callback.CallbackHandler;
+import java.security.Key;
+import java.security.PublicKey;
+import java.security.cert.CertificateExpiredException;
+import java.security.cert.CertificateNotYetValidException;
+import java.security.cert.X509Certificate;
+
+/**
+ * @author $Author$
+ * @version $Revision$ $Date$
+ */
+public abstract class X509SecurityToken extends AbstractAlgorithmSuiteSecurityEventFiringSecurityToken {
+    private X509Certificate[] x509Certificates = null;
+    private Constants.TokenType tokenType;
+
+    X509SecurityToken(Constants.TokenType tokenType, SecurityContext securityContext, Crypto crypto, CallbackHandler callbackHandler, String id, Object processor) {
+        super(securityContext, crypto, callbackHandler, id, processor);
+        this.tokenType = tokenType;
+    }
+
+    public boolean isAsymmetric() {
+        return true;
+    }
+
+    public Key getSecretKey(String algorithmURI, Constants.KeyUsage keyUsage) throws WSSecurityException {
+        super.getSecretKey(algorithmURI, keyUsage);
+        WSPasswordCallback pwCb = new WSPasswordCallback(getAlias(), WSPasswordCallback.Usage.DECRYPT);
+        Utils.doPasswordCallback(getCallbackHandler(), pwCb);
+        return getCrypto().getPrivateKey(getAlias(), pwCb.getPassword());
+    }
+
+    public PublicKey getPublicKey(Constants.KeyUsage keyUsage) throws WSSecurityException {
+        super.getPublicKey(keyUsage);
+        X509Certificate[] x509Certificates = getX509Certificates();
+        if (x509Certificates == null || x509Certificates.length == 0) {
+            return null;
+        }
+        return x509Certificates[0].getPublicKey();
+    }
+
+    public X509Certificate[] getX509Certificates() throws WSSecurityException {
+        if (this.x509Certificates == null) {
+            this.x509Certificates = getCrypto().getCertificates(getAlias());
+        }
+        return this.x509Certificates;
+    }
+
+    public void verify() throws WSSecurityException {
+        try {
+            X509Certificate[] x509Certificates = getX509Certificates();
+            if (x509Certificates != null && x509Certificates.length > 0) {
+                x509Certificates[0].checkValidity();
+                getCrypto().verifyTrust(x509Certificates);
+            }
+        } catch (CertificateExpiredException e) {
+            throw new WSSecurityException(WSSecurityException.ErrorCode.FAILED_CHECK, e);
+        } catch (CertificateNotYetValidException e) {
+            throw new WSSecurityException(WSSecurityException.ErrorCode.FAILED_CHECK, e);
+        }
+    }
+
+    public SecurityToken getKeyWrappingToken() {
+        return null;
+    }
+
+    public String getKeyWrappingTokenAlgorithm() {
+        return null;
+    }
+
+    protected abstract String getAlias() throws WSSecurityException;
+
+    public Constants.TokenType getTokenType() {
+        return tokenType;
+    }
+}

Propchange: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/securityToken/X509SecurityToken.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/securityToken/X509SubjectKeyIdentifierSecurityToken.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/securityToken/X509SubjectKeyIdentifierSecurityToken.java?rev=1172285&view=auto
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/securityToken/X509SubjectKeyIdentifierSecurityToken.java (added)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/securityToken/X509SubjectKeyIdentifierSecurityToken.java Sun Sep 18 13:51:23 2011
@@ -0,0 +1,47 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.swssf.impl.securityToken;
+
+import org.swssf.crypto.Crypto;
+import org.swssf.ext.Constants;
+import org.swssf.ext.SecurityContext;
+import org.swssf.ext.WSSecurityException;
+
+import javax.security.auth.callback.CallbackHandler;
+
+/**
+ * @author $Author$
+ * @version $Revision$ $Date$
+ */
+public class X509SubjectKeyIdentifierSecurityToken extends X509SecurityToken {
+    private String alias = null;
+    private byte[] binaryContent;
+
+    X509SubjectKeyIdentifierSecurityToken(SecurityContext securityContext, Crypto crypto, CallbackHandler callbackHandler, byte[] binaryContent, String id, Object processor) {
+        super(Constants.TokenType.X509V3Token, securityContext, crypto, callbackHandler, id, processor);
+        this.binaryContent = binaryContent;
+    }
+
+    protected String getAlias() throws WSSecurityException {
+        if (this.alias == null) {
+            this.alias = getCrypto().getAliasForX509Cert(binaryContent);
+        }
+        return this.alias;
+    }
+}

Propchange: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/securityToken/X509SubjectKeyIdentifierSecurityToken.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/securityToken/X509_V3SecurityToken.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/securityToken/X509_V3SecurityToken.java?rev=1172285&view=auto
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/securityToken/X509_V3SecurityToken.java (added)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/securityToken/X509_V3SecurityToken.java Sun Sep 18 13:51:23 2011
@@ -0,0 +1,54 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.swssf.impl.securityToken;
+
+import org.swssf.crypto.Crypto;
+import org.swssf.ext.Constants;
+import org.swssf.ext.SecurityContext;
+import org.swssf.ext.WSSecurityException;
+
+import javax.security.auth.callback.CallbackHandler;
+import java.io.ByteArrayInputStream;
+import java.security.cert.X509Certificate;
+
+/**
+ * @author $Author$
+ * @version $Revision$ $Date$
+ */
+public class X509_V3SecurityToken extends X509SecurityToken {
+    private String alias = null;
+    private X509Certificate[] x509Certificates;
+
+    X509_V3SecurityToken(SecurityContext securityContext, Crypto crypto, CallbackHandler callbackHandler, byte[] binaryContent, String id, Object processor) throws WSSecurityException {
+        super(Constants.TokenType.X509V3Token, securityContext, crypto, callbackHandler, id, processor);
+        this.x509Certificates = new X509Certificate[]{getCrypto().loadCertificate(new ByteArrayInputStream(binaryContent))};
+    }
+
+    protected String getAlias() throws WSSecurityException {
+        if (this.alias == null) {
+            this.alias = getCrypto().getAliasForX509Cert(this.x509Certificates[0]);
+        }
+        return this.alias;
+    }
+
+    @Override
+    public X509Certificate[] getX509Certificates() throws WSSecurityException {
+        return this.x509Certificates;
+    }
+}

Propchange: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/securityToken/X509_V3SecurityToken.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/transformer/STRTransformer.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/transformer/STRTransformer.java?rev=1172285&view=auto
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/transformer/STRTransformer.java (added)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/transformer/STRTransformer.java Sun Sep 18 13:51:23 2011
@@ -0,0 +1,41 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.swssf.impl.transformer;
+
+import org.swssf.ext.Transformer;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.events.XMLEvent;
+
+/**
+ * @author $Author$
+ * @version $Revision$ $Date$
+ */
+public class STRTransformer implements Transformer {
+
+    private Transformer transformer;
+
+    public STRTransformer(Transformer transformer) {
+        this.transformer = transformer;
+    }
+
+    public void transform(XMLEvent xmlEvent) throws XMLStreamException {
+        this.transformer.transform(xmlEvent);
+    }
+}

Propchange: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/transformer/STRTransformer.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/transformer/STRTransformer.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/transformer/canonicalizer/Canonicalizer11.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/transformer/canonicalizer/Canonicalizer11.java?rev=1172285&view=auto
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/transformer/canonicalizer/Canonicalizer11.java (added)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/transformer/canonicalizer/Canonicalizer11.java Sun Sep 18 13:51:23 2011
@@ -0,0 +1,77 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.swssf.impl.transformer.canonicalizer;
+
+import org.swssf.ext.ComparableAttribute;
+import org.swssf.ext.XMLEventNS;
+
+import javax.xml.stream.events.Attribute;
+import javax.xml.stream.events.StartElement;
+import java.io.OutputStream;
+import java.util.Iterator;
+import java.util.List;
+import java.util.SortedSet;
+
+/**
+ * @author $Author$
+ * @version $Revision$ $Date$
+ */
+public class Canonicalizer11 extends CanonicalizerBase {
+    public Canonicalizer11(String inclusiveNamespaces, boolean includeComments, OutputStream outputStream) {
+        super(inclusiveNamespaces, includeComments, outputStream);
+    }
+
+    @Override
+    protected void getInitialUtilizedAttributes(XMLEventNS xmlEventNS, SortedSet<ComparableAttribute> utilizedAttributes, C14NStack<List<Comparable>> outputStack) {
+        List<ComparableAttribute>[] visibleAttributeList = xmlEventNS.getAttributeList();
+        for (int i = 0; i < visibleAttributeList.length; i++) {
+            List<ComparableAttribute> comparableAttributes = visibleAttributeList[i];
+            for (int j = 0; j < comparableAttributes.size(); j++) {
+                ComparableAttribute comparableAttribute = comparableAttributes.get(j);
+                //xml:id attributes must be handled like other attributes: emit but dont inherit
+                if (XML.equals(comparableAttribute.getName().getPrefix())
+                        && ("id".equals(comparableAttribute.getName().getLocalPart()))
+                        || ("base".equals(comparableAttribute.getName().getLocalPart()))) {
+                    continue;
+                }
+                if (outputStack.containsOnStack(comparableAttribute) != null) {
+                    continue;
+                }
+                utilizedAttributes.add(comparableAttribute);
+                outputStack.peek().add(comparableAttribute);
+            }
+        }
+
+        StartElement startElement = xmlEventNS.asStartElement();
+        @SuppressWarnings("unchecked")
+        Iterator<Attribute> attributesIterator = startElement.getAttributes();
+        while (attributesIterator.hasNext()) {
+            Attribute attribute = attributesIterator.next();
+            //attributes with xml prefix are already processed in the for loop above
+            //xml:id attributes must be handled like other attributes: emit but dont inherit
+            if (XML.equals(attribute.getName().getPrefix())
+                    && !"id".equals(attribute.getName().getLocalPart())
+                    && !"base".equals(attribute.getName().getLocalPart())) {
+                continue;
+            }
+
+            utilizedAttributes.add(new ComparableAttribute(attribute.getName(), attribute.getValue()));
+        }
+    }
+}

Propchange: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/transformer/canonicalizer/Canonicalizer11.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/transformer/canonicalizer/Canonicalizer11.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/transformer/canonicalizer/Canonicalizer11_OmitCommentsTransformer.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/transformer/canonicalizer/Canonicalizer11_OmitCommentsTransformer.java?rev=1172285&view=auto
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/transformer/canonicalizer/Canonicalizer11_OmitCommentsTransformer.java (added)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/transformer/canonicalizer/Canonicalizer11_OmitCommentsTransformer.java Sun Sep 18 13:51:23 2011
@@ -0,0 +1,38 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.swssf.impl.transformer.canonicalizer;
+
+import java.io.OutputStream;
+
+/**
+ * @author $Author$
+ * @version $Revision$ $Date$
+ */
+public class Canonicalizer11_OmitCommentsTransformer extends Canonicalizer11 {
+
+    /**
+     * Canonicalizer not complete. We are missing special handling for xml:base. But since
+     * we don't support document subsets we don't need it!
+     *
+     * @param inclusiveNamespaces
+     */
+    public Canonicalizer11_OmitCommentsTransformer(String inclusiveNamespaces, OutputStream outputStream) {
+        super(inclusiveNamespaces, false, outputStream);
+    }
+}

Propchange: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/transformer/canonicalizer/Canonicalizer11_OmitCommentsTransformer.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/transformer/canonicalizer/Canonicalizer11_WithCommentsTransformer.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/transformer/canonicalizer/Canonicalizer11_WithCommentsTransformer.java?rev=1172285&view=auto
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/transformer/canonicalizer/Canonicalizer11_WithCommentsTransformer.java (added)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/transformer/canonicalizer/Canonicalizer11_WithCommentsTransformer.java Sun Sep 18 13:51:23 2011
@@ -0,0 +1,38 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.swssf.impl.transformer.canonicalizer;
+
+import java.io.OutputStream;
+
+/**
+ * @author $Author$
+ * @version $Revision$ $Date$
+ */
+public class Canonicalizer11_WithCommentsTransformer extends Canonicalizer11 {
+
+    /**
+     * Canonicalizer not complete. We are missing special handling for xml:base. But since
+     * we don't support document subsets we don't need it!
+     *
+     * @param inclusiveNamespaces
+     */
+    public Canonicalizer11_WithCommentsTransformer(String inclusiveNamespaces, OutputStream outputStream) {
+        super(inclusiveNamespaces, true, outputStream);
+    }
+}

Propchange: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/transformer/canonicalizer/Canonicalizer11_WithCommentsTransformer.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/transformer/canonicalizer/Canonicalizer20010315.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/transformer/canonicalizer/Canonicalizer20010315.java?rev=1172285&view=auto
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/transformer/canonicalizer/Canonicalizer20010315.java (added)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/transformer/canonicalizer/Canonicalizer20010315.java Sun Sep 18 13:51:23 2011
@@ -0,0 +1,32 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.swssf.impl.transformer.canonicalizer;
+
+import java.io.OutputStream;
+
+/**
+ * @author $Author$
+ * @version $Revision$ $Date$
+ */
+public abstract class Canonicalizer20010315 extends CanonicalizerBase {
+
+    public Canonicalizer20010315(String inclusiveNamespaces, boolean includeComments, OutputStream outputStream) {
+        super(inclusiveNamespaces, includeComments, outputStream);
+    }
+}

Propchange: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/transformer/canonicalizer/Canonicalizer20010315.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/transformer/canonicalizer/Canonicalizer20010315.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/transformer/canonicalizer/Canonicalizer20010315_Excl.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/transformer/canonicalizer/Canonicalizer20010315_Excl.java?rev=1172285&view=auto
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/transformer/canonicalizer/Canonicalizer20010315_Excl.java (added)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/transformer/canonicalizer/Canonicalizer20010315_Excl.java Sun Sep 18 13:51:23 2011
@@ -0,0 +1,95 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.swssf.impl.transformer.canonicalizer;
+
+import org.swssf.ext.ComparableAttribute;
+import org.swssf.ext.ComparableNamespace;
+import org.swssf.ext.XMLEventNS;
+
+import javax.xml.stream.events.Attribute;
+import javax.xml.stream.events.StartElement;
+import java.io.OutputStream;
+import java.util.Iterator;
+import java.util.List;
+import java.util.SortedSet;
+
+/**
+ * @author $Author$
+ * @version $Revision$ $Date$
+ */
+public abstract class Canonicalizer20010315_Excl extends CanonicalizerBase {
+
+    public Canonicalizer20010315_Excl(String inclusiveNamespaces, boolean includeComments, OutputStream outputStream) {
+        super(inclusiveNamespaces, includeComments, outputStream);
+    }
+
+    @Override
+    protected void getCurrentUtilizedNamespaces(XMLEventNS xmlEventNS, SortedSet<ComparableNamespace> utilizedNamespaces, C14NStack<List<Comparable>> outputStack) {
+        getInitialUtilizedNamespaces(xmlEventNS, utilizedNamespaces, outputStack);
+    }
+
+    @Override
+    protected void getInitialUtilizedNamespaces(XMLEventNS xmlEventNS, SortedSet<ComparableNamespace> utilizedNamespaces, C14NStack<List<Comparable>> outputStack) {
+        List<ComparableNamespace> initialUtilizedNamespace = xmlEventNS.getNamespaceList()[0];
+        for (int j = 0; j < initialUtilizedNamespace.size(); j++) {
+            ComparableNamespace comparableNamespace = initialUtilizedNamespace.get(j);
+
+            boolean visibleUtilized = false;
+            StartElement startElement = xmlEventNS.asStartElement();
+            if (comparableNamespace.getPrefix().equals(startElement.getName().getPrefix())) {
+                visibleUtilized = true;
+            }
+
+            if (!visibleUtilized) {
+                @SuppressWarnings("unchecked")
+                Iterator<Attribute> attributesIterator = startElement.getAttributes();
+                while (attributesIterator.hasNext()) {
+                    Attribute attribute = attributesIterator.next();
+                    if (comparableNamespace.getPrefix().equals(attribute.getName().getPrefix())) {
+                        visibleUtilized = true;
+                    }
+                }
+            }
+
+            if (!visibleUtilized) {
+                continue;
+            }
+
+            final ComparableNamespace found = (ComparableNamespace) outputStack.containsOnStack(comparableNamespace);
+            //found means the prefix matched. so check the ns further
+            if (found != null && found.getNamespaceURI() != null && found.getNamespaceURI().equals(comparableNamespace.getNamespaceURI())) {
+                continue;
+            }
+
+            utilizedNamespaces.add(comparableNamespace);
+            outputStack.peek().add(comparableNamespace);
+        }
+    }
+
+    @Override
+    protected void getInitialUtilizedAttributes(XMLEventNS xmlEventNS, SortedSet<ComparableAttribute> utilizedAttributes, C14NStack<List<Comparable>> outputStack) {
+        StartElement startElement = xmlEventNS.asStartElement();
+        @SuppressWarnings("unchecked")
+        Iterator<Attribute> attributesIterator = startElement.getAttributes();
+        while (attributesIterator.hasNext()) {
+            Attribute attribute = attributesIterator.next();
+            utilizedAttributes.add(new ComparableAttribute(attribute.getName(), attribute.getValue()));
+        }
+    }
+}

Propchange: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/transformer/canonicalizer/Canonicalizer20010315_Excl.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/transformer/canonicalizer/Canonicalizer20010315_Excl.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/transformer/canonicalizer/Canonicalizer20010315_ExclOmitCommentsTransformer.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/transformer/canonicalizer/Canonicalizer20010315_ExclOmitCommentsTransformer.java?rev=1172285&view=auto
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/transformer/canonicalizer/Canonicalizer20010315_ExclOmitCommentsTransformer.java (added)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/transformer/canonicalizer/Canonicalizer20010315_ExclOmitCommentsTransformer.java Sun Sep 18 13:51:23 2011
@@ -0,0 +1,32 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.swssf.impl.transformer.canonicalizer;
+
+import java.io.OutputStream;
+
+/**
+ * @author $Author$
+ * @version $Revision$ $Date$
+ */
+public class Canonicalizer20010315_ExclOmitCommentsTransformer extends Canonicalizer20010315_Excl {
+
+    public Canonicalizer20010315_ExclOmitCommentsTransformer(String inclusiveNamespaces, OutputStream outputStream) {
+        super(inclusiveNamespaces, false, outputStream);
+    }
+}

Propchange: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/transformer/canonicalizer/Canonicalizer20010315_ExclOmitCommentsTransformer.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/transformer/canonicalizer/Canonicalizer20010315_ExclWithCommentsTransformer.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/transformer/canonicalizer/Canonicalizer20010315_ExclWithCommentsTransformer.java?rev=1172285&view=auto
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/transformer/canonicalizer/Canonicalizer20010315_ExclWithCommentsTransformer.java (added)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/transformer/canonicalizer/Canonicalizer20010315_ExclWithCommentsTransformer.java Sun Sep 18 13:51:23 2011
@@ -0,0 +1,32 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.swssf.impl.transformer.canonicalizer;
+
+import java.io.OutputStream;
+
+/**
+ * @author $Author$
+ * @version $Revision$ $Date$
+ */
+public class Canonicalizer20010315_ExclWithCommentsTransformer extends Canonicalizer20010315_Excl {
+
+    public Canonicalizer20010315_ExclWithCommentsTransformer(String inclusiveNamespaces, OutputStream outputStream) {
+        super(inclusiveNamespaces, true, outputStream);
+    }
+}

Propchange: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/transformer/canonicalizer/Canonicalizer20010315_ExclWithCommentsTransformer.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/transformer/canonicalizer/Canonicalizer20010315_OmitCommentsTransformer.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/transformer/canonicalizer/Canonicalizer20010315_OmitCommentsTransformer.java?rev=1172285&view=auto
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/transformer/canonicalizer/Canonicalizer20010315_OmitCommentsTransformer.java (added)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/transformer/canonicalizer/Canonicalizer20010315_OmitCommentsTransformer.java Sun Sep 18 13:51:23 2011
@@ -0,0 +1,32 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.swssf.impl.transformer.canonicalizer;
+
+import java.io.OutputStream;
+
+/**
+ * @author $Author$
+ * @version $Revision$ $Date$
+ */
+public class Canonicalizer20010315_OmitCommentsTransformer extends Canonicalizer20010315 {
+
+    public Canonicalizer20010315_OmitCommentsTransformer(String inclusiveNamespaces, OutputStream outputStream) {
+        super(inclusiveNamespaces, false, outputStream);
+    }
+}

Propchange: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/transformer/canonicalizer/Canonicalizer20010315_OmitCommentsTransformer.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/transformer/canonicalizer/Canonicalizer20010315_WithCommentsTransformer.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/transformer/canonicalizer/Canonicalizer20010315_WithCommentsTransformer.java?rev=1172285&view=auto
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/transformer/canonicalizer/Canonicalizer20010315_WithCommentsTransformer.java (added)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/transformer/canonicalizer/Canonicalizer20010315_WithCommentsTransformer.java Sun Sep 18 13:51:23 2011
@@ -0,0 +1,32 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.swssf.impl.transformer.canonicalizer;
+
+import java.io.OutputStream;
+
+/**
+ * @author $Author$
+ * @version $Revision$ $Date$
+ */
+public class Canonicalizer20010315_WithCommentsTransformer extends Canonicalizer20010315 {
+
+    public Canonicalizer20010315_WithCommentsTransformer(String inclusiveNamespaces, OutputStream outputStream) {
+        super(inclusiveNamespaces, true, outputStream);
+    }
+}

Propchange: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/transformer/canonicalizer/Canonicalizer20010315_WithCommentsTransformer.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision



Mime
View raw message