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 [10/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...
Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/output/SignatureOutputProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/output/SignatureOutputProcessor.java?rev=1181995&r1=1179730&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/output/SignatureOutputProcessor.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/output/SignatureOutputProcessor.java Tue Oct 11 18:03:00 2011
@@ -16,56 +16,47 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.swssf.impl.processor.output;
+package org.swssf.wss.impl.processor.output;
-import org.apache.commons.codec.binary.Base64;
-import org.swssf.config.JCEAlgorithmMapper;
-import org.swssf.ext.*;
-import org.swssf.impl.SignaturePartDef;
-import org.xmlsecurity.ns.configuration.AlgorithmType;
+import org.swssf.wss.ext.WSSConstants;
+import org.swssf.wss.ext.WSSSecurityProperties;
+import org.swssf.wss.ext.WSSecurityException;
+import org.swssf.xmlsec.ext.OutputProcessorChain;
+import org.swssf.xmlsec.ext.SecurePart;
+import org.swssf.xmlsec.ext.XMLSecurityConstants;
+import org.swssf.xmlsec.ext.XMLSecurityException;
+import org.swssf.xmlsec.impl.SignaturePartDef;
+import org.swssf.xmlsec.impl.processor.output.AbstractSignatureOutputProcessor;
import javax.xml.namespace.QName;
import javax.xml.stream.XMLStreamException;
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.io.BufferedOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.lang.reflect.InvocationTargetException;
-import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.security.NoSuchProviderException;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.UUID;
/**
* @author $Author$
* @version $Revision$ $Date$
*/
-public class SignatureOutputProcessor extends AbstractOutputProcessor {
+public class SignatureOutputProcessor extends AbstractSignatureOutputProcessor {
- private List<SecurePart> secureParts;
- private List<SignaturePartDef> signaturePartDefList = new LinkedList<SignaturePartDef>();
-
- private InternalSignatureOutputProcessor activeInternalSignatureOutputProcessor = null;
-
- public SignatureOutputProcessor(SecurityProperties securityProperties, Constants.Action action) throws WSSecurityException {
+ public SignatureOutputProcessor(WSSSecurityProperties securityProperties, XMLSecurityConstants.Action action) throws XMLSecurityException {
super(securityProperties, action);
- secureParts = securityProperties.getSignatureSecureParts();
- }
-
- public List<SignaturePartDef> getSignaturePartDefList() {
- return signaturePartDefList;
}
@Override
- public void processEvent(XMLEvent xmlEvent, OutputProcessorChain outputProcessorChain) throws XMLStreamException, WSSecurityException {
+ public void processEvent(XMLEvent xmlEvent, OutputProcessorChain outputProcessorChain) throws XMLStreamException, XMLSecurityException {
if (xmlEvent.isStartElement()) {
StartElement startElement = xmlEvent.asStartElement();
//avoid double signature when child elements matches too
- if (activeInternalSignatureOutputProcessor == null) {
+ if (getActiveInternalSignatureOutputProcessor() == null) {
SecurePart securePart = securePartMatches(startElement, outputProcessorChain);
if (securePart != null) {
@@ -83,28 +74,30 @@ public class SignatureOutputProcessor ex
Iterator<Attribute> attributeIterator = startElement.getAttributes();
while (attributeIterator.hasNext()) {
Attribute attribute = attributeIterator.next();
- if (attribute.getName().equals(Constants.ATT_wsu_Id)) {
+ if (attribute.getName().equals(WSSConstants.ATT_wsu_Id)) {
signaturePartDef.setSigRefId(attribute.getValue());
found = true;
}
}
if (!found) {
- attributeList.add(createAttribute(Constants.ATT_wsu_Id, signaturePartDef.getSigRefId()));
+ attributeList.add(createAttribute(WSSConstants.ATT_wsu_Id, signaturePartDef.getSigRefId()));
xmlEvent = cloneStartElementEvent(xmlEvent, attributeList);
}
} else {
- if (Constants.SOAPMESSAGE_NS10_STRTransform.equals(securePart.getName())) {
+ if (WSSConstants.SOAPMESSAGE_NS10_STRTransform.equals(securePart.getName())) {
signaturePartDef.setSigRefId(securePart.getIdToReference());
- signaturePartDef.setTransformAlgo(Constants.SOAPMESSAGE_NS10_STRTransform);
- signaturePartDef.setC14nAlgo(Constants.NS_C14N_EXCL);
+ signaturePartDef.setTransformAlgo(WSSConstants.SOAPMESSAGE_NS10_STRTransform);
+ signaturePartDef.setC14nAlgo(WSSConstants.NS_C14N_EXCL);
} else {
signaturePartDef.setSigRefId(securePart.getIdToSign());
signaturePartDef.setC14nAlgo(getSecurityProperties().getSignatureCanonicalizationAlgorithm());
}
}
- signaturePartDefList.add(signaturePartDef);
+ getSignaturePartDefList().add(signaturePartDef);
internalSignatureOutputProcessor = new InternalSignatureOutputProcessor(getSecurityProperties(), getAction(), signaturePartDef, startElement.getName());
+ internalSignatureOutputProcessor.getAfterProcessors().add(SignatureOutputProcessor.class.getName());
+ internalSignatureOutputProcessor.getBeforeProcessors().add(SignatureEndingOutputProcessor.class.getName());
} catch (NoSuchAlgorithmException e) {
throw new WSSecurityException(
@@ -115,7 +108,7 @@ public class SignatureOutputProcessor ex
throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "noSecProvider", e);
}
- activeInternalSignatureOutputProcessor = internalSignatureOutputProcessor;
+ setActiveInternalSignatureOutputProcessor(internalSignatureOutputProcessor);
outputProcessorChain.addProcessor(internalSignatureOutputProcessor);
}
}
@@ -123,19 +116,7 @@ public class SignatureOutputProcessor ex
outputProcessorChain.processEvent(xmlEvent);
}
- private SecurePart securePartMatches(StartElement startElement, OutputProcessorChain outputProcessorChain) {
- SecurePart securePart = securePartMatches(startElement, this.secureParts);
- if (securePart != null) {
- return securePart;
- }
- List<SecurePart> secureParts = outputProcessorChain.getSecurityContext().getAsList(SecurePart.class);
- if (secureParts == null) {
- return null;
- }
- return securePartMatches(startElement, secureParts);
- }
-
- private SecurePart securePartMatches(StartElement startElement, List<SecurePart> secureParts) {
+ protected SecurePart securePartMatches(StartElement startElement, List<SecurePart> secureParts) {
Iterator<SecurePart> securePartIterator = secureParts.iterator();
while (securePartIterator.hasNext()) {
SecurePart securePart = securePartIterator.next();
@@ -151,10 +132,10 @@ public class SignatureOutputProcessor ex
Attribute attribute = attributeIterator.next();
if (attribute != null) {
QName attributeName = attribute.getName();
- if ((attributeName.equals(Constants.ATT_wsu_Id)
- || attributeName.equals(Constants.ATT_NULL_Id)
- || attributeName.equals(Constants.ATT_NULL_ID)
- || attributeName.equals(Constants.ATT_NULL_AssertionID))
+ if ((attributeName.equals(WSSConstants.ATT_wsu_Id)
+ || attributeName.equals(WSSConstants.ATT_NULL_Id)
+ || attributeName.equals(WSSConstants.ATT_NULL_ID)
+ || attributeName.equals(WSSConstants.ATT_NULL_AssertionID))
&& attribute.getValue().equals(securePart.getIdToSign())) {
return securePart;
}
@@ -164,77 +145,4 @@ public class SignatureOutputProcessor ex
}
return null;
}
-
- class InternalSignatureOutputProcessor extends AbstractOutputProcessor {
-
- private SignaturePartDef signaturePartDef;
- private QName startElement;
- private int elementCounter = 0;
-
- private OutputStream bufferedDigestOutputStream;
- private org.swssf.impl.util.DigestOutputStream digestOutputStream;
- private Transformer transformer;
-
- InternalSignatureOutputProcessor(SecurityProperties securityProperties, Constants.Action action, SignaturePartDef signaturePartDef, QName startElement) throws WSSecurityException, NoSuchProviderException, NoSuchAlgorithmException {
- super(securityProperties, action);
- this.getAfterProcessors().add(SignatureOutputProcessor.class.getName());
- this.getBeforeProcessors().add(SignatureEndingOutputProcessor.class.getName());
- this.getBeforeProcessors().add(InternalSignatureOutputProcessor.class.getName());
- this.signaturePartDef = signaturePartDef;
- this.startElement = startElement;
-
- AlgorithmType algorithmID = JCEAlgorithmMapper.getAlgorithmMapping(getSecurityProperties().getSignatureDigestAlgorithm());
- MessageDigest messageDigest = MessageDigest.getInstance(algorithmID.getJCEName(), algorithmID.getJCEProvider());
- this.digestOutputStream = new org.swssf.impl.util.DigestOutputStream(messageDigest);
- this.bufferedDigestOutputStream = new BufferedOutputStream(digestOutputStream);
-
- try {
- if (signaturePartDef.getTransformAlgo() != null) {
- Transformer transformer = Utils.getTransformer("#default", this.bufferedDigestOutputStream, signaturePartDef.getC14nAlgo());
- this.transformer = Utils.getTransformer(transformer, null, signaturePartDef.getTransformAlgo());
- } else {
- transformer = Utils.getTransformer(null, this.bufferedDigestOutputStream, signaturePartDef.getC14nAlgo());
- }
- } catch (NoSuchMethodException e) {
- throw new WSSecurityException(WSSecurityException.ErrorCode.FAILED_SIGNATURE, e);
- } catch (InstantiationException e) {
- throw new WSSecurityException(WSSecurityException.ErrorCode.FAILED_SIGNATURE, e);
- } catch (IllegalAccessException e) {
- throw new WSSecurityException(WSSecurityException.ErrorCode.FAILED_SIGNATURE, e);
- } catch (InvocationTargetException e) {
- throw new WSSecurityException(WSSecurityException.ErrorCode.FAILED_SIGNATURE, e);
- }
- }
-
- @Override
- public void processEvent(XMLEvent xmlEvent, OutputProcessorChain outputProcessorChain) throws XMLStreamException, WSSecurityException {
-
- transformer.transform(xmlEvent);
-
- if (xmlEvent.isStartElement()) {
- elementCounter++;
- } else if (xmlEvent.isEndElement()) {
- elementCounter--;
-
- EndElement endElement = xmlEvent.asEndElement();
-
- if (endElement.getName().equals(this.startElement) && elementCounter == 0) {
- try {
- bufferedDigestOutputStream.close();
- } catch (IOException e) {
- throw new WSSecurityException(WSSecurityException.ErrorCode.FAILED_SIGNATURE, e);
- }
- String calculatedDigest = new String(Base64.encodeBase64(this.digestOutputStream.getDigestValue()));
- logger.debug("Calculated Digest: " + calculatedDigest);
- signaturePartDef.setDigestValue(calculatedDigest);
-
- outputProcessorChain.removeProcessor(this);
- //from now on signature is possible again
- activeInternalSignatureOutputProcessor = null;
- xmlEvent = createEndElement(startElement);
- }
- }
- outputProcessorChain.processEvent(xmlEvent);
- }
- }
}
Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/output/TimestampOutputProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/output/TimestampOutputProcessor.java?rev=1181995&r1=1179730&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/output/TimestampOutputProcessor.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/output/TimestampOutputProcessor.java Tue Oct 11 18:03:00 2011
@@ -16,9 +16,16 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.swssf.impl.processor.output;
+package org.swssf.wss.impl.processor.output;
-import org.swssf.ext.*;
+import org.swssf.wss.ext.WSSConstants;
+import org.swssf.wss.ext.WSSDocumentContext;
+import org.swssf.wss.ext.WSSSecurityProperties;
+import org.swssf.wss.ext.WSSecurityException;
+import org.swssf.xmlsec.ext.AbstractOutputProcessor;
+import org.swssf.xmlsec.ext.OutputProcessorChain;
+import org.swssf.xmlsec.ext.XMLSecurityConstants;
+import org.swssf.xmlsec.ext.XMLSecurityException;
import javax.xml.datatype.DatatypeConfigurationException;
import javax.xml.datatype.DatatypeFactory;
@@ -35,7 +42,7 @@ import java.util.GregorianCalendar;
*/
public class TimestampOutputProcessor extends AbstractOutputProcessor {
- public TimestampOutputProcessor(SecurityProperties securityProperties, Constants.Action action) throws WSSecurityException {
+ public TimestampOutputProcessor(WSSSecurityProperties securityProperties, XMLSecurityConstants.Action action) throws XMLSecurityException {
super(securityProperties, action);
}
@@ -52,29 +59,29 @@ public class TimestampOutputProcessor ex
*/
@Override
- public void processEvent(XMLEvent xmlEvent, OutputProcessorChain outputProcessorChain) throws XMLStreamException, WSSecurityException {
+ public void processEvent(XMLEvent xmlEvent, OutputProcessorChain outputProcessorChain) throws XMLStreamException, XMLSecurityException {
outputProcessorChain.processEvent(xmlEvent);
if (xmlEvent.isStartElement()) {
StartElement startElement = xmlEvent.asStartElement();
- if (outputProcessorChain.getDocumentContext().isInSecurityHeader() && startElement.getName().equals(Constants.TAG_wsse_Security)) {
+ if (((WSSDocumentContext) outputProcessorChain.getDocumentContext()).isInSecurityHeader() && startElement.getName().equals(WSSConstants.TAG_wsse_Security)) {
try {
DatatypeFactory datatypeFactory = DatatypeFactory.newInstance();
XMLGregorianCalendar created = datatypeFactory.newXMLGregorianCalendar(new GregorianCalendar());
GregorianCalendar expiresCalendar = new GregorianCalendar();
- expiresCalendar.add(Calendar.SECOND, getSecurityProperties().getTimestampTTL());
+ expiresCalendar.add(Calendar.SECOND, ((WSSSecurityProperties) getSecurityProperties()).getTimestampTTL());
XMLGregorianCalendar expires = datatypeFactory.newXMLGregorianCalendar(expiresCalendar);
OutputProcessorChain subOutputProcessorChain = outputProcessorChain.createSubChain(this);
//wsu:id is optional and will be added when signing...
- createStartElementAndOutputAsEvent(subOutputProcessorChain, Constants.TAG_wsu_Timestamp, null);
- createStartElementAndOutputAsEvent(subOutputProcessorChain, Constants.TAG_wsu_Created, null);
+ createStartElementAndOutputAsEvent(subOutputProcessorChain, WSSConstants.TAG_wsu_Timestamp, null);
+ createStartElementAndOutputAsEvent(subOutputProcessorChain, WSSConstants.TAG_wsu_Created, null);
createCharactersAndOutputAsEvent(subOutputProcessorChain, created.toXMLFormat());
- createEndElementAndOutputAsEvent(subOutputProcessorChain, Constants.TAG_wsu_Created);
- createStartElementAndOutputAsEvent(subOutputProcessorChain, Constants.TAG_wsu_Expires, null);
+ createEndElementAndOutputAsEvent(subOutputProcessorChain, WSSConstants.TAG_wsu_Created);
+ createStartElementAndOutputAsEvent(subOutputProcessorChain, WSSConstants.TAG_wsu_Expires, null);
createCharactersAndOutputAsEvent(subOutputProcessorChain, expires.toXMLFormat());
- createEndElementAndOutputAsEvent(subOutputProcessorChain, Constants.TAG_wsu_Expires);
- createEndElementAndOutputAsEvent(subOutputProcessorChain, Constants.TAG_wsu_Timestamp);
+ createEndElementAndOutputAsEvent(subOutputProcessorChain, WSSConstants.TAG_wsu_Expires);
+ createEndElementAndOutputAsEvent(subOutputProcessorChain, WSSConstants.TAG_wsu_Timestamp);
} catch (DatatypeConfigurationException e) {
throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, e);
}
Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/output/UsernameTokenOutputProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/output/UsernameTokenOutputProcessor.java?rev=1181995&r1=1179730&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/output/UsernameTokenOutputProcessor.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/output/UsernameTokenOutputProcessor.java Tue Oct 11 18:03:00 2011
@@ -16,12 +16,13 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.swssf.impl.processor.output;
+package org.swssf.wss.impl.processor.output;
import org.apache.commons.codec.binary.Base64;
-import org.swssf.crypto.Crypto;
-import org.swssf.ext.*;
-import org.swssf.impl.securityToken.UsernameSecurityToken;
+import org.swssf.wss.ext.*;
+import org.swssf.wss.impl.securityToken.UsernameSecurityToken;
+import org.swssf.xmlsec.crypto.Crypto;
+import org.swssf.xmlsec.ext.*;
import javax.xml.datatype.DatatypeConfigurationException;
import javax.xml.datatype.DatatypeFactory;
@@ -38,25 +39,25 @@ import java.util.*;
*/
public class UsernameTokenOutputProcessor extends AbstractOutputProcessor {
- public UsernameTokenOutputProcessor(SecurityProperties securityProperties, Constants.Action action) throws WSSecurityException {
+ public UsernameTokenOutputProcessor(WSSSecurityProperties securityProperties, XMLSecurityConstants.Action action) throws XMLSecurityException {
super(securityProperties, action);
}
@Override
- public void processEvent(XMLEvent xmlEvent, OutputProcessorChain outputProcessorChain) throws XMLStreamException, WSSecurityException {
+ public void processEvent(XMLEvent xmlEvent, OutputProcessorChain outputProcessorChain) throws XMLStreamException, XMLSecurityException {
try {
- WSPasswordCallback pwCb = new WSPasswordCallback(getSecurityProperties().getTokenUser(), WSPasswordCallback.Usage.USERNAME_TOKEN);
- Utils.doPasswordCallback(getSecurityProperties().getCallbackHandler(), pwCb);
+ WSPasswordCallback pwCb = new WSPasswordCallback(((WSSSecurityProperties) getSecurityProperties()).getTokenUser(), WSPasswordCallback.Usage.USERNAME_TOKEN);
+ WSSUtils.doPasswordCallback(getSecurityProperties().getCallbackHandler(), pwCb);
String password = pwCb.getPassword();
- Constants.UsernameTokenPasswordType usernameTokenPasswordType = getSecurityProperties().getUsernameTokenPasswordType();
+ WSSConstants.UsernameTokenPasswordType usernameTokenPasswordType = ((WSSSecurityProperties) getSecurityProperties()).getUsernameTokenPasswordType();
if (password == null && usernameTokenPasswordType != null) {
throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE);
}
byte[] nonceValue = new byte[16];
- Constants.secureRandom.nextBytes(nonceValue);
+ WSSConstants.secureRandom.nextBytes(nonceValue);
DatatypeFactory datatypeFactory = DatatypeFactory.newInstance();
XMLGregorianCalendar created = datatypeFactory.newXMLGregorianCalendar(new GregorianCalendar());
@@ -67,7 +68,7 @@ public class UsernameTokenOutputProcesso
final UsernameSecurityToken usernameSecurityToken =
new UsernameSecurityToken(
- getSecurityProperties().getTokenUser(),
+ ((WSSSecurityProperties) getSecurityProperties()).getTokenUser(),
password,
created != null ? created.toXMLFormat() : null,
nonceValue,
@@ -87,12 +88,12 @@ public class UsernameTokenOutputProcesso
return wsuId;
}
};
- if (getAction() == Constants.Action.USERNAMETOKEN_SIGNED) {
+ if (getAction() == WSSConstants.USERNAMETOKEN_SIGNED) {
outputProcessorChain.getSecurityContext().registerSecurityTokenProvider(wsuId, securityTokenProvider);
- outputProcessorChain.getSecurityContext().put(Constants.PROP_USE_THIS_TOKEN_ID_FOR_SIGNATURE, wsuId);
- outputProcessorChain.getSecurityContext().put(Constants.PROP_APPEND_SIGNATURE_ON_THIS_ID, wsuId);
+ outputProcessorChain.getSecurityContext().put(WSSConstants.PROP_USE_THIS_TOKEN_ID_FOR_SIGNATURE, wsuId);
+ outputProcessorChain.getSecurityContext().put(WSSConstants.PROP_APPEND_SIGNATURE_ON_THIS_ID, wsuId);
}
- outputProcessorChain.addProcessor(new FinalUsernameTokenOutputProcessor(getSecurityProperties(), getAction(), wsuId, nonceValue, password, created));
+ outputProcessorChain.addProcessor(new FinalUsernameTokenOutputProcessor(((WSSSecurityProperties) getSecurityProperties()), getAction(), wsuId, nonceValue, password, created));
} catch (DatatypeConfigurationException e) {
throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, e);
@@ -109,9 +110,9 @@ public class UsernameTokenOutputProcesso
private String password = null;
private XMLGregorianCalendar created = null;
- FinalUsernameTokenOutputProcessor(SecurityProperties securityProperties, Constants.Action action, String wsuId,
+ FinalUsernameTokenOutputProcessor(WSSSecurityProperties securityProperties, XMLSecurityConstants.Action action, String wsuId,
byte[] nonceValue, String password, XMLGregorianCalendar created)
- throws WSSecurityException {
+ throws XMLSecurityException {
super(securityProperties, action);
this.getAfterProcessors().add(UsernameTokenOutputProcessor.class.getName());
this.getAfterProcessors().add(UsernameTokenOutputProcessor.class.getName());
@@ -122,48 +123,48 @@ public class UsernameTokenOutputProcesso
}
@Override
- public void processEvent(XMLEvent xmlEvent, OutputProcessorChain outputProcessorChain) throws XMLStreamException, WSSecurityException {
+ public void processEvent(XMLEvent xmlEvent, OutputProcessorChain outputProcessorChain) throws XMLStreamException, XMLSecurityException {
outputProcessorChain.processEvent(xmlEvent);
if (xmlEvent.isStartElement()) {
StartElement startElement = xmlEvent.asStartElement();
- if (outputProcessorChain.getDocumentContext().isInSecurityHeader() && startElement.getName().equals(Constants.TAG_wsse_Security)) {
+ if (((WSSDocumentContext) outputProcessorChain.getDocumentContext()).isInSecurityHeader() && startElement.getName().equals(WSSConstants.TAG_wsse_Security)) {
OutputProcessorChain subOutputProcessorChain = outputProcessorChain.createSubChain(this);
Map<QName, String> attributes = new HashMap<QName, String>();
- attributes.put(Constants.ATT_wsu_Id, this.wsuId);
- createStartElementAndOutputAsEvent(subOutputProcessorChain, Constants.TAG_wsse_UsernameToken, attributes);
- createStartElementAndOutputAsEvent(subOutputProcessorChain, Constants.TAG_wsse_Username, null);
- createCharactersAndOutputAsEvent(subOutputProcessorChain, getSecurityProperties().getTokenUser());
- createEndElementAndOutputAsEvent(subOutputProcessorChain, Constants.TAG_wsse_Username);
- if (getSecurityProperties().getUsernameTokenPasswordType() != Constants.UsernameTokenPasswordType.PASSWORD_NONE) {
+ attributes.put(WSSConstants.ATT_wsu_Id, this.wsuId);
+ createStartElementAndOutputAsEvent(subOutputProcessorChain, WSSConstants.TAG_wsse_UsernameToken, attributes);
+ createStartElementAndOutputAsEvent(subOutputProcessorChain, WSSConstants.TAG_wsse_Username, null);
+ createCharactersAndOutputAsEvent(subOutputProcessorChain, ((WSSSecurityProperties) getSecurityProperties()).getTokenUser());
+ createEndElementAndOutputAsEvent(subOutputProcessorChain, WSSConstants.TAG_wsse_Username);
+ if (((WSSSecurityProperties) getSecurityProperties()).getUsernameTokenPasswordType() != WSSConstants.UsernameTokenPasswordType.PASSWORD_NONE) {
attributes = new HashMap<QName, String>();
- attributes.put(Constants.ATT_NULL_Type,
- getSecurityProperties().getUsernameTokenPasswordType() == Constants.UsernameTokenPasswordType.PASSWORD_DIGEST
- ? Constants.UsernameTokenPasswordType.PASSWORD_DIGEST.getNamespace()
- : Constants.UsernameTokenPasswordType.PASSWORD_TEXT.getNamespace());
- createStartElementAndOutputAsEvent(subOutputProcessorChain, Constants.TAG_wsse_Password, attributes);
+ attributes.put(WSSConstants.ATT_NULL_Type,
+ ((WSSSecurityProperties) getSecurityProperties()).getUsernameTokenPasswordType() == WSSConstants.UsernameTokenPasswordType.PASSWORD_DIGEST
+ ? WSSConstants.UsernameTokenPasswordType.PASSWORD_DIGEST.getNamespace()
+ : WSSConstants.UsernameTokenPasswordType.PASSWORD_TEXT.getNamespace());
+ createStartElementAndOutputAsEvent(subOutputProcessorChain, WSSConstants.TAG_wsse_Password, attributes);
createCharactersAndOutputAsEvent(subOutputProcessorChain,
- getSecurityProperties().getUsernameTokenPasswordType() == Constants.UsernameTokenPasswordType.PASSWORD_DIGEST
- ? Utils.doPasswordDigest(this.nonceValue, this.created.toXMLFormat(), this.password)
+ ((WSSSecurityProperties) getSecurityProperties()).getUsernameTokenPasswordType() == WSSConstants.UsernameTokenPasswordType.PASSWORD_DIGEST
+ ? WSSUtils.doPasswordDigest(this.nonceValue, this.created.toXMLFormat(), this.password)
: this.password);
- createEndElementAndOutputAsEvent(subOutputProcessorChain, Constants.TAG_wsse_Password);
+ createEndElementAndOutputAsEvent(subOutputProcessorChain, WSSConstants.TAG_wsse_Password);
}
- if (getSecurityProperties().getUsernameTokenPasswordType() == Constants.UsernameTokenPasswordType.PASSWORD_DIGEST
- || Arrays.binarySearch(getSecurityProperties().getOutAction(), Constants.Action.USERNAMETOKEN_SIGNED) >= 0) {
+ if (((WSSSecurityProperties) getSecurityProperties()).getUsernameTokenPasswordType() == WSSConstants.UsernameTokenPasswordType.PASSWORD_DIGEST
+ || Arrays.binarySearch(getSecurityProperties().getOutAction(), WSSConstants.USERNAMETOKEN_SIGNED) >= 0) {
attributes = new HashMap<QName, String>();
- attributes.put(Constants.ATT_NULL_EncodingType, Constants.SOAPMESSAGE_NS10_BASE64_ENCODING);
- createStartElementAndOutputAsEvent(subOutputProcessorChain, Constants.TAG_wsse_Nonce, attributes);
+ attributes.put(WSSConstants.ATT_NULL_EncodingType, WSSConstants.SOAPMESSAGE_NS10_BASE64_ENCODING);
+ createStartElementAndOutputAsEvent(subOutputProcessorChain, WSSConstants.TAG_wsse_Nonce, attributes);
createCharactersAndOutputAsEvent(subOutputProcessorChain, new Base64(76, new byte[]{'\n'}).encodeToString(this.nonceValue));
- createEndElementAndOutputAsEvent(subOutputProcessorChain, Constants.TAG_wsse_Nonce);
- createStartElementAndOutputAsEvent(subOutputProcessorChain, Constants.TAG_wsu_Created, null);
+ createEndElementAndOutputAsEvent(subOutputProcessorChain, WSSConstants.TAG_wsse_Nonce);
+ createStartElementAndOutputAsEvent(subOutputProcessorChain, WSSConstants.TAG_wsu_Created, null);
createCharactersAndOutputAsEvent(subOutputProcessorChain, this.created.toXMLFormat());
- createEndElementAndOutputAsEvent(subOutputProcessorChain, Constants.TAG_wsu_Created);
+ createEndElementAndOutputAsEvent(subOutputProcessorChain, WSSConstants.TAG_wsu_Created);
}
- createEndElementAndOutputAsEvent(subOutputProcessorChain, Constants.TAG_wsse_UsernameToken);
+ createEndElementAndOutputAsEvent(subOutputProcessorChain, WSSConstants.TAG_wsse_UsernameToken);
outputProcessorChain.removeProcessor(this);
}
Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/OpenSAMLBootstrap.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/OpenSAMLBootstrap.java?rev=1181995&r1=1179730&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/OpenSAMLBootstrap.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/OpenSAMLBootstrap.java Tue Oct 11 18:03:00 2011
@@ -17,7 +17,7 @@
* under the License.
*/
-package org.swssf.impl.saml;
+package org.swssf.wss.impl.saml;
import org.opensaml.DefaultBootstrap;
import org.opensaml.xml.ConfigurationException;
Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/OpenSAMLUtil.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/OpenSAMLUtil.java?rev=1181995&r1=1179730&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/OpenSAMLUtil.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/OpenSAMLUtil.java Tue Oct 11 18:03:00 2011
@@ -17,14 +17,14 @@
* under the License.
*/
-package org.swssf.impl.saml;
+package org.swssf.wss.impl.saml;
import org.opensaml.xml.*;
import org.opensaml.xml.io.*;
import org.opensaml.xml.signature.Signature;
import org.opensaml.xml.signature.SignatureException;
import org.opensaml.xml.signature.Signer;
-import org.swssf.ext.WSSecurityException;
+import org.swssf.wss.ext.WSSecurityException;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/SAMLAssertionWrapper.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/SAMLAssertionWrapper.java?rev=1181995&r1=1179730&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/SAMLAssertionWrapper.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/SAMLAssertionWrapper.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.saml;
+package org.swssf.wss.impl.saml;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.logging.Log;
@@ -37,10 +37,11 @@ import org.opensaml.xml.signature.Signat
import org.opensaml.xml.signature.SignatureConstants;
import org.opensaml.xml.signature.SignatureValidator;
import org.opensaml.xml.validation.ValidationException;
-import org.swssf.crypto.Crypto;
-import org.swssf.ext.*;
-import org.swssf.impl.saml.builder.SAML1ComponentBuilder;
-import org.swssf.impl.saml.builder.SAML2ComponentBuilder;
+import org.swssf.wss.ext.*;
+import org.swssf.wss.impl.saml.builder.SAML1ComponentBuilder;
+import org.swssf.wss.impl.saml.builder.SAML2ComponentBuilder;
+import org.swssf.xmlsec.crypto.Crypto;
+import org.swssf.xmlsec.ext.XMLSecurityException;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -94,7 +95,7 @@ public class SAMLAssertionWrapper {
}
}
- public SAMLAssertionWrapper(SAMLCallback samlCallback) throws WSSecurityException {
+ public SAMLAssertionWrapper(SAMLCallback samlCallback) throws XMLSecurityException {
OpenSAMLUtil.initSamlEngine();
SAMLVersion samlVersion = samlCallback.getSamlVersion();
@@ -243,7 +244,7 @@ public class SAMLAssertionWrapper {
return null;
}
- public void signAssertion(String issuerKeyName, String issuerKeyPassword, Crypto issuerCrypto, boolean sendKeyValue) throws WSSecurityException {
+ public void signAssertion(String issuerKeyName, String issuerKeyPassword, Crypto issuerCrypto, boolean sendKeyValue) throws XMLSecurityException {
//
// Create the signature
//
@@ -315,7 +316,7 @@ public class SAMLAssertionWrapper {
*
* @throws ValidationException
*/
- public SAMLKeyInfo verifySignature(SecurityProperties securityProperties) throws WSSecurityException {
+ public SAMLKeyInfo verifySignature(WSSSecurityProperties securityProperties) throws WSSecurityException {
Signature sig = null;
if (saml2 != null && saml2.getSignature() != null) {
sig = saml2.getSignature();
@@ -368,13 +369,13 @@ public class SAMLAssertionWrapper {
* @return The credential (as a SAMLKeyInfo object)
* @throws WSSecurityException
*/
- private SAMLKeyInfo getCredentialFromKeyInfo(Element keyInfoElement, SecurityProperties securityProperties) throws WSSecurityException {
+ private SAMLKeyInfo getCredentialFromKeyInfo(Element keyInfoElement, WSSSecurityProperties securityProperties) throws WSSecurityException {
// First try to find an EncryptedKey or a BinarySecret via DOM
Node node = keyInfoElement.getFirstChild();
while (node != null) {
if (Node.ELEMENT_NODE == node.getNodeType()) {
QName el = new QName(node.getNamespaceURI(), node.getLocalName());
- if (el.equals(Constants.TAG_xenc_EncryptedKey)) {
+ if (el.equals(WSSConstants.TAG_xenc_EncryptedKey)) {
//todo:
/*
EncryptedKeyProcessor proc = new EncryptedKeyProcessor();
@@ -387,7 +388,7 @@ public class SAMLAssertionWrapper {
return new SAMLKeyInfo(secret);
*/
return null;
- } else if (el.equals(Constants.TAG_wst_BinarySecret)) {
+ } else if (el.equals(WSSConstants.TAG_wst_BinarySecret)) {
Text txt = (Text) node.getFirstChild();
return new SAMLKeyInfo(Base64.decodeBase64(txt.getData()));
}
@@ -453,7 +454,7 @@ public class SAMLAssertionWrapper {
*
* @throws WSSecurityException
*/
- public SAMLKeyInfo parseHOKSubject(SecurityProperties securityProperties) throws WSSecurityException {
+ public SAMLKeyInfo parseHOKSubject(WSSSecurityProperties securityProperties) throws XMLSecurityException {
String confirmMethod = null;
List<String> methods = getConfirmationMethods();
if (methods != null && methods.size() > 0) {
@@ -486,7 +487,7 @@ public class SAMLAssertionWrapper {
* @return A Credential instance
* @throws WSSecurityException
*/
- public void verifySignedAssertion(SAMLKeyInfo samlKeyInfo, SecurityProperties securityProperties) throws WSSecurityException {
+ public void verifySignedAssertion(SAMLKeyInfo samlKeyInfo, WSSSecurityProperties securityProperties) throws XMLSecurityException {
validate(samlKeyInfo.getCerts(), samlKeyInfo.getPublicKey(), securityProperties);
}
@@ -499,7 +500,7 @@ public class SAMLAssertionWrapper {
*
* @throws WSSecurityException on a failed validation
*/
- protected void validate(X509Certificate[] certs, PublicKey publicKey, SecurityProperties securityProperties) throws WSSecurityException {
+ protected void validate(X509Certificate[] certs, PublicKey publicKey, WSSSecurityProperties securityProperties) throws XMLSecurityException {
Crypto crypto = securityProperties.getSignatureVerificationCrypto();
if (crypto == null) {
throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "noSigCryptoFile");
@@ -598,7 +599,7 @@ public class SAMLAssertionWrapper {
* @return a SAMLKeyInfo object
* @throws WSSecurityException
*/
- public SAMLKeyInfo getCredentialFromSubject(SecurityProperties securityProperties) throws WSSecurityException {
+ public SAMLKeyInfo getCredentialFromSubject(WSSSecurityProperties securityProperties) throws XMLSecurityException {
if (this.saml2 != null) {
return getCredentialFromSubject(this.saml2, securityProperties);
} else {
@@ -614,10 +615,10 @@ public class SAMLAssertionWrapper {
* @return The SAMLKeyInfo object obtained from the Subject
* @throws WSSecurityException
*/
- public SAMLKeyInfo getCredentialFromSubject(org.opensaml.saml1.core.Assertion assertion, SecurityProperties securityProperties) throws WSSecurityException {
+ public SAMLKeyInfo getCredentialFromSubject(org.opensaml.saml1.core.Assertion assertion, WSSSecurityProperties securityProperties) throws XMLSecurityException {
// First try to get the credential from a CallbackHandler
WSPasswordCallback passwordCallback = new WSPasswordCallback(assertion.getID(), WSPasswordCallback.Usage.SECRET_KEY);
- Utils.doSecretKeyCallback(securityProperties.getCallbackHandler(), passwordCallback, assertion.getID());
+ WSSUtils.doSecretKeyCallback(securityProperties.getCallbackHandler(), passwordCallback, assertion.getID());
final byte[] key = passwordCallback.getKey();
if (key != null && key.length > 0) {
return new SAMLKeyInfo(key);
@@ -648,7 +649,7 @@ public class SAMLAssertionWrapper {
Element sub = samlSubject.getSubjectConfirmation().getDOM();
Element keyInfoElement =
- XMLUtils.getDirectChildElement(sub, Constants.TAG_dsig_KeyInfo.getLocalPart(), Constants.TAG_dsig_KeyInfo.getNamespaceURI());
+ XMLUtils.getDirectChildElement(sub, WSSConstants.TAG_dsig_KeyInfo.getLocalPart(), WSSConstants.TAG_dsig_KeyInfo.getNamespaceURI());
if (keyInfoElement != null) {
return getCredentialFromKeyInfo(keyInfoElement, securityProperties);
}
@@ -666,10 +667,10 @@ public class SAMLAssertionWrapper {
* @return The SAMLKeyInfo object obtained from the Subject
* @throws WSSecurityException
*/
- public SAMLKeyInfo getCredentialFromSubject(org.opensaml.saml2.core.Assertion assertion, SecurityProperties securityProperties) throws WSSecurityException {
+ public SAMLKeyInfo getCredentialFromSubject(org.opensaml.saml2.core.Assertion assertion, WSSSecurityProperties securityProperties) throws XMLSecurityException {
// First try to get the credential from a CallbackHandler
WSPasswordCallback passwordCallback = new WSPasswordCallback(assertion.getID(), WSPasswordCallback.Usage.SECRET_KEY);
- Utils.doSecretKeyCallback(securityProperties.getCallbackHandler(), passwordCallback, assertion.getID());
+ WSSUtils.doSecretKeyCallback(securityProperties.getCallbackHandler(), passwordCallback, assertion.getID());
final byte[] key = passwordCallback.getKey();
if (key != null && key.length > 0) {
return new SAMLKeyInfo(key);
@@ -689,7 +690,7 @@ public class SAMLAssertionWrapper {
subjectConfirmation.getSubjectConfirmationData();
Element sub = subjConfData.getDOM();
Element keyInfoElement =
- XMLUtils.getDirectChildElement(sub, Constants.TAG_dsig_KeyInfo.getLocalPart(), Constants.TAG_dsig_KeyInfo.getNamespaceURI());
+ XMLUtils.getDirectChildElement(sub, WSSConstants.TAG_dsig_KeyInfo.getLocalPart(), WSSConstants.TAG_dsig_KeyInfo.getNamespaceURI());
if (keyInfoElement != null) {
return getCredentialFromKeyInfo(keyInfoElement, securityProperties);
}
@@ -706,7 +707,7 @@ public class SAMLAssertionWrapper {
* @return true if cert is in the keystore
* @throws WSSecurityException
*/
- protected boolean isCertificateInKeyStore(Crypto crypto, X509Certificate cert) throws WSSecurityException {
+ protected boolean isCertificateInKeyStore(Crypto crypto, X509Certificate cert) throws XMLSecurityException {
String issuerString = cert.getIssuerX500Principal().getName();
BigInteger issuerSerial = cert.getSerialNumber();
@@ -748,8 +749,7 @@ public class SAMLAssertionWrapper {
* @return true if the certificate is trusted, false if not
* @throws WSSecurityException
*/
- protected boolean verifyTrustInCert(X509Certificate cert, Crypto crypto)
- throws WSSecurityException {
+ protected boolean verifyTrustInCert(X509Certificate cert, Crypto crypto) throws XMLSecurityException {
String subjectString = cert.getSubjectX500Principal().getName();
String issuerString = cert.getIssuerX500Principal().getName();
BigInteger issuerSerial = cert.getSerialNumber();
@@ -834,8 +834,7 @@ public class SAMLAssertionWrapper {
* @return true if the certificate chain is trusted, false if not
* @throws WSSecurityException
*/
- protected boolean verifyTrustInCerts(X509Certificate[] certificates, Crypto crypto)
- throws WSSecurityException {
+ protected boolean verifyTrustInCerts(X509Certificate[] certificates, Crypto crypto) throws XMLSecurityException {
//
// Use the validation method from the crypto to check whether the subjects'
// certificate was really signed by the issuer stated in the certificate
@@ -852,8 +851,7 @@ public class SAMLAssertionWrapper {
*
* @throws WSSecurityException
*/
- protected boolean validatePublicKey(PublicKey publicKey, Crypto crypto)
- throws WSSecurityException {
+ protected boolean validatePublicKey(PublicKey publicKey, Crypto crypto) throws XMLSecurityException {
return crypto.verifyTrust(publicKey);
}
}
Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/SAMLCallback.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/SAMLCallback.java?rev=1181995&r1=1179730&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/SAMLCallback.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/SAMLCallback.java Tue Oct 11 18:03:00 2011
@@ -17,11 +17,11 @@
* under the License.
*/
-package org.swssf.impl.saml;
+package org.swssf.wss.impl.saml;
import org.opensaml.common.SAMLVersion;
-import org.swssf.crypto.Crypto;
-import org.swssf.impl.saml.bean.*;
+import org.swssf.wss.impl.saml.bean.*;
+import org.swssf.xmlsec.crypto.Crypto;
import javax.security.auth.callback.Callback;
import java.util.ArrayList;
Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/SAMLKeyInfo.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/SAMLKeyInfo.java?rev=1181995&r1=1179730&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/SAMLKeyInfo.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/SAMLKeyInfo.java Tue Oct 11 18:03:00 2011
@@ -17,7 +17,7 @@
* under the License.
*/
-package org.swssf.impl.saml;
+package org.swssf.wss.impl.saml;
import java.security.PrivateKey;
import java.security.PublicKey;
Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/XMLUtils.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/XMLUtils.java?rev=1181995&r1=1179730&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/XMLUtils.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/XMLUtils.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.saml;
+package org.swssf.wss.impl.saml;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/bean/ActionBean.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/bean/ActionBean.java?rev=1181995&r1=1179730&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/bean/ActionBean.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/bean/ActionBean.java Tue Oct 11 18:03:00 2011
@@ -17,7 +17,7 @@
* under the License.
*/
-package org.swssf.impl.saml.bean;
+package org.swssf.wss.impl.saml.bean;
/**
Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/bean/AttributeBean.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/bean/AttributeBean.java?rev=1181995&r1=1179730&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/bean/AttributeBean.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/bean/AttributeBean.java Tue Oct 11 18:03:00 2011
@@ -17,7 +17,7 @@
* under the License.
*/
-package org.swssf.impl.saml.bean;
+package org.swssf.wss.impl.saml.bean;
import java.util.ArrayList;
import java.util.List;
Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/bean/AttributeStatementBean.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/bean/AttributeStatementBean.java?rev=1181995&r1=1179730&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/bean/AttributeStatementBean.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/bean/AttributeStatementBean.java Tue Oct 11 18:03:00 2011
@@ -17,7 +17,7 @@
* under the License.
*/
-package org.swssf.impl.saml.bean;
+package org.swssf.wss.impl.saml.bean;
import java.util.ArrayList;
import java.util.List;
Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/bean/AuthDecisionStatementBean.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/bean/AuthDecisionStatementBean.java?rev=1181995&r1=1179730&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/bean/AuthDecisionStatementBean.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/bean/AuthDecisionStatementBean.java Tue Oct 11 18:03:00 2011
@@ -17,7 +17,7 @@
* under the License.
*/
-package org.swssf.impl.saml.bean;
+package org.swssf.wss.impl.saml.bean;
import java.util.ArrayList;
import java.util.List;
Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/bean/AuthenticationStatementBean.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/bean/AuthenticationStatementBean.java?rev=1181995&r1=1179730&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/bean/AuthenticationStatementBean.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/bean/AuthenticationStatementBean.java Tue Oct 11 18:03:00 2011
@@ -17,7 +17,7 @@
* under the License.
*/
-package org.swssf.impl.saml.bean;
+package org.swssf.wss.impl.saml.bean;
import org.joda.time.DateTime;
Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/bean/ConditionsBean.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/bean/ConditionsBean.java?rev=1181995&r1=1179730&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/bean/ConditionsBean.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/bean/ConditionsBean.java Tue Oct 11 18:03:00 2011
@@ -17,7 +17,7 @@
* under the License.
*/
-package org.swssf.impl.saml.bean;
+package org.swssf.wss.impl.saml.bean;
import org.joda.time.DateTime;
Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/bean/KeyInfoBean.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/bean/KeyInfoBean.java?rev=1181995&r1=1179730&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/bean/KeyInfoBean.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/bean/KeyInfoBean.java Tue Oct 11 18:03:00 2011
@@ -17,7 +17,7 @@
* under the License.
*/
-package org.swssf.impl.saml.bean;
+package org.swssf.wss.impl.saml.bean;
import org.w3c.dom.Element;
Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/bean/SubjectBean.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/bean/SubjectBean.java?rev=1181995&r1=1179730&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/bean/SubjectBean.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/bean/SubjectBean.java Tue Oct 11 18:03:00 2011
@@ -17,7 +17,7 @@
* under the License.
*/
-package org.swssf.impl.saml.bean;
+package org.swssf.wss.impl.saml.bean;
/**
* Class SubjectBean represents a SAML subject (can be used to create
Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/builder/SAML1ComponentBuilder.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/builder/SAML1ComponentBuilder.java?rev=1181995&r1=1179730&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/builder/SAML1ComponentBuilder.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/builder/SAML1ComponentBuilder.java Tue Oct 11 18:03:00 2011
@@ -17,7 +17,7 @@
* under the License.
*/
-package org.swssf.impl.saml.builder;
+package org.swssf.wss.impl.saml.builder;
import org.joda.time.DateTime;
import org.opensaml.Configuration;
@@ -30,9 +30,9 @@ import org.opensaml.xml.schema.impl.XSSt
import org.opensaml.xml.security.x509.BasicX509Credential;
import org.opensaml.xml.security.x509.X509KeyInfoGeneratorFactory;
import org.opensaml.xml.signature.KeyInfo;
-import org.swssf.ext.WSSecurityException;
-import org.swssf.impl.saml.OpenSAMLUtil;
-import org.swssf.impl.saml.bean.*;
+import org.swssf.wss.ext.WSSecurityException;
+import org.swssf.wss.impl.saml.OpenSAMLUtil;
+import org.swssf.wss.impl.saml.bean.*;
import java.util.ArrayList;
import java.util.List;
Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/builder/SAML1Constants.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/builder/SAML1Constants.java?rev=1181995&r1=1179730&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/builder/SAML1Constants.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/builder/SAML1Constants.java Tue Oct 11 18:03:00 2011
@@ -17,7 +17,7 @@
* under the License.
*/
-package org.swssf.impl.saml.builder;
+package org.swssf.wss.impl.saml.builder;
/**
Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/builder/SAML2ComponentBuilder.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/builder/SAML2ComponentBuilder.java?rev=1181995&r1=1179730&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/builder/SAML2ComponentBuilder.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/builder/SAML2ComponentBuilder.java Tue Oct 11 18:03:00 2011
@@ -17,7 +17,7 @@
* under the License.
*/
-package org.swssf.impl.saml.builder;
+package org.swssf.wss.impl.saml.builder;
import org.joda.time.DateTime;
import org.opensaml.Configuration;
@@ -28,8 +28,8 @@ import org.opensaml.xml.XMLObjectBuilder
import org.opensaml.xml.schema.XSString;
import org.opensaml.xml.schema.impl.XSStringBuilder;
import org.opensaml.xml.signature.KeyInfo;
-import org.swssf.ext.WSSecurityException;
-import org.swssf.impl.saml.bean.*;
+import org.swssf.wss.ext.WSSecurityException;
+import org.swssf.wss.impl.saml.bean.*;
import java.util.ArrayList;
import java.util.List;
Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/builder/SAML2Constants.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/builder/SAML2Constants.java?rev=1181995&r1=1179730&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/builder/SAML2Constants.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/builder/SAML2Constants.java Tue Oct 11 18:03:00 2011
@@ -17,7 +17,7 @@
* under the License.
*/
-package org.swssf.impl.saml.builder;
+package org.swssf.wss.impl.saml.builder;
/**
Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/securityToken/AbstractAlgorithmSuiteSecurityEventFiringSecurityToken.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/securityToken/AbstractAlgorithmSuiteSecurityEventFiringSecurityToken.java?rev=1181995&r1=1179730&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/securityToken/AbstractAlgorithmSuiteSecurityEventFiringSecurityToken.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/securityToken/AbstractAlgorithmSuiteSecurityEventFiringSecurityToken.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,14 +16,15 @@
* 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.securityEvent.AlgorithmSuiteSecurityEvent;
-import org.swssf.securityEvent.SecurityEvent;
+import org.swssf.wss.ext.WSSecurityContext;
+import org.swssf.wss.securityEvent.AlgorithmSuiteSecurityEvent;
+import org.swssf.wss.securityEvent.SecurityEvent;
+import org.swssf.xmlsec.crypto.Crypto;
+import org.swssf.xmlsec.ext.SecurityContext;
+import org.swssf.xmlsec.ext.XMLSecurityConstants;
+import org.swssf.xmlsec.ext.XMLSecurityException;
import javax.security.auth.callback.CallbackHandler;
import java.security.Key;
@@ -39,7 +40,7 @@ public abstract class AbstractAlgorithmS
private boolean fireSecretKeySecurityEvent = true;
private boolean firePublicKeySecurityEvent = true;
- private Map<String, Constants.KeyUsage> firedSecretKeyAlgorithmEvents = new HashMap<String, Constants.KeyUsage>();
+ private Map<String, XMLSecurityConstants.KeyUsage> firedSecretKeyAlgorithmEvents = new HashMap<String, XMLSecurityConstants.KeyUsage>();
private SecurityContext securityContext;
@@ -58,21 +59,21 @@ public abstract class AbstractAlgorithmS
this.securityContext = securityContext;
}
- public Key getSecretKey(String algorithmURI, Constants.KeyUsage keyUsage) throws WSSecurityException {
+ public Key getSecretKey(String algorithmURI, XMLSecurityConstants.KeyUsage keyUsage) throws XMLSecurityException {
if (fireSecretKeySecurityEvent) {
- Constants.KeyUsage firedKeyUsage = firedSecretKeyAlgorithmEvents.get(algorithmURI);
- if (keyUsage == null || firedKeyUsage != keyUsage) {
+ XMLSecurityConstants.KeyUsage firedKeyUsage = firedSecretKeyAlgorithmEvents.get(algorithmURI);
+ if (keyUsage == null || !keyUsage.equals(firedKeyUsage)) {
AlgorithmSuiteSecurityEvent algorithmSuiteSecurityEvent = new AlgorithmSuiteSecurityEvent(SecurityEvent.Event.AlgorithmSuite);
algorithmSuiteSecurityEvent.setAlgorithmURI(algorithmURI);
algorithmSuiteSecurityEvent.setKeyUsage(keyUsage);
- securityContext.registerSecurityEvent(algorithmSuiteSecurityEvent);
+ ((WSSecurityContext) securityContext).registerSecurityEvent(algorithmSuiteSecurityEvent);
firedSecretKeyAlgorithmEvents.put(algorithmURI, keyUsage);
}
}
return null;
}
- public PublicKey getPublicKey(Constants.KeyUsage keyUsage) throws WSSecurityException {
+ public PublicKey getPublicKey(XMLSecurityConstants.KeyUsage keyUsage) throws XMLSecurityException {
return null;
}
}
Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/securityToken/AbstractSecurityToken.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/securityToken/AbstractSecurityToken.java?rev=1181995&r1=1179730&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/securityToken/AbstractSecurityToken.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/securityToken/AbstractSecurityToken.java Tue Oct 11 18:03:00 2011
@@ -16,11 +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.SecurityToken;
-import org.swssf.ext.WSSecurityException;
+import org.swssf.xmlsec.crypto.Crypto;
+import org.swssf.xmlsec.ext.SecurityToken;
+import org.swssf.xmlsec.ext.XMLSecurityException;
import javax.security.auth.callback.CallbackHandler;
import java.security.cert.X509Certificate;
@@ -63,10 +63,10 @@ public abstract class AbstractSecurityTo
return callbackHandler;
}
- public X509Certificate[] getX509Certificates() throws WSSecurityException {
+ public X509Certificate[] getX509Certificates() throws XMLSecurityException {
return null;
}
- public void verify() throws WSSecurityException {
+ public void verify() throws XMLSecurityException {
}
}
Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/securityToken/DelegatingSecurityToken.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/securityToken/DelegatingSecurityToken.java?rev=1181995&r1=1179730&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/securityToken/DelegatingSecurityToken.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/securityToken/DelegatingSecurityToken.java Tue Oct 11 18:03:00 2011
@@ -16,11 +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.ext.Constants;
-import org.swssf.ext.SecurityToken;
-import org.swssf.ext.WSSecurityException;
+import org.swssf.wss.ext.WSSConstants;
+import org.swssf.xmlsec.ext.SecurityToken;
+import org.swssf.xmlsec.ext.XMLSecurityConstants;
+import org.swssf.xmlsec.ext.XMLSecurityException;
import java.security.Key;
import java.security.PublicKey;
@@ -35,15 +36,15 @@ import java.security.cert.X509Certificat
*/
public class DelegatingSecurityToken implements SecurityToken {
- private Constants.KeyIdentifierType keyIdentifierType;
+ private WSSConstants.KeyIdentifierType keyIdentifierType;
private SecurityToken securityToken;
- public DelegatingSecurityToken(Constants.KeyIdentifierType keyIdentifierType, SecurityToken securityToken) {
+ public DelegatingSecurityToken(WSSConstants.KeyIdentifierType keyIdentifierType, SecurityToken securityToken) {
this.keyIdentifierType = keyIdentifierType;
this.securityToken = securityToken;
}
- public Constants.KeyIdentifierType getKeyIdentifierType() {
+ public WSSConstants.KeyIdentifierType getKeyIdentifierType() {
return keyIdentifierType;
}
@@ -63,19 +64,19 @@ public class DelegatingSecurityToken imp
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();
}
@@ -87,7 +88,7 @@ public class DelegatingSecurityToken imp
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/HttpsSecurityToken.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/securityToken/HttpsSecurityToken.java?rev=1181995&r1=1179730&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/securityToken/HttpsSecurityToken.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/securityToken/HttpsSecurityToken.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,11 +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.ext.Constants;
-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.ext.SecurityToken;
+import org.swssf.xmlsec.ext.XMLSecurityConstants;
import java.security.Key;
import java.security.PublicKey;
@@ -67,11 +68,11 @@ public class HttpsSecurityToken extends
return true;
}
- public Key getSecretKey(String algorithmURI, Constants.KeyUsage keyUsage) throws WSSecurityException {
+ public Key getSecretKey(String algorithmURI, XMLSecurityConstants.KeyUsage keyUsage) throws WSSecurityException {
return null;
}
- public PublicKey getPublicKey(Constants.KeyUsage keyUsage) throws WSSecurityException {
+ public PublicKey getPublicKey(XMLSecurityConstants.KeyUsage keyUsage) throws WSSecurityException {
if (x509Certificate != null) {
return x509Certificate.getPublicKey();
}
@@ -86,7 +87,7 @@ public class HttpsSecurityToken extends
return null;
}
- public Constants.TokenType getTokenType() {
- return Constants.TokenType.HttpsToken;
+ public WSSConstants.TokenType getTokenType() {
+ return WSSConstants.HttpsToken;
}
}
Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/securityToken/ProcessorInfoSecurityToken.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/securityToken/ProcessorInfoSecurityToken.java?rev=1181995&r1=1179730&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/securityToken/ProcessorInfoSecurityToken.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/securityToken/ProcessorInfoSecurityToken.java Tue Oct 11 18:03:00 2011
@@ -16,10 +16,10 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.swssf.impl.securityToken;
+package org.swssf.wss.impl.securityToken;
-import org.swssf.ext.OutputProcessor;
-import org.swssf.ext.SecurityToken;
+import org.swssf.xmlsec.ext.OutputProcessor;
+import org.swssf.xmlsec.ext.SecurityToken;
/**
* @author $Author$
Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/securityToken/SAMLSecurityToken.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/securityToken/SAMLSecurityToken.java?rev=1181995&r1=1179730&r2=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/securityToken/SAMLSecurityToken.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/securityToken/SAMLSecurityToken.java Tue Oct 11 18:03:00 2011
@@ -16,15 +16,16 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.swssf.impl.securityToken;
+package org.swssf.wss.impl.securityToken;
import org.opensaml.common.SAMLVersion;
-import org.swssf.crypto.Crypto;
-import org.swssf.ext.Constants;
-import org.swssf.ext.SecurityContext;
-import org.swssf.ext.SecurityToken;
-import org.swssf.ext.WSSecurityException;
-import org.swssf.impl.saml.SAMLKeyInfo;
+import org.swssf.wss.ext.WSSConstants;
+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.XMLSecurityConstants;
+import org.swssf.xmlsec.ext.XMLSecurityException;
import javax.security.auth.callback.CallbackHandler;
import java.security.Key;
@@ -53,12 +54,12 @@ public class SAMLSecurityToken extends A
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);
return samlKeyInfo.getPrivateKey();
}
- public PublicKey getPublicKey(Constants.KeyUsage keyUsage) throws WSSecurityException {
+ public PublicKey getPublicKey(XMLSecurityConstants.KeyUsage keyUsage) throws XMLSecurityException {
super.getPublicKey(keyUsage);
PublicKey publicKey = samlKeyInfo.getPublicKey();
if (publicKey == null) {
@@ -67,14 +68,14 @@ public class SAMLSecurityToken extends A
return publicKey;
}
- public X509Certificate[] getX509Certificates() throws WSSecurityException {
+ public X509Certificate[] getX509Certificates() throws XMLSecurityException {
if (this.x509Certificate == null) {
this.x509Certificate = samlKeyInfo.getCerts();
}
return this.x509Certificate;
}
- public void verify() throws WSSecurityException {
+ public void verify() throws XMLSecurityException {
try {
X509Certificate[] x509Certificates = getX509Certificates();
if (x509Certificates != null && x509Certificates.length > 0) {
@@ -82,9 +83,9 @@ public class SAMLSecurityToken extends A
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);
}
}
@@ -96,13 +97,13 @@ public class SAMLSecurityToken extends A
return null;
}
- public Constants.TokenType getTokenType() {
+ public XMLSecurityConstants.TokenType getTokenType() {
if (samlVersion == SAMLVersion.VERSION_10) {
- return Constants.TokenType.Saml10Token;
+ return WSSConstants.Saml10Token;
} else if (samlVersion == SAMLVersion.VERSION_11) {
- return Constants.TokenType.Saml11Token;
+ return WSSConstants.Saml11Token;
}
- return Constants.TokenType.Saml20Token;
+ return WSSConstants.Saml20Token;
}
public SAMLKeyInfo getSamlKeyInfo() {