You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ws.apache.org by co...@apache.org on 2012/08/17 17:41:05 UTC
svn commit: r1374326 [2/5] - in /webservices/wss4j/trunk:
cxf-integration/src/test/java/org/swssf/cxfIntegration/test/integration/
cxf-integration/src/test/resources/integration/ policy/
streaming-ws-security/src/test/java/org/apache/ws/security/stax/w...
Modified: webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/CallbackLookup.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/CallbackLookup.java?rev=1374326&r1=1374325&r2=1374326&view=diff
==============================================================================
--- webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/CallbackLookup.java (original)
+++ webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/CallbackLookup.java Fri Aug 17 15:40:59 2012
@@ -21,7 +21,7 @@ package org.apache.ws.security.message;
import java.util.List;
-import org.apache.ws.security.WSSecurityException;
+import org.apache.ws.security.common.ext.WSSecurityException;
import org.w3c.dom.Element;
/**
Modified: webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/DOMCallbackLookup.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/DOMCallbackLookup.java?rev=1374326&r1=1374325&r2=1374326&view=diff
==============================================================================
--- webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/DOMCallbackLookup.java (original)
+++ webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/DOMCallbackLookup.java Fri Aug 17 15:40:59 2012
@@ -23,7 +23,7 @@ import java.util.Collections;
import java.util.List;
import org.apache.ws.security.WSConstants;
-import org.apache.ws.security.WSSecurityException;
+import org.apache.ws.security.common.ext.WSSecurityException;
import org.apache.ws.security.util.WSSecurityUtil;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
Modified: webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/WSSecDKEncrypt.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/WSSecDKEncrypt.java?rev=1374326&r1=1374325&r2=1374326&view=diff
==============================================================================
--- webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/WSSecDKEncrypt.java (original)
+++ webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/WSSecDKEncrypt.java Fri Aug 17 15:40:59 2012
@@ -22,7 +22,7 @@ package org.apache.ws.security.message;
import org.apache.ws.security.WSConstants;
import org.apache.ws.security.WSEncryptionPart;
import org.apache.ws.security.WSSConfig;
-import org.apache.ws.security.WSSecurityException;
+import org.apache.ws.security.common.ext.WSSecurityException;
import org.apache.ws.security.conversation.ConversationException;
import org.apache.ws.security.message.token.Reference;
import org.apache.ws.security.message.token.SecurityTokenReference;
Modified: webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/WSSecDKSign.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/WSSecDKSign.java?rev=1374326&r1=1374325&r2=1374326&view=diff
==============================================================================
--- webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/WSSecDKSign.java (original)
+++ webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/WSSecDKSign.java Fri Aug 17 15:40:59 2012
@@ -23,7 +23,7 @@ import org.apache.ws.security.WSConstant
import org.apache.ws.security.WSDocInfo;
import org.apache.ws.security.WSEncryptionPart;
import org.apache.ws.security.WSSConfig;
-import org.apache.ws.security.WSSecurityException;
+import org.apache.ws.security.common.ext.WSSecurityException;
import org.apache.ws.security.conversation.ConversationException;
import org.apache.ws.security.message.token.Reference;
import org.apache.ws.security.message.token.SecurityTokenReference;
@@ -158,7 +158,7 @@ public class WSSecDKSign extends WSSecDe
} catch (Exception ex) {
log.error("", ex);
throw new WSSecurityException(
- WSSecurityException.FAILED_SIGNATURE, "noXMLSig", null, ex
+ WSSecurityException.ErrorCode.FAILED_SIGNATURE, "noXMLSig", null, ex
);
}
@@ -301,7 +301,7 @@ public class WSSecDKSign extends WSSecDe
} catch (Exception ex) {
log.error(ex);
throw new WSSecurityException(
- WSSecurityException.FAILED_SIGNATURE, null, null, ex
+ WSSecurityException.ErrorCode.FAILED_SIGNATURE, null, null, ex
);
}
}
Modified: webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/WSSecDerivedKeyBase.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/WSSecDerivedKeyBase.java?rev=1374326&r1=1374325&r2=1374326&view=diff
==============================================================================
--- webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/WSSecDerivedKeyBase.java (original)
+++ webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/WSSecDerivedKeyBase.java Fri Aug 17 15:40:59 2012
@@ -21,7 +21,7 @@ package org.apache.ws.security.message;
import org.apache.ws.security.WSConstants;
import org.apache.ws.security.WSSConfig;
-import org.apache.ws.security.WSSecurityException;
+import org.apache.ws.security.common.ext.WSSecurityException;
import org.apache.ws.security.conversation.ConversationConstants;
import org.apache.ws.security.conversation.ConversationException;
import org.apache.ws.security.conversation.dkalgo.AlgoFactory;
Modified: webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/WSSecEncrypt.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/WSSecEncrypt.java?rev=1374326&r1=1374325&r2=1374326&view=diff
==============================================================================
--- webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/WSSecEncrypt.java (original)
+++ webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/WSSecEncrypt.java Fri Aug 17 15:40:59 2012
@@ -22,9 +22,9 @@ package org.apache.ws.security.message;
import org.apache.ws.security.WSConstants;
import org.apache.ws.security.WSEncryptionPart;
import org.apache.ws.security.WSSConfig;
-import org.apache.ws.security.WSSecurityException;
-import org.apache.ws.security.components.crypto.Crypto;
-import org.apache.ws.security.components.crypto.CryptoType;
+import org.apache.ws.security.common.crypto.Crypto;
+import org.apache.ws.security.common.crypto.CryptoType;
+import org.apache.ws.security.common.ext.WSSecurityException;
import org.apache.ws.security.message.token.KerberosSecurity;
import org.apache.ws.security.message.token.Reference;
import org.apache.ws.security.message.token.SecurityTokenReference;
@@ -172,7 +172,7 @@ public class WSSecEncrypt extends WSSecE
X509Certificate[] certs = crypto.getX509Certificates(cryptoType);
if (certs == null || certs.length <= 0) {
throw new WSSecurityException(
- WSSecurityException.FAILURE,
+ WSSecurityException.ErrorCode.FAILURE,
"noUserCertsFound",
new Object[] { user, "encryption" }
);
@@ -215,7 +215,7 @@ public class WSSecEncrypt extends WSSecE
//
if (symmetricKey == null) {
if (embeddedKey == null) {
- throw new WSSecurityException(WSSecurityException.FAILURE, "noKeySupplied");
+ throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "noKeySupplied");
}
symmetricKey = WSSecurityUtil.prepareSecretKey(symEncAlgo, embeddedKey);
}
@@ -378,7 +378,7 @@ public class WSSecEncrypt extends WSSecE
xmlCipher = XMLCipher.getInstance(encryptionAlgorithm);
} catch (XMLEncryptionException ex) {
throw new WSSecurityException(
- WSSecurityException.UNSUPPORTED_ALGORITHM, null, null, ex
+ WSSecurityException.ErrorCode.UNSUPPORTED_ALGORITHM, null, null, ex
);
}
@@ -395,7 +395,7 @@ public class WSSecEncrypt extends WSSecE
WSSecurityUtil.findElements(encPart, callbackLookup, doc);
if (elementsToEncrypt == null || elementsToEncrypt.size() == 0) {
throw new WSSecurityException(
- WSSecurityException.FAILURE,
+ WSSecurityException.ErrorCode.FAILURE,
"noEncElement",
new Object[] {"{" + encPart.getNamespace() + "}" + encPart.getName()}
);
@@ -415,7 +415,7 @@ public class WSSecEncrypt extends WSSecE
keyInfo = new KeyInfo((Element) keyInfo.getElement().cloneNode(true), null);
} catch (Exception ex) {
throw new WSSecurityException(
- WSSecurityException.FAILED_ENCRYPTION, null, null, ex
+ WSSecurityException.ErrorCode.FAILED_ENCRYPTION, null, null, ex
);
}
}
@@ -491,7 +491,7 @@ public class WSSecEncrypt extends WSSecE
return xencEncryptedDataId;
} catch (Exception ex) {
throw new WSSecurityException(
- WSSecurityException.FAILED_ENCRYPTION, null, null, ex
+ WSSecurityException.ErrorCode.FAILED_ENCRYPTION, null, null, ex
);
}
}
Modified: webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/WSSecEncryptedKey.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/WSSecEncryptedKey.java?rev=1374326&r1=1374325&r2=1374326&view=diff
==============================================================================
--- webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/WSSecEncryptedKey.java (original)
+++ webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/WSSecEncryptedKey.java Fri Aug 17 15:40:59 2012
@@ -34,9 +34,9 @@ import javax.crypto.spec.PSource;
import org.apache.ws.security.WSConstants;
import org.apache.ws.security.WSSConfig;
-import org.apache.ws.security.WSSecurityException;
-import org.apache.ws.security.components.crypto.Crypto;
-import org.apache.ws.security.components.crypto.CryptoType;
+import org.apache.ws.security.common.crypto.Crypto;
+import org.apache.ws.security.common.crypto.CryptoType;
+import org.apache.ws.security.common.ext.WSSecurityException;
import org.apache.ws.security.message.token.BinarySecurity;
import org.apache.ws.security.message.token.DOMX509Data;
import org.apache.ws.security.message.token.DOMX509IssuerSerial;
@@ -209,7 +209,7 @@ public class WSSecEncryptedKey extends W
X509Certificate[] certs = crypto.getX509Certificates(cryptoType);
if (certs == null || certs.length <= 0) {
throw new WSSecurityException(
- WSSecurityException.FAILURE,
+ WSSecurityException.ErrorCode.FAILURE,
"noUserCertsFound",
new Object[] {user, "encryption"}
);
@@ -258,11 +258,11 @@ public class WSSecEncryptedKey extends W
}
} catch (InvalidKeyException e) {
throw new WSSecurityException(
- WSSecurityException.FAILED_ENCRYPTION, null, null, e
+ WSSecurityException.ErrorCode.FAILED_ENCRYPTION, null, null, e
);
} catch (InvalidAlgorithmParameterException e) {
throw new WSSecurityException(
- WSSecurityException.FAILED_ENCRYPTION, null, null, e
+ WSSecurityException.ErrorCode.FAILED_ENCRYPTION, null, null, e
);
}
int blockSize = cipher.getBlockSize();
@@ -276,15 +276,15 @@ public class WSSecEncryptedKey extends W
encryptedEphemeralKey = cipher.wrap(secretKey);
} catch (IllegalStateException ex) {
throw new WSSecurityException(
- WSSecurityException.FAILED_ENCRYPTION, null, null, ex
+ WSSecurityException.ErrorCode.FAILED_ENCRYPTION, null, null, ex
);
} catch (IllegalBlockSizeException ex) {
throw new WSSecurityException(
- WSSecurityException.FAILED_ENCRYPTION, null, null, ex
+ WSSecurityException.ErrorCode.FAILED_ENCRYPTION, null, null, ex
);
} catch (InvalidKeyException ex) {
throw new WSSecurityException(
- WSSecurityException.FAILED_ENCRYPTION, null, null, ex
+ WSSecurityException.ErrorCode.FAILED_ENCRYPTION, null, null, ex
);
}
Text keyText =
@@ -394,7 +394,7 @@ public class WSSecEncryptedKey extends W
break;
default:
- throw new WSSecurityException(WSSecurityException.FAILURE, "unsupportedKeyId");
+ throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "unsupportedKeyId");
}
Element keyInfoElement =
document.createElementNS(
@@ -435,7 +435,7 @@ public class WSSecEncryptedKey extends W
return keyGen;
} catch (NoSuchAlgorithmException e) {
throw new WSSecurityException(
- WSSecurityException.UNSUPPORTED_ALGORITHM, null, null, e
+ WSSecurityException.ErrorCode.UNSUPPORTED_ALGORITHM, null, null, e
);
}
}
Modified: webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/WSSecHeader.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/WSSecHeader.java?rev=1374326&r1=1374325&r2=1374326&view=diff
==============================================================================
--- webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/WSSecHeader.java (original)
+++ webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/WSSecHeader.java Fri Aug 17 15:40:59 2012
@@ -19,7 +19,7 @@
package org.apache.ws.security.message;
import org.apache.ws.security.WSConstants;
-import org.apache.ws.security.WSSecurityException;
+import org.apache.ws.security.common.ext.WSSecurityException;
import org.apache.ws.security.util.WSSecurityUtil;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
Modified: webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/WSSecSAMLToken.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/WSSecSAMLToken.java?rev=1374326&r1=1374325&r2=1374326&view=diff
==============================================================================
--- webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/WSSecSAMLToken.java (original)
+++ webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/WSSecSAMLToken.java Fri Aug 17 15:40:59 2012
@@ -20,7 +20,7 @@
package org.apache.ws.security.message;
import org.apache.ws.security.WSSConfig;
-import org.apache.ws.security.WSSecurityException;
+import org.apache.ws.security.common.ext.WSSecurityException;
import org.apache.ws.security.saml.ext.AssertionWrapper;
import org.apache.ws.security.util.WSSecurityUtil;
Modified: webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/WSSecSecurityContextToken.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/WSSecSecurityContextToken.java?rev=1374326&r1=1374325&r2=1374326&view=diff
==============================================================================
--- webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/WSSecSecurityContextToken.java (original)
+++ webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/WSSecSecurityContextToken.java Fri Aug 17 15:40:59 2012
@@ -19,8 +19,8 @@
package org.apache.ws.security.message;
-import org.apache.ws.security.WSSecurityException;
-import org.apache.ws.security.components.crypto.Crypto;
+import org.apache.ws.security.common.crypto.Crypto;
+import org.apache.ws.security.common.ext.WSSecurityException;
import org.apache.ws.security.conversation.ConversationConstants;
import org.apache.ws.security.conversation.ConversationException;
import org.apache.ws.security.message.token.SecurityContextToken;
Modified: webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/WSSecSignature.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/WSSecSignature.java?rev=1374326&r1=1374325&r2=1374326&view=diff
==============================================================================
--- webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/WSSecSignature.java (original)
+++ webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/WSSecSignature.java Fri Aug 17 15:40:59 2012
@@ -23,9 +23,9 @@ import org.apache.ws.security.WSConstant
import org.apache.ws.security.WSDocInfo;
import org.apache.ws.security.WSEncryptionPart;
import org.apache.ws.security.WSSConfig;
-import org.apache.ws.security.WSSecurityException;
-import org.apache.ws.security.components.crypto.Crypto;
-import org.apache.ws.security.components.crypto.CryptoType;
+import org.apache.ws.security.common.crypto.Crypto;
+import org.apache.ws.security.common.crypto.CryptoType;
+import org.apache.ws.security.common.ext.WSSecurityException;
import org.apache.ws.security.message.token.BinarySecurity;
import org.apache.ws.security.message.token.DOMX509Data;
import org.apache.ws.security.message.token.DOMX509IssuerSerial;
@@ -179,7 +179,7 @@ public class WSSecSignature extends WSSe
} catch (Exception ex) {
log.error("", ex);
throw new WSSecurityException(
- WSSecurityException.FAILED_SIGNATURE, "noXMLSig", null, ex
+ WSSecurityException.ErrorCode.FAILED_SIGNATURE, "noXMLSig", null, ex
);
}
@@ -316,12 +316,12 @@ public class WSSecSignature extends WSSe
} catch (java.security.KeyException ex) {
log.error("", ex);
throw new WSSecurityException(
- WSSecurityException.FAILED_SIGNATURE, "noXMLSig", null, ex
+ WSSecurityException.ErrorCode.FAILED_SIGNATURE, "noXMLSig", null, ex
);
}
break;
default:
- throw new WSSecurityException(WSSecurityException.FAILURE, "unsupportedKeyId");
+ throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "unsupportedKeyId");
}
}
@@ -556,7 +556,7 @@ public class WSSecSignature extends WSSe
} catch (Exception ex) {
log.error(ex);
throw new WSSecurityException(
- WSSecurityException.FAILED_SIGNATURE, null, null, ex
+ WSSecurityException.ErrorCode.FAILED_SIGNATURE, null, null, ex
);
}
}
@@ -788,7 +788,7 @@ public class WSSecSignature extends WSSe
}
if (certs == null || certs.length <= 0) {
throw new WSSecurityException(
- WSSecurityException.FAILURE,
+ WSSecurityException.ErrorCode.FAILURE,
"noUserCertsFound",
new Object[] { user, "signature" }
);
@@ -807,7 +807,7 @@ public class WSSecSignature extends WSSe
sigAlgo = WSConstants.RSA;
} else {
throw new WSSecurityException(
- WSSecurityException.FAILURE,
+ WSSecurityException.ErrorCode.FAILURE,
"unknownSignatureAlgorithm",
new Object[] {pubKeyAlgo}
);
Modified: webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/WSSecSignatureBase.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/WSSecSignatureBase.java?rev=1374326&r1=1374325&r2=1374326&view=diff
==============================================================================
--- webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/WSSecSignatureBase.java (original)
+++ webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/WSSecSignatureBase.java Fri Aug 17 15:40:59 2012
@@ -23,7 +23,7 @@ import org.apache.ws.security.WSConstant
import org.apache.ws.security.WSDocInfo;
import org.apache.ws.security.WSEncryptionPart;
import org.apache.ws.security.WSSConfig;
-import org.apache.ws.security.WSSecurityException;
+import org.apache.ws.security.common.ext.WSSecurityException;
import org.apache.ws.security.transform.STRTransform;
import org.apache.ws.security.util.WSSecurityUtil;
import org.w3c.dom.Document;
@@ -86,7 +86,7 @@ public class WSSecSignatureBase extends
} catch (Exception ex) {
log.error("", ex);
throw new WSSecurityException(
- WSSecurityException.FAILED_SIGNATURE, "noXMLSig", null, ex
+ WSSecurityException.ErrorCode.FAILED_SIGNATURE, "noXMLSig", null, ex
);
}
@@ -158,7 +158,7 @@ public class WSSecSignatureBase extends
}
if (elementsToSign == null || elementsToSign.size() == 0) {
throw new WSSecurityException(
- WSSecurityException.FAILURE,
+ WSSecurityException.ErrorCode.FAILURE,
"noEncElement",
new Object[] {nmSpace + ", " + elemName}
);
@@ -189,7 +189,7 @@ public class WSSecSignatureBase extends
} catch (Exception ex) {
log.error("", ex);
throw new WSSecurityException(
- WSSecurityException.FAILED_SIGNATURE, "noXMLSig", null, ex
+ WSSecurityException.ErrorCode.FAILED_SIGNATURE, "noXMLSig", null, ex
);
}
}
Modified: webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/WSSecUsernameToken.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/WSSecUsernameToken.java?rev=1374326&r1=1374325&r2=1374326&view=diff
==============================================================================
--- webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/WSSecUsernameToken.java (original)
+++ webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/WSSecUsernameToken.java Fri Aug 17 15:40:59 2012
@@ -21,7 +21,7 @@ package org.apache.ws.security.message;
import org.apache.ws.security.WSConstants;
import org.apache.ws.security.WSSConfig;
-import org.apache.ws.security.WSSecurityException;
+import org.apache.ws.security.common.ext.WSSecurityException;
import org.apache.ws.security.message.token.UsernameToken;
import org.apache.ws.security.util.Base64;
import org.apache.ws.security.util.WSSecurityUtil;
Modified: webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/token/BinarySecurity.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/token/BinarySecurity.java?rev=1374326&r1=1374325&r2=1374326&view=diff
==============================================================================
--- webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/token/BinarySecurity.java (original)
+++ webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/token/BinarySecurity.java Fri Aug 17 15:40:59 2012
@@ -23,7 +23,7 @@ import java.io.IOException;
import java.util.Arrays;
import org.apache.ws.security.WSConstants;
-import org.apache.ws.security.WSSecurityException;
+import org.apache.ws.security.common.ext.WSSecurityException;
import org.apache.ws.security.util.DOM2Writer;
import org.apache.ws.security.util.WSSecurityUtil;
import org.apache.ws.security.util.Base64;
@@ -71,7 +71,7 @@ public class BinarySecurity {
QName el = new QName(element.getNamespaceURI(), element.getLocalName());
if (!(el.equals(TOKEN_BST) || el.equals(TOKEN_KI))) {
throw new WSSecurityException(
- WSSecurityException.INVALID_SECURITY_TOKEN,
+ WSSecurityException.ErrorCode.INVALID_SECURITY_TOKEN,
"unhandledToken",
new Object[] {el}
);
@@ -80,7 +80,7 @@ public class BinarySecurity {
if (bspCompliant && !BASE64_ENCODING.equals(encoding)) {
// The EncodingType attribute must be specified, and must be equal to Base64Binary
throw new WSSecurityException(
- WSSecurityException.INVALID_SECURITY_TOKEN,
+ WSSecurityException.ErrorCode.INVALID_SECURITY_TOKEN,
"badEncodingType",
new Object[] {encoding}
);
@@ -89,7 +89,7 @@ public class BinarySecurity {
String valueType = getValueType();
if (bspCompliant && (valueType == null || "".equals(valueType))) {
throw new WSSecurityException(
- WSSecurityException.INVALID_SECURITY_TOKEN,
+ WSSecurityException.ErrorCode.INVALID_SECURITY_TOKEN,
"invalidValueType",
new Object[]{valueType}
);
@@ -115,7 +115,7 @@ public class BinarySecurity {
public BinarySecurity(CallbackHandler callbackHandler) throws WSSecurityException {
if (callbackHandler == null) {
LOG.debug("Trying to create a BinarySecurityToken via a null CallbackHandler");
- throw new WSSecurityException(WSSecurityException.FAILURE);
+ throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE);
}
TokenElementCallback[] callback = new TokenElementCallback[] { new TokenElementCallback() };
@@ -133,7 +133,7 @@ public class BinarySecurity {
element = callback[0].getTokenElement();
if (element == null) {
LOG.debug("CallbackHandler did not return a token element");
- throw new WSSecurityException(WSSecurityException.FAILURE);
+ throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE);
}
}
Modified: webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/token/DOMX509Data.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/token/DOMX509Data.java?rev=1374326&r1=1374325&r2=1374326&view=diff
==============================================================================
--- webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/token/DOMX509Data.java (original)
+++ webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/token/DOMX509Data.java Fri Aug 17 15:40:59 2012
@@ -20,7 +20,7 @@
package org.apache.ws.security.message.token;
import org.apache.ws.security.WSConstants;
-import org.apache.ws.security.WSSecurityException;
+import org.apache.ws.security.common.ext.WSSecurityException;
import org.apache.ws.security.util.DOM2Writer;
import org.apache.ws.security.util.WSSecurityUtil;
import org.w3c.dom.Document;
Modified: webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/token/DerivedKeyToken.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/token/DerivedKeyToken.java?rev=1374326&r1=1374325&r2=1374326&view=diff
==============================================================================
--- webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/token/DerivedKeyToken.java (original)
+++ webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/token/DerivedKeyToken.java Fri Aug 17 15:40:59 2012
@@ -27,7 +27,7 @@ import javax.xml.namespace.QName;
import org.apache.ws.security.WSConstants;
import org.apache.ws.security.WSDerivedKeyTokenPrincipal;
-import org.apache.ws.security.WSSecurityException;
+import org.apache.ws.security.common.ext.WSSecurityException;
import org.apache.ws.security.conversation.ConversationConstants;
import org.apache.ws.security.conversation.ConversationException;
import org.apache.ws.security.conversation.dkalgo.AlgoFactory;
@@ -123,7 +123,7 @@ public class DerivedKeyToken {
if (!(el.equals(ConversationConstants.DERIVED_KEY_TOKEN_QNAME_05_02) ||
el.equals(ConversationConstants.DERIVED_KEY_TOKEN_QNAME_05_12))) {
throw new WSSecurityException(
- WSSecurityException.INVALID_SECURITY_TOKEN
+ WSSecurityException.ErrorCode.INVALID_SECURITY_TOKEN
);
}
elementSecurityTokenReference =
@@ -553,7 +553,7 @@ public class DerivedKeyToken {
} catch (Exception e) {
throw new WSSecurityException(
- WSSecurityException.FAILURE, null, null, e
+ WSSecurityException.ErrorCode.FAILURE, null, null, e
);
}
}
Modified: webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/token/KerberosSecurity.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/token/KerberosSecurity.java?rev=1374326&r1=1374325&r2=1374326&view=diff
==============================================================================
--- webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/token/KerberosSecurity.java (original)
+++ webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/token/KerberosSecurity.java Fri Aug 17 15:40:59 2012
@@ -30,7 +30,7 @@ import javax.security.auth.login.LoginCo
import javax.security.auth.login.LoginException;
import org.apache.ws.security.WSConstants;
-import org.apache.ws.security.WSSecurityException;
+import org.apache.ws.security.common.ext.WSSecurityException;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -67,7 +67,7 @@ public class KerberosSecurity extends Bi
String valueType = getValueType();
if (bspCompliant && !WSConstants.WSS_GSS_KRB_V5_AP_REQ.equals(valueType)) {
throw new WSSecurityException(
- WSSecurityException.INVALID_SECURITY_TOKEN,
+ WSSecurityException.ErrorCode.INVALID_SECURITY_TOKEN,
"invalidValueType",
new Object[]{valueType}
);
@@ -136,7 +136,7 @@ public class KerberosSecurity extends Bi
log.debug(ex.getMessage(), ex);
}
throw new WSSecurityException(
- WSSecurityException.FAILURE,
+ WSSecurityException.ErrorCode.FAILURE,
"kerberosLoginError",
new Object[] {ex.getMessage()},
ex
@@ -150,7 +150,7 @@ public class KerberosSecurity extends Bi
Set<Principal> clientPrincipals = clientSubject.getPrincipals();
if (clientPrincipals.isEmpty()) {
throw new WSSecurityException(
- WSSecurityException.FAILURE,
+ WSSecurityException.ErrorCode.FAILURE,
"kerberosLoginError",
new Object[] {"No Client principals found after login"}
);
@@ -164,7 +164,7 @@ public class KerberosSecurity extends Bi
byte[] ticket = (byte[])Subject.doAs(clientSubject, action);
if (ticket == null) {
throw new WSSecurityException(
- WSSecurityException.FAILURE, "kerberosServiceTicketError"
+ WSSecurityException.ErrorCode.FAILURE, "kerberosServiceTicketError"
);
}
if (log.isDebugEnabled()) {
Modified: webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/token/PKIPathSecurity.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/token/PKIPathSecurity.java?rev=1374326&r1=1374325&r2=1374326&view=diff
==============================================================================
--- webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/token/PKIPathSecurity.java (original)
+++ webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/token/PKIPathSecurity.java Fri Aug 17 15:40:59 2012
@@ -20,8 +20,8 @@
package org.apache.ws.security.message.token;
import org.apache.ws.security.WSConstants;
-import org.apache.ws.security.WSSecurityException;
-import org.apache.ws.security.components.crypto.Crypto;
+import org.apache.ws.security.common.crypto.Crypto;
+import org.apache.ws.security.common.ext.WSSecurityException;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -56,7 +56,7 @@ public class PKIPathSecurity extends Bin
super(elem, bspCompliant);
if (bspCompliant && !PKI_TYPE.equals(getValueType())) {
throw new WSSecurityException(
- WSSecurityException.INVALID_SECURITY_TOKEN,
+ WSSecurityException.ErrorCode.INVALID_SECURITY_TOKEN,
"invalidValueType",
new Object[]{PKI_TYPE, getValueType()}
);
@@ -85,7 +85,7 @@ public class PKIPathSecurity extends Bin
return null;
}
if (crypto == null) {
- throw new WSSecurityException(WSSecurityException.FAILURE, "noSigCryptoFile");
+ throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "noSigCryptoFile");
}
return crypto.getCertificatesFromBytes(data);
}
@@ -102,7 +102,7 @@ public class PKIPathSecurity extends Bin
Crypto crypto
) throws WSSecurityException {
if (certs == null) {
- throw new WSSecurityException(WSSecurityException.FAILURE, "noCert");
+ throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "noCert");
}
byte[] data = crypto.getBytesFromCertificates(certs);
setToken(data);
Modified: webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/token/Reference.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/token/Reference.java?rev=1374326&r1=1374325&r2=1374326&view=diff
==============================================================================
--- webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/token/Reference.java (original)
+++ webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/token/Reference.java Fri Aug 17 15:40:59 2012
@@ -22,7 +22,7 @@ package org.apache.ws.security.message.t
import javax.xml.namespace.QName;
import org.apache.ws.security.WSConstants;
-import org.apache.ws.security.WSSecurityException;
+import org.apache.ws.security.common.ext.WSSecurityException;
import org.apache.ws.security.util.DOM2Writer;
import org.apache.ws.security.util.WSSecurityUtil;
import org.w3c.dom.Document;
@@ -46,13 +46,13 @@ public class Reference {
*/
public Reference(Element elem) throws WSSecurityException {
if (elem == null) {
- throw new WSSecurityException(WSSecurityException.INVALID_SECURITY, "noReference");
+ throw new WSSecurityException(WSSecurityException.ErrorCode.INVALID_SECURITY, "noReference");
}
element = elem;
QName el = new QName(element.getNamespaceURI(), element.getLocalName());
if (!el.equals(TOKEN)) {
throw new WSSecurityException(
- WSSecurityException.FAILURE, "badElement", new Object[] {TOKEN, el}
+ WSSecurityException.ErrorCode.FAILURE, "badElement", new Object[] {TOKEN, el}
);
}
@@ -60,7 +60,7 @@ public class Reference {
// Reference URI cannot be null or empty
if (uri == null || "".equals(uri)) {
throw new WSSecurityException(
- WSSecurityException.INVALID_SECURITY, "badReferenceURI"
+ WSSecurityException.ErrorCode.INVALID_SECURITY, "badReferenceURI"
);
}
}
Modified: webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/token/SecurityContextToken.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/token/SecurityContextToken.java?rev=1374326&r1=1374325&r2=1374326&view=diff
==============================================================================
--- webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/token/SecurityContextToken.java (original)
+++ webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/token/SecurityContextToken.java Fri Aug 17 15:40:59 2012
@@ -21,7 +21,7 @@ package org.apache.ws.security.message.t
import org.apache.ws.security.WSConstants;
import org.apache.ws.security.WSSConfig;
-import org.apache.ws.security.WSSecurityException;
+import org.apache.ws.security.common.ext.WSSecurityException;
import org.apache.ws.security.conversation.ConversationConstants;
import org.apache.ws.security.conversation.ConversationException;
import org.apache.ws.security.util.DOM2Writer;
@@ -143,7 +143,7 @@ public class SecurityContextToken {
} else if (el.equals(ConversationConstants.SECURITY_CTX_TOKEN_QNAME_05_12)) {
tokenType = WSConstants.WSC_SCT_05_12;
} else {
- throw new WSSecurityException(WSSecurityException.INVALID_SECURITY_TOKEN);
+ throw new WSSecurityException(WSSecurityException.ErrorCode.INVALID_SECURITY_TOKEN);
}
elementIdentifier =
Modified: webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/token/SecurityTokenReference.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/token/SecurityTokenReference.java?rev=1374326&r1=1374325&r2=1374326&view=diff
==============================================================================
--- webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/token/SecurityTokenReference.java (original)
+++ webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/token/SecurityTokenReference.java Fri Aug 17 15:40:59 2012
@@ -21,11 +21,11 @@ package org.apache.ws.security.message.t
import org.apache.ws.security.WSConstants;
import org.apache.ws.security.WSDocInfo;
-import org.apache.ws.security.WSPasswordCallback;
-import org.apache.ws.security.WSSecurityException;
-import org.apache.ws.security.components.crypto.Crypto;
-import org.apache.ws.security.components.crypto.CryptoType;
-import org.apache.ws.security.components.crypto.Merlin;
+import org.apache.ws.security.common.crypto.Crypto;
+import org.apache.ws.security.common.crypto.CryptoType;
+import org.apache.ws.security.common.crypto.Merlin;
+import org.apache.ws.security.common.ext.WSPasswordCallback;
+import org.apache.ws.security.common.ext.WSSecurityException;
import org.apache.ws.security.message.CallbackLookup;
import org.apache.ws.security.message.DOMCallbackLookup;
import org.apache.ws.security.util.DOM2Writer;
@@ -90,7 +90,7 @@ public class SecurityTokenReference {
element = elem;
QName el = new QName(element.getNamespaceURI(), element.getLocalName());
if (!STR_QNAME.equals(el)) {
- throw new WSSecurityException(WSSecurityException.FAILURE, "badElement", null);
+ throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "badElement");
}
if (bspCompliant) {
checkBSPCompliance();
@@ -221,7 +221,7 @@ public class SecurityTokenReference {
if (uri == null) {
throw new WSSecurityException(
- WSSecurityException.INVALID_SECURITY, "badReferenceURI"
+ WSSecurityException.ErrorCode.INVALID_SECURITY, "badReferenceURI"
);
}
@@ -233,7 +233,7 @@ public class SecurityTokenReference {
if (tokElement == null) {
throw new WSSecurityException(
- WSSecurityException.SECURITY_TOKEN_UNAVAILABLE,
+ WSSecurityException.ErrorCode.SECURITY_TOKEN_UNAVAILABLE,
"noToken",
new Object[]{uri}
);
@@ -318,7 +318,7 @@ public class SecurityTokenReference {
|| KerberosSecurity.isKerberosToken(type))) {
//try to find a custom token
WSPasswordCallback pwcb =
- new WSPasswordCallback(id, WSPasswordCallback.CUSTOM_TOKEN);
+ new WSPasswordCallback(id, WSPasswordCallback.Usage.CUSTOM_TOKEN);
try {
cb.handle(new Callback[]{pwcb});
Element assertionElem = pwcb.getCustomToken();
@@ -350,7 +350,7 @@ public class SecurityTokenReference {
data = cert.getEncoded();
} catch (CertificateEncodingException e) {
throw new WSSecurityException(
- WSSecurityException.SECURITY_TOKEN_UNAVAILABLE, "encodeError", null, e
+ WSSecurityException.ErrorCode.SECURITY_TOKEN_UNAVAILABLE, "encodeError", null, e
);
}
Text text = doc.createTextNode(Base64.encode(data));
@@ -374,7 +374,7 @@ public class SecurityTokenReference {
//
if (cert.getVersion() != 3) {
throw new WSSecurityException(
- WSSecurityException.UNSUPPORTED_SECURITY_TOKEN,
+ WSSecurityException.ErrorCode.UNSUPPORTED_SECURITY_TOKEN,
"invalidCertForSKI",
new Object[]{Integer.valueOf(cert.getVersion())}
);
@@ -409,7 +409,7 @@ public class SecurityTokenReference {
encodedCert = cert.getEncoded();
} catch (CertificateEncodingException e1) {
throw new WSSecurityException(
- WSSecurityException.SECURITY_TOKEN_UNAVAILABLE, "encodeError", null, e1
+ WSSecurityException.ErrorCode.SECURITY_TOKEN_UNAVAILABLE, "encodeError", null, e1
);
}
try {
@@ -418,7 +418,7 @@ public class SecurityTokenReference {
createKeyIdentifier(doc, THUMB_URI, text, true);
} catch (WSSecurityException e1) {
throw new WSSecurityException(
- WSSecurityException.FAILURE, "noSHA1availabe", null, e1
+ WSSecurityException.ErrorCode.FAILURE, "noSHA1availabe", null, e1
);
}
}
@@ -802,7 +802,7 @@ public class SecurityTokenReference {
}
if (result != 1) {
throw new WSSecurityException(
- WSSecurityException.INVALID_SECURITY, "invalidDataRef"
+ WSSecurityException.ErrorCode.INVALID_SECURITY, "invalidDataRef"
);
}
if ("KeyIdentifier".equals(child.getLocalName())
@@ -812,7 +812,7 @@ public class SecurityTokenReference {
// ValueType cannot be null
if (valueType == null || "".equals(valueType)) {
throw new WSSecurityException(
- WSSecurityException.INVALID_SECURITY, "invalidValueType"
+ WSSecurityException.ErrorCode.INVALID_SECURITY, "invalidValueType"
);
}
String encodingType = getFirstElement().getAttribute("EncodingType");
@@ -820,7 +820,7 @@ public class SecurityTokenReference {
if (encodingType != null && !"".equals(encodingType)
&& !BinarySecurity.BASE64_ENCODING.equals(encodingType)) {
throw new WSSecurityException(
- WSSecurityException.INVALID_SECURITY,
+ WSSecurityException.ErrorCode.INVALID_SECURITY,
"badEncodingType",
new Object[] {encodingType}
);
@@ -830,7 +830,7 @@ public class SecurityTokenReference {
&& !WSConstants.WSS_SAML2_KI_VALUE_TYPE.equals(valueType)
&& (encodingType == null || "".equals(encodingType))) {
throw new WSSecurityException(
- WSSecurityException.INVALID_SECURITY, "noEncodingType"
+ WSSecurityException.ErrorCode.INVALID_SECURITY, "noEncodingType"
);
}
} else if ("Embedded".equals(child.getLocalName())) {
@@ -843,7 +843,7 @@ public class SecurityTokenReference {
if ("SecurityTokenReference".equals(node.getLocalName())
&& WSConstants.WSSE_NS.equals(node.getNamespaceURI())) {
throw new WSSecurityException(
- WSSecurityException.INVALID_SECURITY, "invalidEmbeddedRef"
+ WSSecurityException.ErrorCode.INVALID_SECURITY, "invalidEmbeddedRef"
);
}
}
@@ -852,7 +852,7 @@ public class SecurityTokenReference {
// We can only have one embedded child
if (result != 1) {
throw new WSSecurityException(
- WSSecurityException.INVALID_SECURITY, "invalidEmbeddedRef"
+ WSSecurityException.ErrorCode.INVALID_SECURITY, "invalidEmbeddedRef"
);
}
}
Modified: webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/token/SignatureConfirmation.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/token/SignatureConfirmation.java?rev=1374326&r1=1374325&r2=1374326&view=diff
==============================================================================
--- webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/token/SignatureConfirmation.java (original)
+++ webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/token/SignatureConfirmation.java Fri Aug 17 15:40:59 2012
@@ -22,7 +22,7 @@ package org.apache.ws.security.message.t
import java.util.Arrays;
import org.apache.ws.security.WSConstants;
-import org.apache.ws.security.WSSecurityException;
+import org.apache.ws.security.common.ext.WSSecurityException;
import org.apache.ws.security.util.DOM2Writer;
import org.apache.ws.security.util.WSSecurityUtil;
import org.apache.ws.security.util.Base64;
Modified: webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/token/Timestamp.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/token/Timestamp.java?rev=1374326&r1=1374325&r2=1374326&view=diff
==============================================================================
--- webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/token/Timestamp.java (original)
+++ webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/token/Timestamp.java Fri Aug 17 15:40:59 2012
@@ -20,7 +20,7 @@
package org.apache.ws.security.message.token;
import org.apache.ws.security.WSConstants;
-import org.apache.ws.security.WSSecurityException;
+import org.apache.ws.security.common.ext.WSSecurityException;
import org.apache.ws.security.util.DOM2Writer;
import org.apache.ws.security.util.WSSecurityUtil;
import org.apache.ws.security.util.XmlSchemaDateFormat;
@@ -93,14 +93,14 @@ public class Timestamp {
if (bspCompliant && valueType != null && !"".equals(valueType)) {
// We can't have a ValueType attribute as per the BSP spec
throw new WSSecurityException(
- WSSecurityException.INVALID_SECURITY, "invalidTimestamp"
+ WSSecurityException.ErrorCode.INVALID_SECURITY, "invalidTimestamp"
);
}
strCreated = ((Text)currentChildElement.getFirstChild()).getData();
} else {
// Test for multiple Created elements
throw new WSSecurityException(
- WSSecurityException.INVALID_SECURITY, "invalidTimestamp"
+ WSSecurityException.ErrorCode.INVALID_SECURITY, "invalidTimestamp"
);
}
} else if (WSConstants.EXPIRES_LN.equals(currentChild.getLocalName()) &&
@@ -111,14 +111,14 @@ public class Timestamp {
// elements
//
throw new WSSecurityException(
- WSSecurityException.INVALID_SECURITY, "invalidTimestamp"
+ WSSecurityException.ErrorCode.INVALID_SECURITY, "invalidTimestamp"
);
} else {
String valueType = currentChildElement.getAttribute("ValueType");
if (bspCompliant && valueType != null && !"".equals(valueType)) {
// We can't have a ValueType attribute as per the BSP spec
throw new WSSecurityException(
- WSSecurityException.INVALID_SECURITY, "invalidTimestamp"
+ WSSecurityException.ErrorCode.INVALID_SECURITY, "invalidTimestamp"
);
}
strExpires = ((Text)currentChildElement.getFirstChild()).getData();
@@ -126,7 +126,7 @@ public class Timestamp {
} else {
if (bspCompliant) {
throw new WSSecurityException(
- WSSecurityException.INVALID_SECURITY, "invalidTimestamp"
+ WSSecurityException.ErrorCode.INVALID_SECURITY, "invalidTimestamp"
);
}
customElements.add(currentChildElement);
@@ -137,7 +137,7 @@ public class Timestamp {
// We must have a Created element
if (bspCompliant && strCreated == null) {
throw new WSSecurityException(
- WSSecurityException.INVALID_SECURITY, "invalidTimestamp"
+ WSSecurityException.ErrorCode.INVALID_SECURITY, "invalidTimestamp"
);
}
@@ -164,7 +164,7 @@ public class Timestamp {
}
} catch (ParseException e) {
throw new WSSecurityException(
- WSSecurityException.INVALID_SECURITY, "invalidTimestamp", null, e
+ WSSecurityException.ErrorCode.INVALID_SECURITY, "invalidTimestamp", null, e
);
}
}
Modified: webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/token/UsernameToken.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/token/UsernameToken.java?rev=1374326&r1=1374325&r2=1374326&view=diff
==============================================================================
--- webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/token/UsernameToken.java (original)
+++ webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/token/UsernameToken.java Fri Aug 17 15:40:59 2012
@@ -20,9 +20,9 @@
package org.apache.ws.security.message.token;
import org.apache.ws.security.WSConstants;
-import org.apache.ws.security.WSPasswordCallback;
-import org.apache.ws.security.WSSecurityException;
import org.apache.ws.security.WSUsernameTokenPrincipal;
+import org.apache.ws.security.common.ext.WSPasswordCallback;
+import org.apache.ws.security.common.ext.WSSecurityException;
import org.apache.ws.security.handler.RequestData;
import org.apache.ws.security.util.DOM2Writer;
import org.apache.ws.security.util.WSSecurityUtil;
@@ -115,7 +115,7 @@ public class UsernameToken {
QName el = new QName(element.getNamespaceURI(), element.getLocalName());
if (!el.equals(TOKEN)) {
throw new WSSecurityException(
- WSSecurityException.INVALID_SECURITY_TOKEN,
+ WSSecurityException.ErrorCode.INVALID_SECURITY_TOKEN,
"badUsernameToken"
);
}
@@ -145,7 +145,7 @@ public class UsernameToken {
);
if (elementUsername == null) {
throw new WSSecurityException(
- WSSecurityException.INVALID_SECURITY_TOKEN,
+ WSSecurityException.ErrorCode.INVALID_SECURITY_TOKEN,
"badUsernameToken"
);
}
@@ -163,7 +163,7 @@ public class UsernameToken {
//
if (elementPassword != null || elementIteration == null) {
throw new WSSecurityException(
- WSSecurityException.INVALID_SECURITY_TOKEN,
+ WSSecurityException.ErrorCode.INVALID_SECURITY_TOKEN,
"badUsernameToken"
);
}
@@ -177,7 +177,7 @@ public class UsernameToken {
int iterInt = Integer.parseInt(iter);
if (iterInt < 0 || iterInt > 10000) {
throw new WSSecurityException(
- WSSecurityException.INVALID_SECURITY_TOKEN,
+ WSSecurityException.ErrorCode.INVALID_SECURITY_TOKEN,
"badUsernameToken"
);
}
@@ -197,7 +197,7 @@ public class UsernameToken {
);
} else {
throw new WSSecurityException(
- WSSecurityException.INVALID_SECURITY_TOKEN,
+ WSSecurityException.ErrorCode.INVALID_SECURITY_TOKEN,
"badUsernameToken"
);
}
@@ -208,7 +208,7 @@ public class UsernameToken {
hashed = true;
if (elementNonce == null || elementCreated == null) {
throw new WSSecurityException(
- WSSecurityException.INVALID_SECURITY_TOKEN,
+ WSSecurityException.ErrorCode.INVALID_SECURITY_TOKEN,
"badUsernameToken"
);
}
@@ -509,12 +509,12 @@ public class UsernameToken {
WSPasswordCallback pwCb =
new WSPasswordCallback(
getName(), getPassword(), getPasswordType(),
- WSPasswordCallback.USERNAME_TOKEN, data
+ WSPasswordCallback.Usage.USERNAME_TOKEN
);
if (data.getCallbackHandler() == null) {
LOG.debug("CallbackHandler is null");
- throw new WSSecurityException(WSSecurityException.FAILED_AUTHENTICATION);
+ throw new WSSecurityException(WSSecurityException.ErrorCode.FAILED_AUTHENTICATION);
}
try {
data.getCallbackHandler().handle(new Callback[]{pwCb});
@@ -523,14 +523,14 @@ public class UsernameToken {
LOG.debug(e);
}
throw new WSSecurityException(
- WSSecurityException.FAILED_AUTHENTICATION, null, null, e
+ WSSecurityException.ErrorCode.FAILED_AUTHENTICATION, null, null, e
);
} catch (UnsupportedCallbackException e) {
if (LOG.isDebugEnabled()) {
LOG.debug(e);
}
throw new WSSecurityException(
- WSSecurityException.FAILED_AUTHENTICATION, null, null, e
+ WSSecurityException.ErrorCode.FAILED_AUTHENTICATION, null, null, e
);
}
rawPassword = pwCb.getPassword();
@@ -774,7 +774,7 @@ public class UsernameToken {
LOG.debug(e.getMessage(), e);
}
throw new WSSecurityException(
- WSSecurityException.FAILURE, "noSHA1availabe", null, e
+ WSSecurityException.ErrorCode.FAILURE, "noSHA1availabe", null, e
);
}
//
@@ -826,7 +826,7 @@ public class UsernameToken {
public byte[] getDerivedKey() throws WSSecurityException {
if (rawPassword == null || !bspCompliantDerivedKey) {
LOG.debug("The raw password was null or the Username Token is not BSP compliant");
- throw new WSSecurityException(WSSecurityException.FAILED_AUTHENTICATION);
+ throw new WSSecurityException(WSSecurityException.ErrorCode.FAILED_AUTHENTICATION);
}
int iteration = getIteration();
byte[] salt = getSalt();
@@ -1036,7 +1036,7 @@ public class UsernameToken {
LOG.debug("The Username Token had more than one password element");
}
throw new WSSecurityException(
- WSSecurityException.INVALID_SECURITY_TOKEN, "badUsernameToken"
+ WSSecurityException.ErrorCode.INVALID_SECURITY_TOKEN, "badUsernameToken"
);
}
@@ -1049,7 +1049,7 @@ public class UsernameToken {
LOG.debug("The Username Token password does not have a Type attribute");
}
throw new WSSecurityException(
- WSSecurityException.INVALID_SECURITY_TOKEN, "badUsernameToken"
+ WSSecurityException.ErrorCode.INVALID_SECURITY_TOKEN, "badUsernameToken"
);
}
}
@@ -1078,7 +1078,7 @@ public class UsernameToken {
LOG.debug("The Username Token has more than one created element");
}
throw new WSSecurityException(
- WSSecurityException.INVALID_SECURITY_TOKEN, "badUsernameToken"
+ WSSecurityException.ErrorCode.INVALID_SECURITY_TOKEN, "badUsernameToken"
);
}
@@ -1092,7 +1092,7 @@ public class UsernameToken {
LOG.debug("The Username Token has more than one nonce element");
}
throw new WSSecurityException(
- WSSecurityException.INVALID_SECURITY_TOKEN, "badUsernameToken"
+ WSSecurityException.ErrorCode.INVALID_SECURITY_TOKEN, "badUsernameToken"
);
}
@@ -1106,7 +1106,7 @@ public class UsernameToken {
LOG.debug("The Username Token's nonce element has a bad encoding type");
}
throw new WSSecurityException(
- WSSecurityException.INVALID_SECURITY_TOKEN,
+ WSSecurityException.ErrorCode.INVALID_SECURITY_TOKEN,
"badUsernameToken"
);
}
Modified: webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/token/X509Security.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/token/X509Security.java?rev=1374326&r1=1374325&r2=1374326&view=diff
==============================================================================
--- webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/token/X509Security.java (original)
+++ webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/message/token/X509Security.java Fri Aug 17 15:40:59 2012
@@ -20,8 +20,8 @@
package org.apache.ws.security.message.token;
import org.apache.ws.security.WSConstants;
-import org.apache.ws.security.WSSecurityException;
-import org.apache.ws.security.components.crypto.Crypto;
+import org.apache.ws.security.common.crypto.Crypto;
+import org.apache.ws.security.common.ext.WSSecurityException;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -69,7 +69,7 @@ public class X509Security extends Binary
String valueType = getValueType();
if (bspCompliant && !X509_V3_TYPE.equals(valueType)) {
throw new WSSecurityException(
- WSSecurityException.INVALID_SECURITY_TOKEN,
+ WSSecurityException.ErrorCode.INVALID_SECURITY_TOKEN,
"invalidValueType",
new Object[]{valueType}
);
@@ -97,12 +97,12 @@ public class X509Security extends Binary
return cachedCert;
}
if (crypto == null) {
- throw new WSSecurityException(WSSecurityException.FAILURE, "noSigCryptoFile");
+ throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "noSigCryptoFile");
}
byte[] data = getToken();
if (data == null) {
throw new WSSecurityException(
- WSSecurityException.FAILURE, "invalidCertData", new Object[]{Integer.valueOf(0)}
+ WSSecurityException.ErrorCode.FAILURE, "invalidCertData", new Object[]{Integer.valueOf(0)}
);
}
InputStream in = new ByteArrayInputStream(data);
@@ -121,14 +121,14 @@ public class X509Security extends Binary
*/
public void setX509Certificate(X509Certificate cert) throws WSSecurityException {
if (cert == null) {
- throw new WSSecurityException(WSSecurityException.FAILURE, "noCert");
+ throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "noCert");
}
cachedCert = cert;
try {
setToken(cert.getEncoded());
} catch (CertificateEncodingException e) {
throw new WSSecurityException(
- WSSecurityException.SECURITY_TOKEN_UNAVAILABLE, "encodeError", null, e
+ WSSecurityException.ErrorCode.SECURITY_TOKEN_UNAVAILABLE, "encodeError", null, e
);
}
}
Modified: webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/processor/BinarySecurityTokenProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/processor/BinarySecurityTokenProcessor.java?rev=1374326&r1=1374325&r2=1374326&view=diff
==============================================================================
--- webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/processor/BinarySecurityTokenProcessor.java (original)
+++ webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/processor/BinarySecurityTokenProcessor.java Fri Aug 17 15:40:59 2012
@@ -24,8 +24,8 @@ import org.apache.ws.security.WSConstant
import org.apache.ws.security.WSDocInfo;
import org.apache.ws.security.WSSConfig;
import org.apache.ws.security.WSSecurityEngineResult;
-import org.apache.ws.security.WSSecurityException;
-import org.apache.ws.security.components.crypto.Crypto;
+import org.apache.ws.security.common.crypto.Crypto;
+import org.apache.ws.security.common.ext.WSSecurityException;
import org.apache.ws.security.handler.RequestData;
import org.apache.ws.security.message.token.BinarySecurity;
import org.apache.ws.security.message.token.KerberosSecurity;
@@ -61,7 +61,7 @@ public class BinarySecurityTokenProcesso
return java.util.Collections.singletonList(result);
} else if (foundElement != null) {
throw new WSSecurityException(
- WSSecurityException.INVALID_SECURITY_TOKEN, "duplicateError"
+ WSSecurityException.ErrorCode.INVALID_SECURITY_TOKEN, "duplicateError"
);
}
}
Modified: webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/processor/DerivedKeyTokenProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/processor/DerivedKeyTokenProcessor.java?rev=1374326&r1=1374325&r2=1374326&view=diff
==============================================================================
--- webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/processor/DerivedKeyTokenProcessor.java (original)
+++ webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/processor/DerivedKeyTokenProcessor.java Fri Aug 17 15:40:59 2012
@@ -22,7 +22,7 @@ package org.apache.ws.security.processor
import org.apache.ws.security.WSConstants;
import org.apache.ws.security.WSDocInfo;
import org.apache.ws.security.WSSecurityEngineResult;
-import org.apache.ws.security.WSSecurityException;
+import org.apache.ws.security.common.ext.WSSecurityException;
import org.apache.ws.security.handler.RequestData;
import org.apache.ws.security.message.token.DerivedKeyToken;
import org.apache.ws.security.str.DerivedKeyTokenSTRParser;
@@ -55,7 +55,7 @@ public class DerivedKeyTokenProcessor im
);
secret = strParser.getSecretKey();
} else {
- throw new WSSecurityException(WSSecurityException.FAILED_CHECK, "noReference");
+ throw new WSSecurityException(WSSecurityException.ErrorCode.FAILED_CHECK, "noReference");
}
String tempNonce = dkt.getNonce();
Modified: webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/processor/EncryptedDataProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/processor/EncryptedDataProcessor.java?rev=1374326&r1=1374325&r2=1374326&view=diff
==============================================================================
--- webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/processor/EncryptedDataProcessor.java (original)
+++ webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/processor/EncryptedDataProcessor.java Fri Aug 17 15:40:59 2012
@@ -24,7 +24,7 @@ import org.apache.ws.security.WSDataRef;
import org.apache.ws.security.WSDocInfo;
import org.apache.ws.security.WSSConfig;
import org.apache.ws.security.WSSecurityEngineResult;
-import org.apache.ws.security.WSSecurityException;
+import org.apache.ws.security.common.ext.WSSecurityException;
import org.apache.ws.security.handler.RequestData;
import org.apache.ws.security.str.STRParser;
import org.apache.ws.security.str.SecurityTokenRefSTRParser;
@@ -66,7 +66,7 @@ public class EncryptedDataProcessor impl
// KeyInfo cannot be null
if (kiElem == null) {
throw new WSSecurityException(
- WSSecurityException.UNSUPPORTED_ALGORITHM, "noKeyinfo"
+ WSSecurityException.ErrorCode.UNSUPPORTED_ALGORITHM, "noKeyinfo"
);
}
@@ -110,7 +110,7 @@ public class EncryptedDataProcessor impl
key = WSSecurityUtil.prepareSecretKey(symEncAlgo, symmKey);
} else {
throw new WSSecurityException(
- WSSecurityException.UNSUPPORTED_ALGORITHM, "noEncKey"
+ WSSecurityException.ErrorCode.UNSUPPORTED_ALGORITHM, "noEncKey"
);
}
@@ -122,7 +122,7 @@ public class EncryptedDataProcessor impl
xmlCipher.init(XMLCipher.DECRYPT_MODE, key);
} catch (XMLEncryptionException ex) {
throw new WSSecurityException(
- WSSecurityException.UNSUPPORTED_ALGORITHM, null, null, ex
+ WSSecurityException.ErrorCode.UNSUPPORTED_ALGORITHM, null, null, ex
);
}
Node previousSibling = elem.getPreviousSibling();
@@ -131,7 +131,7 @@ public class EncryptedDataProcessor impl
xmlCipher.doFinal(elem.getOwnerDocument(), elem, false);
} catch (Exception e) {
throw new WSSecurityException(
- WSSecurityException.FAILED_CHECK, null, null, e
+ WSSecurityException.ErrorCode.FAILED_CHECK, null, null, e
);
}
@@ -199,7 +199,7 @@ public class EncryptedDataProcessor impl
// EncryptionAlgorithm cannot be null
if (encAlgo == null) {
throw new WSSecurityException(
- WSSecurityException.UNSUPPORTED_ALGORITHM, "noEncAlgo"
+ WSSecurityException.ErrorCode.UNSUPPORTED_ALGORITHM, "noEncAlgo"
);
}
// EncryptionAlgorithm must be 3DES, or AES128, or AES256
@@ -209,7 +209,7 @@ public class EncryptedDataProcessor impl
&& !WSConstants.AES_256.equals(encAlgo)
&& !WSConstants.AES_256_GCM.equals(encAlgo)) {
throw new WSSecurityException(
- WSSecurityException.INVALID_SECURITY, "badEncAlgo", new Object[]{encAlgo}
+ WSSecurityException.ErrorCode.INVALID_SECURITY, "badEncAlgo", new Object[]{encAlgo}
);
}
}
Modified: webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/processor/EncryptedKeyProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/processor/EncryptedKeyProcessor.java?rev=1374326&r1=1374325&r2=1374326&view=diff
==============================================================================
--- webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/processor/EncryptedKeyProcessor.java (original)
+++ webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/processor/EncryptedKeyProcessor.java Fri Aug 17 15:40:59 2012
@@ -23,9 +23,9 @@ import org.apache.ws.security.WSConstant
import org.apache.ws.security.WSDataRef;
import org.apache.ws.security.WSDocInfo;
import org.apache.ws.security.WSSecurityEngineResult;
-import org.apache.ws.security.WSSecurityException;
-import org.apache.ws.security.components.crypto.Crypto;
-import org.apache.ws.security.components.crypto.CryptoType;
+import org.apache.ws.security.common.crypto.Crypto;
+import org.apache.ws.security.common.crypto.CryptoType;
+import org.apache.ws.security.common.ext.WSSecurityException;
import org.apache.ws.security.handler.RequestData;
import org.apache.ws.security.message.token.SecurityTokenReference;
import org.apache.ws.security.str.EncryptedKeySTRParser;
@@ -64,10 +64,10 @@ public class EncryptedKeyProcessor imple
log.debug("Found encrypted key element");
}
if (data.getDecCrypto() == null) {
- throw new WSSecurityException(WSSecurityException.FAILURE, "noDecCryptoFile");
+ throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "noDecCryptoFile");
}
if (data.getCallbackHandler() == null) {
- throw new WSSecurityException(WSSecurityException.FAILURE, "noCallback");
+ throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "noCallback");
}
//
// lookup xenc:EncryptionMethod, get the Algorithm attribute to determine
@@ -76,7 +76,7 @@ public class EncryptedKeyProcessor imple
String encryptedKeyTransportMethod = X509Util.getEncAlgo(elem);
if (encryptedKeyTransportMethod == null) {
throw new WSSecurityException(
- WSSecurityException.UNSUPPORTED_ALGORITHM, "noEncAlgo"
+ WSSecurityException.ErrorCode.UNSUPPORTED_ALGORITHM, "noEncAlgo"
);
}
if (data.getWssConfig().isWsiBSPCompliant()) {
@@ -96,7 +96,7 @@ public class EncryptedKeyProcessor imple
WSSecurityUtil.getDirectChildElement(tmpE, "CipherValue", WSConstants.ENC_NS);
}
if (xencCipherValue == null) {
- throw new WSSecurityException(WSSecurityException.INVALID_SECURITY, "noCipher");
+ throw new WSSecurityException(WSSecurityException.ErrorCode.INVALID_SECURITY, "noCipher");
}
STRParser strParser = new EncryptedKeySTRParser();
@@ -125,7 +125,7 @@ public class EncryptedKeyProcessor imple
cipher.init(Cipher.DECRYPT_MODE, privateKey, oaepParameterSpec);
}
} catch (Exception ex) {
- throw new WSSecurityException(WSSecurityException.FAILED_CHECK, null, null, ex);
+ throw new WSSecurityException(WSSecurityException.ErrorCode.FAILED_CHECK, null, null, ex);
}
List<String> dataRefURIs = getDataRefURIs(elem);
@@ -136,7 +136,7 @@ public class EncryptedKeyProcessor imple
encryptedEphemeralKey = getDecodedBase64EncodedData(xencCipherValue);
decryptedBytes = cipher.doFinal(encryptedEphemeralKey);
} catch (IllegalStateException ex) {
- throw new WSSecurityException(WSSecurityException.FAILED_CHECK, null, null, ex);
+ throw new WSSecurityException(WSSecurityException.ErrorCode.FAILED_CHECK, null, null, ex);
} catch (Exception ex) {
decryptedBytes = getRandomKey(dataRefURIs, elem.getOwnerDocument(), wsDocInfo);
}
@@ -188,7 +188,7 @@ public class EncryptedKeyProcessor imple
SecretKey k = kgen.generateKey();
return k.getEncoded();
} catch (Exception ex) {
- throw new WSSecurityException(WSSecurityException.FAILED_CHECK, null, null, ex);
+ throw new WSSecurityException(WSSecurityException.ErrorCode.FAILED_CHECK, null, null, ex);
}
}
@@ -256,7 +256,7 @@ public class EncryptedKeyProcessor imple
}
if (result != 1) {
throw new WSSecurityException(
- WSSecurityException.INVALID_SECURITY, "invalidDataRef"
+ WSSecurityException.ErrorCode.INVALID_SECURITY, "invalidDataRef"
);
}
} else {
@@ -269,7 +269,7 @@ public class EncryptedKeyProcessor imple
}
if (strElement == null || strParser == null) {
throw new WSSecurityException(
- WSSecurityException.INVALID_SECURITY, "noSecTokRef"
+ WSSecurityException.ErrorCode.INVALID_SECURITY, "noSecTokRef"
);
}
strParser.parseSecurityTokenReference(strElement, data, wsDocInfo, null);
@@ -277,7 +277,7 @@ public class EncryptedKeyProcessor imple
X509Certificate[] certs = strParser.getCertificates();
if (certs == null || certs.length < 1 || certs[0] == null) {
throw new WSSecurityException(
- WSSecurityException.FAILURE,
+ WSSecurityException.ErrorCode.FAILURE,
"noCertsFound",
new Object[] {"decryption (KeyId)"}
);
@@ -291,14 +291,14 @@ public class EncryptedKeyProcessor imple
X509Certificate[] certs = crypto.getX509Certificates(cryptoType);
if (certs == null || certs.length < 1 || certs[0] == null) {
throw new WSSecurityException(
- WSSecurityException.FAILURE,
+ WSSecurityException.ErrorCode.FAILURE,
"noCertsFound",
new Object[] {"decryption (KeyId)"}
);
}
return certs;
} else {
- throw new WSSecurityException(WSSecurityException.INVALID_SECURITY, "noKeyinfo");
+ throw new WSSecurityException(WSSecurityException.ErrorCode.INVALID_SECURITY, "noKeyinfo");
}
}
@@ -379,7 +379,7 @@ public class EncryptedKeyProcessor imple
symmetricKey = WSSecurityUtil.prepareSecretKey(symEncAlgo, decryptedData);
} catch (IllegalArgumentException ex) {
throw new WSSecurityException(
- WSSecurityException.UNSUPPORTED_ALGORITHM, "badEncAlgo",
+ WSSecurityException.ErrorCode.UNSUPPORTED_ALGORITHM, "badEncAlgo",
new Object[]{symEncAlgo}, ex
);
}
@@ -397,25 +397,25 @@ public class EncryptedKeyProcessor imple
String attribute = elem.getAttribute("Type");
if (attribute != null && !"".equals(attribute)) {
throw new WSSecurityException(
- WSSecurityException.FAILED_CHECK, "badAttribute", new Object[]{attribute}
+ WSSecurityException.ErrorCode.FAILED_CHECK, "badAttribute", new Object[]{attribute}
);
}
attribute = elem.getAttribute("MimeType");
if (attribute != null && !"".equals(attribute)) {
throw new WSSecurityException(
- WSSecurityException.FAILED_CHECK, "badAttribute", new Object[]{attribute}
+ WSSecurityException.ErrorCode.FAILED_CHECK, "badAttribute", new Object[]{attribute}
);
}
attribute = elem.getAttribute("Encoding");
if (attribute != null && !"".equals(attribute)) {
throw new WSSecurityException(
- WSSecurityException.FAILED_CHECK, "badAttribute", new Object[]{attribute}
+ WSSecurityException.ErrorCode.FAILED_CHECK, "badAttribute", new Object[]{attribute}
);
}
attribute = elem.getAttribute("Recipient");
if (attribute != null && !"".equals(attribute)) {
throw new WSSecurityException(
- WSSecurityException.FAILED_CHECK, "badAttribute", new Object[]{attribute}
+ WSSecurityException.ErrorCode.FAILED_CHECK, "badAttribute", new Object[]{attribute}
);
}
@@ -423,7 +423,7 @@ public class EncryptedKeyProcessor imple
if (!WSConstants.KEYTRANSPORT_RSA15.equals(encAlgo)
&& !WSConstants.KEYTRANSPORT_RSAOEP.equals(encAlgo)) {
throw new WSSecurityException(
- WSSecurityException.INVALID_SECURITY, "badEncAlgo", new Object[]{encAlgo}
+ WSSecurityException.ErrorCode.INVALID_SECURITY, "badEncAlgo", new Object[]{encAlgo}
);
}
}
Modified: webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/processor/Processor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/processor/Processor.java?rev=1374326&r1=1374325&r2=1374326&view=diff
==============================================================================
--- webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/processor/Processor.java (original)
+++ webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/processor/Processor.java Fri Aug 17 15:40:59 2012
@@ -21,7 +21,7 @@ package org.apache.ws.security.processor
import org.apache.ws.security.WSDocInfo;
import org.apache.ws.security.WSSecurityEngineResult;
-import org.apache.ws.security.WSSecurityException;
+import org.apache.ws.security.common.ext.WSSecurityException;
import org.apache.ws.security.handler.RequestData;
import org.w3c.dom.Element;
Modified: webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/processor/ReferenceListProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/processor/ReferenceListProcessor.java?rev=1374326&r1=1374325&r2=1374326&view=diff
==============================================================================
--- webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/processor/ReferenceListProcessor.java (original)
+++ webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/processor/ReferenceListProcessor.java Fri Aug 17 15:40:59 2012
@@ -30,7 +30,7 @@ import org.apache.ws.security.WSConstant
import org.apache.ws.security.WSDataRef;
import org.apache.ws.security.WSDocInfo;
import org.apache.ws.security.WSSecurityEngineResult;
-import org.apache.ws.security.WSSecurityException;
+import org.apache.ws.security.common.ext.WSSecurityException;
import org.apache.ws.security.handler.RequestData;
import org.apache.ws.security.message.CallbackLookup;
import org.apache.ws.security.message.DOMCallbackLookup;
@@ -140,7 +140,7 @@ public class ReferenceListProcessor impl
);
// KeyInfo cannot be null
if (keyInfoElement == null) {
- throw new WSSecurityException(WSSecurityException.INVALID_SECURITY, "noKeyinfo");
+ throw new WSSecurityException(WSSecurityException.ErrorCode.INVALID_SECURITY, "noKeyinfo");
}
// Check BSP compliance
if (data.getWssConfig().isWsiBSPCompliant()) {
@@ -198,21 +198,21 @@ public class ReferenceListProcessor impl
}
if (result != 1) {
throw new WSSecurityException(
- WSSecurityException.INVALID_SECURITY, "invalidDataRef"
+ WSSecurityException.ErrorCode.INVALID_SECURITY, "invalidDataRef"
);
}
if (!WSConstants.WSSE_NS.equals(child.getNamespaceURI()) ||
!SecurityTokenReference.SECURITY_TOKEN_REFERENCE.equals(child.getLocalName())) {
throw new WSSecurityException(
- WSSecurityException.INVALID_SECURITY, "noSecTokRef"
+ WSSecurityException.ErrorCode.INVALID_SECURITY, "noSecTokRef"
);
}
// EncryptionAlgorithm cannot be null
if (encAlgo == null) {
throw new WSSecurityException(
- WSSecurityException.UNSUPPORTED_ALGORITHM, "noEncAlgo"
+ WSSecurityException.ErrorCode.UNSUPPORTED_ALGORITHM, "noEncAlgo"
);
}
// EncryptionAlgorithm must be 3DES, or AES128, or AES256
@@ -222,7 +222,7 @@ public class ReferenceListProcessor impl
&& !WSConstants.AES_256.equals(encAlgo)
&& !WSConstants.AES_256_GCM.equals(encAlgo)) {
throw new WSSecurityException(
- WSSecurityException.INVALID_SECURITY, "badEncAlgo", new Object[]{encAlgo}
+ WSSecurityException.ErrorCode.INVALID_SECURITY, "badEncAlgo", new Object[]{encAlgo}
);
}
}
@@ -252,7 +252,7 @@ public class ReferenceListProcessor impl
callbackLookup.getElement(dataRefURI, null, true);
if (encryptedDataElement == null) {
throw new WSSecurityException(
- WSSecurityException.INVALID_SECURITY, "dataRef", new Object[] {dataRefURI}
+ WSSecurityException.ErrorCode.INVALID_SECURITY, "dataRef", new Object[] {dataRefURI}
);
}
if (encryptedDataElement.getLocalName().equals(WSConstants.ENCRYPTED_HEADER)
@@ -291,7 +291,7 @@ public class ReferenceListProcessor impl
xmlCipher.init(XMLCipher.DECRYPT_MODE, symmetricKey);
} catch (XMLEncryptionException ex) {
throw new WSSecurityException(
- WSSecurityException.UNSUPPORTED_ALGORITHM, null, null, ex
+ WSSecurityException.ErrorCode.UNSUPPORTED_ALGORITHM, null, null, ex
);
}
@@ -311,7 +311,7 @@ public class ReferenceListProcessor impl
try {
xmlCipher.doFinal(doc, encData, content);
} catch (Exception ex) {
- throw new WSSecurityException(WSSecurityException.FAILED_CHECK, null, null, ex);
+ throw new WSSecurityException(WSSecurityException.ErrorCode.FAILED_CHECK, null, null, ex);
}
if (parent.getLocalName().equals(WSConstants.ENCRYPTED_HEADER)
Modified: webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/processor/SAMLTokenProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/processor/SAMLTokenProcessor.java?rev=1374326&r1=1374325&r2=1374326&view=diff
==============================================================================
--- webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/processor/SAMLTokenProcessor.java (original)
+++ webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/processor/SAMLTokenProcessor.java Fri Aug 17 15:40:59 2012
@@ -23,7 +23,7 @@ import org.apache.ws.security.SAMLTokenP
import org.apache.ws.security.WSConstants;
import org.apache.ws.security.WSDocInfo;
import org.apache.ws.security.WSSecurityEngineResult;
-import org.apache.ws.security.WSSecurityException;
+import org.apache.ws.security.common.ext.WSSecurityException;
import org.apache.ws.security.handler.RequestData;
import org.apache.ws.security.saml.ext.AssertionWrapper;
import org.apache.ws.security.util.DOM2Writer;
@@ -65,7 +65,7 @@ public class SAMLTokenProcessor implemen
return java.util.Collections.singletonList(result);
} else if (foundElement != null) {
throw new WSSecurityException(
- WSSecurityException.INVALID_SECURITY_TOKEN, "duplicateError"
+ WSSecurityException.ErrorCode.INVALID_SECURITY_TOKEN, "duplicateError"
);
}
Modified: webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/processor/SecurityContextTokenProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/processor/SecurityContextTokenProcessor.java?rev=1374326&r1=1374325&r2=1374326&view=diff
==============================================================================
--- webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/processor/SecurityContextTokenProcessor.java (original)
+++ webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/processor/SecurityContextTokenProcessor.java Fri Aug 17 15:40:59 2012
@@ -21,9 +21,9 @@ package org.apache.ws.security.processor
import org.apache.ws.security.WSConstants;
import org.apache.ws.security.WSDocInfo;
-import org.apache.ws.security.WSPasswordCallback;
import org.apache.ws.security.WSSecurityEngineResult;
-import org.apache.ws.security.WSSecurityException;
+import org.apache.ws.security.common.ext.WSPasswordCallback;
+import org.apache.ws.security.common.ext.WSSecurityException;
import org.apache.ws.security.handler.RequestData;
import org.apache.ws.security.message.token.SecurityContextToken;
import org.apache.ws.security.validate.Credential;
@@ -100,24 +100,24 @@ public class SecurityContextTokenProcess
throws WSSecurityException {
if (cb == null) {
- throw new WSSecurityException(WSSecurityException.FAILURE, "noCallback");
+ throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "noCallback");
}
WSPasswordCallback callback =
- new WSPasswordCallback(identifier, WSPasswordCallback.SECURITY_CONTEXT_TOKEN);
+ new WSPasswordCallback(identifier, WSPasswordCallback.Usage.SECURITY_CONTEXT_TOKEN);
try {
Callback[] callbacks = new Callback[]{callback};
cb.handle(callbacks);
} catch (IOException e) {
throw new WSSecurityException(
- WSSecurityException.FAILURE,
+ WSSecurityException.ErrorCode.FAILURE,
"noKey",
new Object[] {identifier},
e
);
} catch (UnsupportedCallbackException e) {
throw new WSSecurityException(
- WSSecurityException.FAILURE,
+ WSSecurityException.ErrorCode.FAILURE,
"noKey",
new Object[] {identifier},
e
Modified: webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/processor/SignatureConfirmationProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/processor/SignatureConfirmationProcessor.java?rev=1374326&r1=1374325&r2=1374326&view=diff
==============================================================================
--- webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/processor/SignatureConfirmationProcessor.java (original)
+++ webservices/wss4j/trunk/wss4j-dom/src/main/java/org/apache/ws/security/processor/SignatureConfirmationProcessor.java Fri Aug 17 15:40:59 2012
@@ -22,7 +22,7 @@ package org.apache.ws.security.processor
import org.apache.ws.security.WSConstants;
import org.apache.ws.security.WSDocInfo;
import org.apache.ws.security.WSSecurityEngineResult;
-import org.apache.ws.security.WSSecurityException;
+import org.apache.ws.security.common.ext.WSSecurityException;
import org.apache.ws.security.handler.RequestData;
import org.apache.ws.security.message.token.SignatureConfirmation;
import org.w3c.dom.Element;
@@ -49,7 +49,7 @@ public class SignatureConfirmationProces
// A wsu:Id is required as per the BSP spec
if (data.getWssConfig().isWsiBSPCompliant() && (id == null || "".equals(id))) {
throw new WSSecurityException(
- WSSecurityException.INVALID_SECURITY,
+ WSSecurityException.ErrorCode.INVALID_SECURITY,
"requiredElementNoID",
new Object[] {elem.getLocalName()}
);