You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ws.apache.org by gi...@apache.org on 2011/10/11 20:03:15 UTC
svn commit: r1181995 [11/26] - in /webservices/wss4j/branches/swssf: ./
cxf-integration/ cxf-integration/src/main/java/org/swssf/cxfIntegration/
cxf-integration/src/main/java/org/swssf/cxfIntegration/interceptor/
cxf-integration/src/main/java/org/swssf...
Copied: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/securityToken/SecurityTokenFactoryImpl.java (from r1179730, 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/wss/impl/securityToken/SecurityTokenFactoryImpl.java?p2=webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/securityToken/SecurityTokenFactoryImpl.java&p1=webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/securityToken/SecurityTokenFactory.java&r1=1179730&r2=1181995&rev=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/impl/securityToken/SecurityTokenFactory.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/securityToken/SecurityTokenFactoryImpl.java Tue Oct 11 18:03:00 2011
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.swssf.impl.securityToken;
+package org.swssf.wss.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;
@@ -24,9 +24,16 @@ import org.oasis_open.docs.wss._2004._01
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.swssf.wss.ext.WSSConstants;
+import org.swssf.wss.ext.WSSUtils;
+import org.swssf.wss.ext.WSSecurityException;
+import org.swssf.wss.impl.saml.SAMLKeyInfo;
+import org.swssf.xmlsec.crypto.Crypto;
+import org.swssf.xmlsec.ext.SecurityContext;
+import org.swssf.xmlsec.ext.SecurityToken;
+import org.swssf.xmlsec.ext.SecurityTokenProvider;
+import org.swssf.xmlsec.ext.XMLSecurityException;
+import org.swssf.xmlsec.impl.securityToken.SecurityTokenFactory;
import org.w3._2000._09.xmldsig_.KeyInfoType;
import javax.security.auth.callback.CallbackHandler;
@@ -39,32 +46,33 @@ import java.util.Deque;
* @author $Author$
* @version $Revision$ $Date$
*/
-public class SecurityTokenFactory {
+public class SecurityTokenFactoryImpl extends SecurityTokenFactory {
- private SecurityTokenFactory() {
+ public SecurityTokenFactoryImpl() {
}
- 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);
+ @Override
+ public SecurityToken getSecurityToken(KeyInfoType keyInfoType, Crypto crypto,
+ final CallbackHandler callbackHandler, SecurityContext securityContext,
+ Object processor) throws XMLSecurityException {
+ if (keyInfoType != null && keyInfoType instanceof org.w3._2000._09.xmldsig_.wss.KeyInfoType) {
+ return getSecurityToken(((org.w3._2000._09.xmldsig_.wss.KeyInfoType) 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 {
+ public static SecurityToken getSecurityToken(SecurityTokenReferenceType securityTokenReferenceType, Crypto crypto,
+ final CallbackHandler callbackHandler, SecurityContext securityContext,
+ Object processor) throws XMLSecurityException {
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));
+ return new DelegatingSecurityToken(WSSConstants.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) {
@@ -74,17 +82,17 @@ public class SecurityTokenFactory {
String encodingType = keyIdentifierType.getEncodingType();
byte[] binaryContent = null;
- if (Constants.SOAPMESSAGE_NS10_BASE64_ENCODING.equals(encodingType)) {
+ if (WSSConstants.SOAPMESSAGE_NS10_BASE64_ENCODING.equals(encodingType)) {
binaryContent = Base64.decodeBase64(keyIdentifierType.getValue());
}
- if (Constants.NS_X509_V3_TYPE.equals(valueType)) {
+ if (WSSConstants.NS_X509_V3_TYPE.equals(valueType)) {
return new X509_V3SecurityToken(securityContext, crypto, callbackHandler, binaryContent, securityTokenReferenceType.getId(), processor);
- } else if (Constants.NS_X509SubjectKeyIdentifier.equals(valueType)) {
+ } else if (WSSConstants.NS_X509SubjectKeyIdentifier.equals(valueType)) {
return new X509SubjectKeyIdentifierSecurityToken(securityContext, crypto, callbackHandler, binaryContent, securityTokenReferenceType.getId(), processor);
- } else if (Constants.NS_THUMBPRINT.equals(valueType)) {
+ } else if (WSSConstants.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)) {
+ } else if (WSSConstants.NS_SAML10_TYPE.equals(valueType) || WSSConstants.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());
@@ -97,12 +105,12 @@ public class SecurityTokenFactory {
if (uri == null) {
throw new WSSecurityException("badReferenceURI");
}
- uri = Utils.dropReferenceMarker(uri);
+ uri = WSSUtils.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));
+ return new DelegatingSecurityToken(WSSConstants.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.
@@ -122,7 +130,7 @@ public class SecurityTokenFactory {
if (securityTokenProvider == null) {
throw new WSSecurityException(WSSecurityException.ErrorCode.SECURITY_TOKEN_UNAVAILABLE, "noToken", uri);
}
- return new DelegatingSecurityToken(Constants.KeyIdentifierType.BST_DIRECT_REFERENCE, securityTokenProvider.getSecurityToken(crypto));
+ return new DelegatingSecurityToken(WSSConstants.KeyIdentifierType.BST_DIRECT_REFERENCE, securityTokenProvider.getSecurityToken(crypto));
}
}
throw new WSSecurityException(WSSecurityException.ErrorCode.INVALID_SECURITY, "noKeyinfo");
@@ -131,33 +139,33 @@ public class SecurityTokenFactory {
}
}
- public SecurityToken getSecurityToken(BinarySecurityTokenType binarySecurityTokenType, SecurityContext securityContext, Crypto crypto, CallbackHandler callbackHandler, Object processor) throws WSSecurityException {
+ public static SecurityToken getSecurityToken(BinarySecurityTokenType binarySecurityTokenType, SecurityContext securityContext, Crypto crypto, CallbackHandler callbackHandler, Object processor) throws XMLSecurityException {
//only Base64Encoding is supported
- if (!Constants.SOAPMESSAGE_NS10_BASE64_ENCODING.equals(binarySecurityTokenType.getEncodingType())) {
+ if (!WSSConstants.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())) {
+ if (WSSConstants.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())) {
+ } else if (WSSConstants.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 {
+ public static 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 {
+ public static 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 {
+ public static SecurityToken getSecurityToken(String referencedTokenId, Deque<XMLEvent> xmlEvents, Crypto crypto, CallbackHandler callbackHandler, SecurityContext securityContext, String id, Object processor) throws XMLSecurityException {
return new SecurityTokenReference(securityContext.getSecurityTokenProvider(referencedTokenId).getSecurityToken(crypto), xmlEvents, crypto, callbackHandler, id, processor);
}
}
Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/securityToken/SecurityTokenReference.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/securityToken/SecurityTokenReference.java?rev=1181995&r1=1179730&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/securityToken/SecurityTokenReference.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/securityToken/SecurityTokenReference.java Tue Oct 11 18:03:00 2011
@@ -16,12 +16,12 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.swssf.impl.securityToken;
+package org.swssf.wss.impl.securityToken;
-import org.swssf.crypto.Crypto;
-import org.swssf.ext.Constants;
-import org.swssf.ext.SecurityToken;
-import org.swssf.ext.WSSecurityException;
+import org.swssf.xmlsec.crypto.Crypto;
+import org.swssf.xmlsec.ext.SecurityToken;
+import org.swssf.xmlsec.ext.XMLSecurityConstants;
+import org.swssf.xmlsec.ext.XMLSecurityException;
import javax.security.auth.callback.CallbackHandler;
import javax.xml.stream.events.XMLEvent;
@@ -53,19 +53,19 @@ public class SecurityTokenReference exte
return securityToken.isAsymmetric();
}
- public Key getSecretKey(String algorithmURI, Constants.KeyUsage keyUsage) throws WSSecurityException {
+ public Key getSecretKey(String algorithmURI, XMLSecurityConstants.KeyUsage keyUsage) throws XMLSecurityException {
return securityToken.getSecretKey(algorithmURI, keyUsage);
}
- public PublicKey getPublicKey(Constants.KeyUsage keyUsage) throws WSSecurityException {
+ public PublicKey getPublicKey(XMLSecurityConstants.KeyUsage keyUsage) throws XMLSecurityException {
return securityToken.getPublicKey(keyUsage);
}
- public X509Certificate[] getX509Certificates() throws WSSecurityException {
+ public X509Certificate[] getX509Certificates() throws XMLSecurityException {
return securityToken.getX509Certificates();
}
- public void verify() throws WSSecurityException {
+ public void verify() throws XMLSecurityException {
securityToken.verify();
}
@@ -77,7 +77,7 @@ public class SecurityTokenReference exte
return securityToken.getKeyWrappingTokenAlgorithm();
}
- public Constants.TokenType getTokenType() {
+ public XMLSecurityConstants.TokenType getTokenType() {
return securityToken.getTokenType();
}
}
Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/securityToken/ThumbprintSHA1SecurityToken.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/securityToken/ThumbprintSHA1SecurityToken.java?rev=1181995&r1=1179730&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/securityToken/ThumbprintSHA1SecurityToken.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/securityToken/ThumbprintSHA1SecurityToken.java Tue Oct 11 18:03:00 2011
@@ -16,12 +16,12 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.swssf.impl.securityToken;
+package org.swssf.wss.impl.securityToken;
-import org.swssf.crypto.Crypto;
-import org.swssf.ext.Constants;
-import org.swssf.ext.SecurityContext;
-import org.swssf.ext.WSSecurityException;
+import org.swssf.wss.ext.WSSConstants;
+import org.swssf.xmlsec.crypto.Crypto;
+import org.swssf.xmlsec.ext.SecurityContext;
+import org.swssf.xmlsec.ext.XMLSecurityException;
import javax.security.auth.callback.CallbackHandler;
@@ -34,11 +34,11 @@ public class ThumbprintSHA1SecurityToken
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);
+ super(WSSConstants.X509V3Token, securityContext, crypto, callbackHandler, id, processor);
this.binaryContent = binaryContent;
}
- protected String getAlias() throws WSSecurityException {
+ protected String getAlias() throws XMLSecurityException {
if (this.alias == null) {
this.alias = getCrypto().getAliasForX509CertThumb(binaryContent);
}
Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/securityToken/UsernameSecurityToken.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/securityToken/UsernameSecurityToken.java?rev=1181995&r1=1179730&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/securityToken/UsernameSecurityToken.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/securityToken/UsernameSecurityToken.java Tue Oct 11 18:03:00 2011
@@ -16,15 +16,17 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.swssf.impl.securityToken;
+package org.swssf.wss.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 org.swssf.wss.ext.WSSConstants;
+import org.swssf.wss.ext.WSSecurityException;
+import org.swssf.xmlsec.config.JCEAlgorithmMapper;
+import org.swssf.xmlsec.ext.SecurityContext;
+import org.swssf.xmlsec.ext.SecurityToken;
+import org.swssf.xmlsec.ext.XMLSecurityConstants;
+import org.swssf.xmlsec.ext.XMLSecurityException;
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
@@ -101,7 +103,7 @@ public class UsernameSecurityToken exten
* @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
+ * @throws org.swssf.wss.ext.WSSecurityException
*
*/
public byte[] generateDerivedKey(String rawPassword, byte[] salt, int iteration) throws WSSecurityException {
@@ -218,7 +220,7 @@ public class UsernameSecurityToken exten
private Map<String, Key> keyTable = new Hashtable<String, Key>();
- public Key getSecretKey(String algorithmURI, Constants.KeyUsage keyUsage) throws WSSecurityException {
+ public Key getSecretKey(String algorithmURI, XMLSecurityConstants.KeyUsage keyUsage) throws XMLSecurityException {
super.getSecretKey(algorithmURI, keyUsage);
byte[] secretToken = null;
if (getSalt() != null && getIteration() != null) {
@@ -226,7 +228,7 @@ public class UsernameSecurityToken exten
byte[] salt = getSalt();
secretToken = generateDerivedKey(getPassword(), salt, iteration);
} else {
- secretToken = getSecretKey(getPassword(), Constants.WSE_DERIVED_KEY_LEN, Constants.LABEL_FOR_DERIVED_KEY);
+ secretToken = getSecretKey(getPassword(), WSSConstants.WSE_DERIVED_KEY_LEN, WSSConstants.LABEL_FOR_DERIVED_KEY);
}
if (keyTable.containsKey(algorithmURI)) {
@@ -239,7 +241,7 @@ public class UsernameSecurityToken exten
}
}
- public PublicKey getPublicKey(Constants.KeyUsage keyUsage) throws WSSecurityException {
+ public PublicKey getPublicKey(XMLSecurityConstants.KeyUsage keyUsage) throws XMLSecurityException {
super.getPublicKey(keyUsage);
return null;
}
@@ -252,7 +254,7 @@ public class UsernameSecurityToken exten
return null;
}
- public Constants.TokenType getTokenType() {
+ public WSSConstants.TokenType getTokenType() {
return null;
}
}
Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/securityToken/X509DataSecurityToken.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/securityToken/X509DataSecurityToken.java?rev=1181995&r1=1179730&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/securityToken/X509DataSecurityToken.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/securityToken/X509DataSecurityToken.java Tue Oct 11 18:03:00 2011
@@ -16,12 +16,12 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.swssf.impl.securityToken;
+package org.swssf.wss.impl.securityToken;
-import org.swssf.crypto.Crypto;
-import org.swssf.ext.Constants;
-import org.swssf.ext.SecurityContext;
-import org.swssf.ext.WSSecurityException;
+import org.swssf.wss.ext.WSSConstants;
+import org.swssf.xmlsec.crypto.Crypto;
+import org.swssf.xmlsec.ext.SecurityContext;
+import org.swssf.xmlsec.ext.XMLSecurityException;
import org.w3._2000._09.xmldsig_.X509DataType;
import javax.security.auth.callback.CallbackHandler;
@@ -35,11 +35,11 @@ public class X509DataSecurityToken exten
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);
+ super(WSSConstants.X509V3Token, securityContext, crypto, callbackHandler, id, processor);
this.x509DataType = x509DataType;
}
- protected String getAlias() throws WSSecurityException {
+ protected String getAlias() throws XMLSecurityException {
if (this.alias == null) {
this.alias = getCrypto().getAliasForX509Cert(x509DataType.getX509IssuerSerialType().getX509IssuerName(), x509DataType.getX509IssuerSerialType().getX509SerialNumber());
}
Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/securityToken/X509DefaultSecurityToken.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/securityToken/X509DefaultSecurityToken.java?rev=1181995&r1=1179730&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/securityToken/X509DefaultSecurityToken.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/securityToken/X509DefaultSecurityToken.java Tue Oct 11 18:03:00 2011
@@ -16,12 +16,12 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.swssf.impl.securityToken;
+package org.swssf.wss.impl.securityToken;
-import org.swssf.crypto.Crypto;
-import org.swssf.ext.Constants;
-import org.swssf.ext.SecurityContext;
-import org.swssf.ext.WSSecurityException;
+import org.swssf.wss.ext.WSSConstants;
+import org.swssf.xmlsec.crypto.Crypto;
+import org.swssf.xmlsec.ext.SecurityContext;
+import org.swssf.xmlsec.ext.XMLSecurityException;
import javax.security.auth.callback.CallbackHandler;
@@ -33,11 +33,11 @@ public class X509DefaultSecurityToken ex
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);
+ super(WSSConstants.X509V3Token, securityContext, crypto, callbackHandler, id, processor);
this.alias = alias;
}
- protected String getAlias() throws WSSecurityException {
+ protected String getAlias() throws XMLSecurityException {
return this.alias;
}
}
Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/securityToken/X509PKIPathv1SecurityToken.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/securityToken/X509PKIPathv1SecurityToken.java?rev=1181995&r1=1179730&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/securityToken/X509PKIPathv1SecurityToken.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/securityToken/X509PKIPathv1SecurityToken.java Tue Oct 11 18:03:00 2011
@@ -16,12 +16,12 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.swssf.impl.securityToken;
+package org.swssf.wss.impl.securityToken;
-import org.swssf.crypto.Crypto;
-import org.swssf.ext.Constants;
-import org.swssf.ext.SecurityContext;
-import org.swssf.ext.WSSecurityException;
+import org.swssf.wss.ext.WSSConstants;
+import org.swssf.xmlsec.crypto.Crypto;
+import org.swssf.xmlsec.ext.SecurityContext;
+import org.swssf.xmlsec.ext.XMLSecurityException;
import javax.security.auth.callback.CallbackHandler;
import java.security.cert.X509Certificate;
@@ -34,15 +34,15 @@ public class X509PKIPathv1SecurityToken
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);
+ X509PKIPathv1SecurityToken(SecurityContext securityContext, Crypto crypto, CallbackHandler callbackHandler, byte[] binaryContent, String id, Object processor) throws XMLSecurityException {
+ super(WSSConstants.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 {
+ protected String getAlias() throws XMLSecurityException {
if (this.alias == null) {
this.alias = getCrypto().getAliasForX509Cert(this.x509Certificates[0]);
}
@@ -50,7 +50,7 @@ public class X509PKIPathv1SecurityToken
}
@Override
- public X509Certificate[] getX509Certificates() throws WSSecurityException {
+ public X509Certificate[] getX509Certificates() throws XMLSecurityException {
return this.x509Certificates;
}
}
Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/securityToken/X509SecurityToken.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/securityToken/X509SecurityToken.java?rev=1181995&r1=1179730&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/securityToken/X509SecurityToken.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/securityToken/X509SecurityToken.java Tue Oct 11 18:03:00 2011
@@ -16,10 +16,11 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.swssf.impl.securityToken;
+package org.swssf.wss.impl.securityToken;
-import org.swssf.crypto.Crypto;
-import org.swssf.ext.*;
+import org.swssf.wss.ext.WSPasswordCallback;
+import org.swssf.xmlsec.crypto.Crypto;
+import org.swssf.xmlsec.ext.*;
import javax.security.auth.callback.CallbackHandler;
import java.security.Key;
@@ -34,9 +35,9 @@ import java.security.cert.X509Certificat
*/
public abstract class X509SecurityToken extends AbstractAlgorithmSuiteSecurityEventFiringSecurityToken {
private X509Certificate[] x509Certificates = null;
- private Constants.TokenType tokenType;
+ private XMLSecurityConstants.TokenType tokenType;
- X509SecurityToken(Constants.TokenType tokenType, SecurityContext securityContext, Crypto crypto, CallbackHandler callbackHandler, String id, Object processor) {
+ X509SecurityToken(XMLSecurityConstants.TokenType tokenType, SecurityContext securityContext, Crypto crypto, CallbackHandler callbackHandler, String id, Object processor) {
super(securityContext, crypto, callbackHandler, id, processor);
this.tokenType = tokenType;
}
@@ -45,14 +46,14 @@ public abstract class X509SecurityToken
return true;
}
- public Key getSecretKey(String algorithmURI, Constants.KeyUsage keyUsage) throws WSSecurityException {
+ public Key getSecretKey(String algorithmURI, XMLSecurityConstants.KeyUsage keyUsage) throws XMLSecurityException {
super.getSecretKey(algorithmURI, keyUsage);
WSPasswordCallback pwCb = new WSPasswordCallback(getAlias(), WSPasswordCallback.Usage.DECRYPT);
- Utils.doPasswordCallback(getCallbackHandler(), pwCb);
+ XMLSecurityUtils.doPasswordCallback(getCallbackHandler(), pwCb);
return getCrypto().getPrivateKey(getAlias(), pwCb.getPassword());
}
- public PublicKey getPublicKey(Constants.KeyUsage keyUsage) throws WSSecurityException {
+ public PublicKey getPublicKey(XMLSecurityConstants.KeyUsage keyUsage) throws XMLSecurityException {
super.getPublicKey(keyUsage);
X509Certificate[] x509Certificates = getX509Certificates();
if (x509Certificates == null || x509Certificates.length == 0) {
@@ -61,14 +62,14 @@ public abstract class X509SecurityToken
return x509Certificates[0].getPublicKey();
}
- public X509Certificate[] getX509Certificates() throws WSSecurityException {
+ public X509Certificate[] getX509Certificates() throws XMLSecurityException {
if (this.x509Certificates == null) {
this.x509Certificates = getCrypto().getCertificates(getAlias());
}
return this.x509Certificates;
}
- public void verify() throws WSSecurityException {
+ public void verify() throws XMLSecurityException {
try {
X509Certificate[] x509Certificates = getX509Certificates();
if (x509Certificates != null && x509Certificates.length > 0) {
@@ -76,9 +77,9 @@ public abstract class X509SecurityToken
getCrypto().verifyTrust(x509Certificates);
}
} catch (CertificateExpiredException e) {
- throw new WSSecurityException(WSSecurityException.ErrorCode.FAILED_CHECK, e);
+ throw new XMLSecurityException(XMLSecurityException.ErrorCode.FAILED_CHECK, e);
} catch (CertificateNotYetValidException e) {
- throw new WSSecurityException(WSSecurityException.ErrorCode.FAILED_CHECK, e);
+ throw new XMLSecurityException(XMLSecurityException.ErrorCode.FAILED_CHECK, e);
}
}
@@ -90,9 +91,9 @@ public abstract class X509SecurityToken
return null;
}
- protected abstract String getAlias() throws WSSecurityException;
+ protected abstract String getAlias() throws XMLSecurityException;
- public Constants.TokenType getTokenType() {
+ public XMLSecurityConstants.TokenType getTokenType() {
return tokenType;
}
}
Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/securityToken/X509SubjectKeyIdentifierSecurityToken.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/securityToken/X509SubjectKeyIdentifierSecurityToken.java?rev=1181995&r1=1179730&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/securityToken/X509SubjectKeyIdentifierSecurityToken.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/securityToken/X509SubjectKeyIdentifierSecurityToken.java Tue Oct 11 18:03:00 2011
@@ -16,12 +16,12 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.swssf.impl.securityToken;
+package org.swssf.wss.impl.securityToken;
-import org.swssf.crypto.Crypto;
-import org.swssf.ext.Constants;
-import org.swssf.ext.SecurityContext;
-import org.swssf.ext.WSSecurityException;
+import org.swssf.wss.ext.WSSConstants;
+import org.swssf.xmlsec.crypto.Crypto;
+import org.swssf.xmlsec.ext.SecurityContext;
+import org.swssf.xmlsec.ext.XMLSecurityException;
import javax.security.auth.callback.CallbackHandler;
@@ -34,11 +34,11 @@ public class X509SubjectKeyIdentifierSec
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);
+ super(WSSConstants.X509V3Token, securityContext, crypto, callbackHandler, id, processor);
this.binaryContent = binaryContent;
}
- protected String getAlias() throws WSSecurityException {
+ protected String getAlias() throws XMLSecurityException {
if (this.alias == null) {
this.alias = getCrypto().getAliasForX509Cert(binaryContent);
}
Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/securityToken/X509_V3SecurityToken.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/securityToken/X509_V3SecurityToken.java?rev=1181995&r1=1179730&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/securityToken/X509_V3SecurityToken.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/securityToken/X509_V3SecurityToken.java Tue Oct 11 18:03:00 2011
@@ -16,12 +16,12 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.swssf.impl.securityToken;
+package org.swssf.wss.impl.securityToken;
-import org.swssf.crypto.Crypto;
-import org.swssf.ext.Constants;
-import org.swssf.ext.SecurityContext;
-import org.swssf.ext.WSSecurityException;
+import org.swssf.wss.ext.WSSConstants;
+import org.swssf.xmlsec.crypto.Crypto;
+import org.swssf.xmlsec.ext.SecurityContext;
+import org.swssf.xmlsec.ext.XMLSecurityException;
import javax.security.auth.callback.CallbackHandler;
import java.io.ByteArrayInputStream;
@@ -35,12 +35,12 @@ public class X509_V3SecurityToken extend
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);
+ X509_V3SecurityToken(SecurityContext securityContext, Crypto crypto, CallbackHandler callbackHandler, byte[] binaryContent, String id, Object processor) throws XMLSecurityException {
+ super(WSSConstants.X509V3Token, securityContext, crypto, callbackHandler, id, processor);
this.x509Certificates = new X509Certificate[]{getCrypto().loadCertificate(new ByteArrayInputStream(binaryContent))};
}
- protected String getAlias() throws WSSecurityException {
+ protected String getAlias() throws XMLSecurityException {
if (this.alias == null) {
this.alias = getCrypto().getAliasForX509Cert(this.x509Certificates[0]);
}
@@ -48,7 +48,7 @@ public class X509_V3SecurityToken extend
}
@Override
- public X509Certificate[] getX509Certificates() throws WSSecurityException {
+ public X509Certificate[] getX509Certificates() throws XMLSecurityException {
return this.x509Certificates;
}
}
Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/transformer/STRTransformer.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/transformer/STRTransformer.java?rev=1181995&r1=1179730&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/transformer/STRTransformer.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/transformer/STRTransformer.java Tue Oct 11 18:03:00 2011
@@ -16,9 +16,9 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.swssf.impl.transformer;
+package org.swssf.wss.impl.transformer;
-import org.swssf.ext.Transformer;
+import org.swssf.xmlsec.ext.Transformer;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.events.XMLEvent;
Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/AlgorithmSuiteSecurityEvent.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/AlgorithmSuiteSecurityEvent.java?rev=1181995&r1=1179730&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/AlgorithmSuiteSecurityEvent.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/AlgorithmSuiteSecurityEvent.java Tue Oct 11 18:03:00 2011
@@ -16,9 +16,10 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.swssf.securityEvent;
+package org.swssf.wss.securityEvent;
-import org.swssf.ext.Constants;
+
+import org.swssf.xmlsec.ext.XMLSecurityConstants;
/**
* @author $Author$
@@ -30,7 +31,7 @@ public class AlgorithmSuiteSecurityEvent
//chapter 6.1
private String algorithmURI;
- private Constants.KeyUsage keyUsage;
+ private XMLSecurityConstants.KeyUsage keyUsage;
public AlgorithmSuiteSecurityEvent(Event securityEventType) {
super(securityEventType);
@@ -44,11 +45,11 @@ public class AlgorithmSuiteSecurityEvent
this.algorithmURI = algorithmURI;
}
- public Constants.KeyUsage getKeyUsage() {
+ public XMLSecurityConstants.KeyUsage getKeyUsage() {
return keyUsage;
}
- public void setKeyUsage(Constants.KeyUsage keyUsage) {
+ public void setKeyUsage(XMLSecurityConstants.KeyUsage keyUsage) {
this.keyUsage = keyUsage;
}
}
Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/ContentEncryptedElementSecurityEvent.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/ContentEncryptedElementSecurityEvent.java?rev=1181995&r1=1179730&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/ContentEncryptedElementSecurityEvent.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/ContentEncryptedElementSecurityEvent.java Tue Oct 11 18:03:00 2011
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.swssf.securityEvent;
+package org.swssf.wss.securityEvent;
import javax.xml.namespace.QName;
Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/EncryptedElementSecurityEvent.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/EncryptedElementSecurityEvent.java?rev=1181995&r1=1179730&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/EncryptedElementSecurityEvent.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/EncryptedElementSecurityEvent.java Tue Oct 11 18:03:00 2011
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.swssf.securityEvent;
+package org.swssf.wss.securityEvent;
import javax.xml.namespace.QName;
Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/EncryptedPartSecurityEvent.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/EncryptedPartSecurityEvent.java?rev=1181995&r1=1179730&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/EncryptedPartSecurityEvent.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/EncryptedPartSecurityEvent.java Tue Oct 11 18:03:00 2011
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.swssf.securityEvent;
+package org.swssf.wss.securityEvent;
import javax.xml.namespace.QName;
Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/EncryptionTokenSecurityEvent.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/EncryptionTokenSecurityEvent.java?rev=1181995&r1=1179730&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/EncryptionTokenSecurityEvent.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/EncryptionTokenSecurityEvent.java Tue Oct 11 18:03:00 2011
@@ -1,4 +1,4 @@
- /**
+/**
* 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
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.swssf.securityEvent;
+package org.swssf.wss.securityEvent;
/**
* @author $Author: giger $
Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/HttpsTokenSecurityEvent.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/HttpsTokenSecurityEvent.java?rev=1181995&r1=1179730&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/HttpsTokenSecurityEvent.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/HttpsTokenSecurityEvent.java Tue Oct 11 18:03:00 2011
@@ -1,4 +1,4 @@
- /**
+/**
* 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
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.swssf.securityEvent;
+package org.swssf.wss.securityEvent;
/**
* @author $Author: giger $
Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/IssuedTokenSecurityEvent.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/IssuedTokenSecurityEvent.java?rev=1181995&r1=1179730&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/IssuedTokenSecurityEvent.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/IssuedTokenSecurityEvent.java Tue Oct 11 18:03:00 2011
@@ -1,4 +1,4 @@
- /**
+/**
* 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
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.swssf.securityEvent;
+package org.swssf.wss.securityEvent;
/**
* @author $Author: giger $
Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/OperationSecurityEvent.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/OperationSecurityEvent.java?rev=1181995&r1=1179730&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/OperationSecurityEvent.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/OperationSecurityEvent.java Tue Oct 11 18:03:00 2011
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.swssf.securityEvent;
+package org.swssf.wss.securityEvent;
import javax.xml.namespace.QName;
Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/RequiredElementSecurityEvent.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/RequiredElementSecurityEvent.java?rev=1181995&r1=1179730&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/RequiredElementSecurityEvent.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/RequiredElementSecurityEvent.java Tue Oct 11 18:03:00 2011
@@ -1,4 +1,4 @@
- /**
+/**
* 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
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.swssf.securityEvent;
+package org.swssf.wss.securityEvent;
import javax.xml.namespace.QName;
Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/RequiredPartSecurityEvent.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/RequiredPartSecurityEvent.java?rev=1181995&r1=1179730&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/RequiredPartSecurityEvent.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/RequiredPartSecurityEvent.java Tue Oct 11 18:03:00 2011
@@ -1,4 +1,4 @@
- /**
+/**
* 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
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.swssf.securityEvent;
+package org.swssf.wss.securityEvent;
import javax.xml.namespace.QName;
Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/SamlTokenSecurityEvent.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/SamlTokenSecurityEvent.java?rev=1181995&r1=1179730&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/SamlTokenSecurityEvent.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/SamlTokenSecurityEvent.java Tue Oct 11 18:03:00 2011
@@ -1,4 +1,4 @@
- /**
+/**
* 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
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.swssf.securityEvent;
+package org.swssf.wss.securityEvent;
import org.opensaml.common.SAMLVersion;
Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/SecureConversationSecurityEvent.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/SecureConversationSecurityEvent.java?rev=1181995&r1=1179730&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/SecureConversationSecurityEvent.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/SecureConversationSecurityEvent.java Tue Oct 11 18:03:00 2011
@@ -1,4 +1,4 @@
- /**
+/**
* 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
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.swssf.securityEvent;
+package org.swssf.wss.securityEvent;
/**
* @author $Author: giger $
Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/SecurityContextTokenSecurityEvent.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/SecurityContextTokenSecurityEvent.java?rev=1181995&r1=1179730&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/SecurityContextTokenSecurityEvent.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/SecurityContextTokenSecurityEvent.java Tue Oct 11 18:03:00 2011
@@ -1,4 +1,4 @@
- /**
+/**
* 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
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.swssf.securityEvent;
+package org.swssf.wss.securityEvent;
/**
* @author $Author: giger $
Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/SecurityEvent.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/SecurityEvent.java?rev=1181995&r1=1179730&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/SecurityEvent.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/SecurityEvent.java Tue Oct 11 18:03:00 2011
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.swssf.securityEvent;
+package org.swssf.wss.securityEvent;
/**
* @author $Author$
Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/SecurityEventListener.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/SecurityEventListener.java?rev=1181995&r1=1179730&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/SecurityEventListener.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/SecurityEventListener.java Tue Oct 11 18:03:00 2011
@@ -16,9 +16,10 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.swssf.securityEvent;
+package org.swssf.wss.securityEvent;
-import org.swssf.ext.WSSecurityException;
+
+import org.swssf.wss.ext.WSSecurityException;
/**
* @author $Author$
Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/SignatureTokenSecurityEvent.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/SignatureTokenSecurityEvent.java?rev=1181995&r1=1179730&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/SignatureTokenSecurityEvent.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/SignatureTokenSecurityEvent.java Tue Oct 11 18:03:00 2011
@@ -1,4 +1,4 @@
- /**
+/**
* 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
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.swssf.securityEvent;
+package org.swssf.wss.securityEvent;
/**
* @author $Author: giger $
Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/SignatureValueSecurityEvent.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/SignatureValueSecurityEvent.java?rev=1181995&r1=1179730&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/SignatureValueSecurityEvent.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/SignatureValueSecurityEvent.java Tue Oct 11 18:03:00 2011
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.swssf.securityEvent;
+package org.swssf.wss.securityEvent;
/**
* @author $Author$
Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/SignedElementSecurityEvent.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/SignedElementSecurityEvent.java?rev=1181995&r1=1179730&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/SignedElementSecurityEvent.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/SignedElementSecurityEvent.java Tue Oct 11 18:03:00 2011
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.swssf.securityEvent;
+package org.swssf.wss.securityEvent;
import javax.xml.namespace.QName;
Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/SignedPartSecurityEvent.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/SignedPartSecurityEvent.java?rev=1181995&r1=1179730&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/SignedPartSecurityEvent.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/SignedPartSecurityEvent.java Tue Oct 11 18:03:00 2011
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.swssf.securityEvent;
+package org.swssf.wss.securityEvent;
import javax.xml.namespace.QName;
Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/SupportingTokenSecurityEvent.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/SupportingTokenSecurityEvent.java?rev=1181995&r1=1179730&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/SupportingTokenSecurityEvent.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/SupportingTokenSecurityEvent.java Tue Oct 11 18:03:00 2011
@@ -1,4 +1,4 @@
- /**
+/**
* 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
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.swssf.securityEvent;
+package org.swssf.wss.securityEvent;
/**
* @author $Author: giger $
Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/TimestampSecurityEvent.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/TimestampSecurityEvent.java?rev=1181995&r1=1179730&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/TimestampSecurityEvent.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/TimestampSecurityEvent.java Tue Oct 11 18:03:00 2011
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.swssf.securityEvent;
+package org.swssf.wss.securityEvent;
import java.util.Calendar;
Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/TokenSecurityEvent.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/TokenSecurityEvent.java?rev=1181995&r1=1179730&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/TokenSecurityEvent.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/TokenSecurityEvent.java Tue Oct 11 18:03:00 2011
@@ -1,4 +1,4 @@
- /**
+/**
* 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
@@ -16,9 +16,9 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.swssf.securityEvent;
+package org.swssf.wss.securityEvent;
-import org.swssf.ext.SecurityToken;
+import org.swssf.xmlsec.ext.SecurityToken;
/**
* @author $Author: giger $
Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/UsernameTokenSecurityEvent.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/UsernameTokenSecurityEvent.java?rev=1181995&r1=1179730&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/UsernameTokenSecurityEvent.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/UsernameTokenSecurityEvent.java Tue Oct 11 18:03:00 2011
@@ -16,9 +16,9 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.swssf.securityEvent;
+package org.swssf.wss.securityEvent;
-import org.swssf.ext.Constants;
+import org.swssf.wss.ext.WSSConstants;
/**
* @author $Author$
@@ -26,18 +26,18 @@ import org.swssf.ext.Constants;
*/
public class UsernameTokenSecurityEvent extends TokenSecurityEvent {
- private Constants.UsernameTokenPasswordType usernameTokenPasswordType;
+ private WSSConstants.UsernameTokenPasswordType usernameTokenPasswordType;
private String usernameTokenProfile;
public UsernameTokenSecurityEvent(Event securityEventType) {
super(securityEventType);
}
- public Constants.UsernameTokenPasswordType getUsernameTokenPasswordType() {
+ public WSSConstants.UsernameTokenPasswordType getUsernameTokenPasswordType() {
return usernameTokenPasswordType;
}
- public void setUsernameTokenPasswordType(Constants.UsernameTokenPasswordType usernameTokenPasswordType) {
+ public void setUsernameTokenPasswordType(WSSConstants.UsernameTokenPasswordType usernameTokenPasswordType) {
this.usernameTokenPasswordType = usernameTokenPasswordType;
}
Copied: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/w3/_2000/_09/xmldsig_/wss/KeyInfoType.java (from r1179730, webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/w3/_2000/_09/xmldsig_/KeyInfoType.java)
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/w3/_2000/_09/xmldsig_/wss/KeyInfoType.java?p2=webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/w3/_2000/_09/xmldsig_/wss/KeyInfoType.java&p1=webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/w3/_2000/_09/xmldsig_/KeyInfoType.java&r1=1179730&r2=1181995&rev=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/w3/_2000/_09/xmldsig_/KeyInfoType.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/w3/_2000/_09/xmldsig_/wss/KeyInfoType.java Tue Oct 11 18:03:00 2011
@@ -16,27 +16,21 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.w3._2000._09.xmldsig_;
+package org.w3._2000._09.xmldsig_.wss;
import org.oasis_open.docs.wss._2004._01.oasis_200401_wss_wssecurity_secext_1_0.SecurityTokenReferenceType;
-import org.swssf.ext.Constants;
-import org.swssf.ext.ParseException;
-import org.swssf.ext.Parseable;
-import org.swssf.ext.Utils;
-import org.w3c.dom.Element;
-
-import javax.xml.bind.JAXBElement;
-import javax.xml.bind.annotation.*;
-import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+import org.swssf.wss.ext.WSSConstants;
+import org.swssf.xmlsec.ext.ParseException;
+import org.swssf.xmlsec.ext.Parseable;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
import javax.xml.stream.XMLStreamConstants;
-import javax.xml.stream.events.Attribute;
import javax.xml.stream.events.EndElement;
import javax.xml.stream.events.StartElement;
import javax.xml.stream.events.XMLEvent;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
/**
@@ -68,44 +62,18 @@ import java.util.List;
@XmlType(name = "KeyInfoType", propOrder = {
"content"
})
-public class KeyInfoType implements Parseable {
+public class KeyInfoType extends org.w3._2000._09.xmldsig_.KeyInfoType {
private Parseable currentParseable;
- @XmlElementRefs({
- @XmlElementRef(name = "SPKIData", namespace = "http://www.w3.org/2000/09/xmldsig#", type = JAXBElement.class),
- @XmlElementRef(name = "KeyName", namespace = "http://www.w3.org/2000/09/xmldsig#", type = JAXBElement.class),
- @XmlElementRef(name = "X509Data", namespace = "http://www.w3.org/2000/09/xmldsig#", type = JAXBElement.class),
- @XmlElementRef(name = "MgmtData", namespace = "http://www.w3.org/2000/09/xmldsig#", type = JAXBElement.class),
- @XmlElementRef(name = "KeyValue", namespace = "http://www.w3.org/2000/09/xmldsig#", type = JAXBElement.class),
- @XmlElementRef(name = "RetrievalMethod", namespace = "http://www.w3.org/2000/09/xmldsig#", type = JAXBElement.class),
- @XmlElementRef(name = "PGPData", namespace = "http://www.w3.org/2000/09/xmldsig#", type = JAXBElement.class)
- })
- @XmlMixed
- @XmlAnyElement(lax = true)
- protected List<Object> content;
@XmlElement(name = "SecurityTokenReference", namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd")
protected SecurityTokenReferenceType securityTokenReferenceType;
- @XmlAttribute(name = "Id")
- @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
- @XmlID
- @XmlSchemaType(name = "ID")
- protected String id;
public KeyInfoType() {
-
}
public KeyInfoType(StartElement startElement) {
- @SuppressWarnings("unchecked")
- Iterator<Attribute> attributeIterator = startElement.getAttributes();
- while (attributeIterator.hasNext()) {
- Attribute attribute = attributeIterator.next();
- if (attribute.getName().equals(Constants.ATT_NULL_Id)) {
- CollapsedStringAdapter collapsedStringAdapter = new CollapsedStringAdapter();
- this.id = collapsedStringAdapter.unmarshal(attribute.getValue());
- }
- }
+ super(startElement);
}
public boolean parseXMLEvent(XMLEvent xmlEvent) throws ParseException {
@@ -122,92 +90,29 @@ public class KeyInfoType implements Pars
case XMLStreamConstants.START_ELEMENT:
StartElement startElement = xmlEvent.asStartElement();
- if (startElement.getName().equals(Constants.TAG_wsse_SecurityTokenReference)) {
+ if (startElement.getName().equals(WSSConstants.TAG_wsse_SecurityTokenReference)) {
currentParseable = this.securityTokenReferenceType = new SecurityTokenReferenceType(startElement);
- } else {
- throw new ParseException("Unsupported Element: " + startElement.getName());
+ return false;
}
-
break;
case XMLStreamConstants.END_ELEMENT:
currentParseable = null;
EndElement endElement = xmlEvent.asEndElement();
- if (endElement.getName().equals(Constants.TAG_dsig_KeyInfo)) {
+ if (endElement.getName().equals(WSSConstants.TAG_wsse_SecurityTokenReference)) {
return true;
}
break;
- //possible ignorable withespace and comments
- case XMLStreamConstants.CHARACTERS:
- case XMLStreamConstants.COMMENT:
- break;
- default:
- throw new ParseException("Unexpected event received " + Utils.getXMLEventAsString(xmlEvent));
}
- return false;
+ return super.parseXMLEvent(xmlEvent);
}
public void validate() throws ParseException {
+ super.validate();
if (securityTokenReferenceType == null) {
throw new ParseException("Element \"SecurityTokenReference\" is missing");
}
}
- /**
- * Gets the value of the content property.
- * <p/>
- * <p/>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the content property.
- * <p/>
- * <p/>
- * For example, to add a new item, do as follows:
- * <pre>
- * getContent().add(newItem);
- * </pre>
- * <p/>
- * <p/>
- * <p/>
- * Objects of the following type(s) are allowed in the list
- * {@link Element }
- * {@link Object }
- * {@link JAXBElement }{@code <}{@link SPKIDataType }{@code >}
- * {@link JAXBElement }{@code <}{@link String }{@code >}
- * {@link JAXBElement }{@code <}{@link X509DataType }{@code >}
- * {@link JAXBElement }{@code <}{@link String }{@code >}
- * {@link JAXBElement }{@code <}{@link KeyValueType }{@code >}
- * {@link JAXBElement }{@code <}{@link RetrievalMethodType }{@code >}
- * {@link JAXBElement }{@code <}{@link PGPDataType }{@code >}
- * {@link String }
- */
- public List<Object> getContent() {
- if (content == null) {
- content = new ArrayList<Object>();
- }
- return this.content;
- }
-
- /**
- * Gets the value of the id property.
- *
- * @return possible object is
- * {@link String }
- */
- public String getId() {
- return id;
- }
-
- /**
- * Sets the value of the id property.
- *
- * @param value allowed object is
- * {@link String }
- */
- public void setId(String value) {
- this.id = value;
- }
-
public SecurityTokenReferenceType getSecurityTokenReferenceType() {
return securityTokenReferenceType;
}
Copied: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/w3/_2000/_09/xmldsig_/wss/ReferenceType.java (from r1179730, webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/w3/_2000/_09/xmldsig_/ReferenceType.java)
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/w3/_2000/_09/xmldsig_/wss/ReferenceType.java?p2=webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/w3/_2000/_09/xmldsig_/wss/ReferenceType.java&p1=webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/w3/_2000/_09/xmldsig_/ReferenceType.java&r1=1179730&r2=1181995&rev=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/w3/_2000/_09/xmldsig_/ReferenceType.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/w3/_2000/_09/xmldsig_/wss/ReferenceType.java Tue Oct 11 18:03:00 2011
@@ -16,282 +16,13 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.w3._2000._09.xmldsig_;
+package org.w3._2000._09.xmldsig_.wss;
-import org.swssf.ext.Constants;
-import org.swssf.ext.ParseException;
-import org.swssf.ext.Parseable;
-import org.swssf.ext.Utils;
-
-import javax.xml.bind.annotation.*;
-import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-import javax.xml.stream.XMLStreamConstants;
-import javax.xml.stream.events.Attribute;
-import javax.xml.stream.events.EndElement;
import javax.xml.stream.events.StartElement;
-import javax.xml.stream.events.XMLEvent;
-import java.util.Iterator;
-
-
-/**
- * <p>Java class for ReferenceType complex type.
- * <p/>
- * <p>The following schema fragment specifies the expected content contained within this class.
- * <p/>
- * <pre>
- * <complexType name="ReferenceType">
- * <complexContent>
- * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * <sequence>
- * <element ref="{http://www.w3.org/2000/09/xmldsig#}Transforms" minOccurs="0"/>
- * <element ref="{http://www.w3.org/2000/09/xmldsig#}DigestMethod"/>
- * <element ref="{http://www.w3.org/2000/09/xmldsig#}DigestValue"/>
- * </sequence>
- * <attribute name="Id" type="{http://www.w3.org/2001/XMLSchema}ID" />
- * <attribute name="URI" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
- * <attribute name="Type" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
- * </restriction>
- * </complexContent>
- * </complexType>
- * </pre>
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "ReferenceType", propOrder = {
- "transforms",
- "digestMethod",
- "digestValue"
-})
-public class ReferenceType implements Parseable {
-
- @XmlElement(name = "Transforms")
- protected TransformsType transforms;
- @XmlElement(name = "DigestMethod", required = true)
- protected DigestMethodType digestMethod;
- @XmlElement(name = "DigestValue", required = true)
- protected byte[] digestValue;
- @XmlAttribute(name = "Id")
- @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
- @XmlID
- @XmlSchemaType(name = "ID")
- protected String id;
- @XmlAttribute(name = "URI")
- @XmlSchemaType(name = "anyURI")
- protected String uri;
- @XmlAttribute(name = "Type")
- @XmlSchemaType(name = "anyURI")
- protected String type;
-
- private boolean processed = false;
- private Parseable currentParseable;
+public class ReferenceType extends org.w3._2000._09.xmldsig_.ReferenceType {
public ReferenceType(StartElement startElement) {
- @SuppressWarnings("unchecked")
- Iterator<Attribute> attributeIterator = startElement.getAttributes();
- while (attributeIterator.hasNext()) {
- Attribute attribute = attributeIterator.next();
- if (attribute.getName().equals(Constants.ATT_NULL_Id)) {
- CollapsedStringAdapter collapsedStringAdapter = new CollapsedStringAdapter();
- this.id = collapsedStringAdapter.unmarshal(attribute.getValue());
- } else if (attribute.getName().equals(Constants.ATT_NULL_URI)) {
- this.uri = Utils.dropReferenceMarker(attribute.getValue());
- } else if (attribute.getName().equals(Constants.ATT_NULL_Type)) {
- this.type = attribute.getValue();
- }
- }
- }
-
- public boolean parseXMLEvent(XMLEvent xmlEvent) throws ParseException {
- if (currentParseable != null) {
- boolean finished = currentParseable.parseXMLEvent(xmlEvent);
- if (finished) {
- currentParseable.validate();
- currentParseable = null;
- }
- return false;
- }
-
- switch (xmlEvent.getEventType()) {
- case XMLStreamConstants.START_ELEMENT:
- StartElement startElement = xmlEvent.asStartElement();
-
- if (startElement.getName().equals(Constants.TAG_dsig_Transforms)) {
- currentParseable = this.transforms = new TransformsType(startElement);
- } else if (startElement.getName().equals(Constants.TAG_dsig_DigestMethod)) {
- currentParseable = this.digestMethod = new DigestMethodType(startElement);
- } else if (startElement.getName().equals(Constants.TAG_dsig_DigestValue)) {
- currentParseable = new Parseable() {
- public boolean parseXMLEvent(XMLEvent xmlEvent) throws ParseException {
- switch (xmlEvent.getEventType()) {
- case XMLStreamConstants.START_ELEMENT:
- StartElement startElement = xmlEvent.asStartElement();
- throw new ParseException("Unsupported Element: " + startElement.getName());
- case XMLStreamConstants.END_ELEMENT:
- return true;
- case XMLStreamConstants.CHARACTERS:
- digestValue = xmlEvent.asCharacters().getData().getBytes();
- break;
- }
- return false;
- }
-
- public void validate() throws ParseException {
- }
- };
- } else {
- throw new ParseException("Unsupported Element: " + startElement.getName());
- }
-
- break;
- case XMLStreamConstants.END_ELEMENT:
- currentParseable = null;
- EndElement endElement = xmlEvent.asEndElement();
- if (endElement.getName().equals(Constants.TAG_dsig_Reference)) {
- return true;
- }
- break;
- //possible ignorable withespace and comments
- case XMLStreamConstants.CHARACTERS:
- case XMLStreamConstants.COMMENT:
- break;
- default:
- throw new ParseException("Unexpected event received " + Utils.getXMLEventAsString(xmlEvent));
- }
- return false;
- }
-
- public void validate() throws ParseException {
- if (digestMethod == null || digestValue == null || uri == null) {
- throw new ParseException("Element \"DigestMethod\"|\"DigestValue\" or Attribute \"uri\" is missing");
- }
- }
-
- /**
- * Gets the value of the transforms property.
- *
- * @return possible object is
- * {@link TransformsType }
- */
- public TransformsType getTransforms() {
- return transforms;
- }
-
- /**
- * Sets the value of the transforms property.
- *
- * @param value allowed object is
- * {@link TransformsType }
- */
- public void setTransforms(TransformsType value) {
- this.transforms = value;
- }
-
- /**
- * Gets the value of the digestMethod property.
- *
- * @return possible object is
- * {@link DigestMethodType }
- */
- public DigestMethodType getDigestMethod() {
- return digestMethod;
- }
-
- /**
- * Sets the value of the digestMethod property.
- *
- * @param value allowed object is
- * {@link DigestMethodType }
- */
- public void setDigestMethod(DigestMethodType value) {
- this.digestMethod = value;
- }
-
- /**
- * Gets the value of the digestValue property.
- *
- * @return possible object is
- * byte[]
- */
- public byte[] getDigestValue() {
- return digestValue;
- }
-
- /**
- * Sets the value of the digestValue property.
- *
- * @param value allowed object is
- * byte[]
- */
- public void setDigestValue(byte[] value) {
- this.digestValue = value;
- }
-
- /**
- * Gets the value of the id property.
- *
- * @return possible object is
- * {@link String }
- */
- public String getId() {
- return id;
- }
-
- /**
- * Sets the value of the id property.
- *
- * @param value allowed object is
- * {@link String }
- */
- public void setId(String value) {
- this.id = value;
- }
-
- /**
- * Gets the value of the uri property.
- *
- * @return possible object is
- * {@link String }
- */
- public String getURI() {
- return uri;
- }
-
- /**
- * Sets the value of the uri property.
- *
- * @param value allowed object is
- * {@link String }
- */
- public void setURI(String value) {
- this.uri = value;
- }
-
- /**
- * Gets the value of the type property.
- *
- * @return possible object is
- * {@link String }
- */
- public String getType() {
- return type;
- }
-
- /**
- * Sets the value of the type property.
- *
- * @param value allowed object is
- * {@link String }
- */
- public void setType(String value) {
- this.type = value;
- }
-
- public boolean isProcessed() {
- return processed;
- }
-
- public void setProcessed(boolean processed) {
- this.processed = processed;
+ super(startElement);
}
}