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 2017/02/13 11:20:05 UTC
svn commit: r1782748 [8/9] - in /webservices/wss4j/trunk:
bindings/src/main/java/org/apache/wss4j/binding/wssc200502/
policy/src/main/java/org/apache/wss4j/policy/builders/
policy/src/main/java/org/apache/wss4j/policy/model/
ws-security-common/src/main...
Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/BinarySecurityTokenOutputProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/BinarySecurityTokenOutputProcessor.java?rev=1782748&r1=1782747&r2=1782748&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/BinarySecurityTokenOutputProcessor.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/BinarySecurityTokenOutputProcessor.java Mon Feb 13 11:20:02 2017
@@ -48,7 +48,7 @@ public class BinarySecurityTokenOutputPr
}
@Override
- public void processEvent(XMLSecEvent xmlSecEvent, OutputProcessorChain outputProcessorChain)
+ public void processEvent(XMLSecEvent xmlSecEvent, OutputProcessorChain outputProcessorChain)
throws XMLStreamException, XMLSecurityException {
try {
GenericOutboundSecurityToken securityToken = null;
@@ -88,9 +88,9 @@ public class BinarySecurityTokenOutputPr
if (securityToken != null) {
if (WSSConstants.SIGNATURE.equals(action)
&& (includeToken || WSSecurityTokenConstants.KEYIDENTIFIER_SECURITY_TOKEN_DIRECT_REFERENCE.equals(keyIdentifier))
- && (securityToken.getTokenType() == null
+ && (securityToken.getTokenType() == null
|| WSSecurityTokenConstants.X509V3Token.equals(securityToken.getTokenType()))) {
- FinalBinarySecurityTokenOutputProcessor finalBinarySecurityTokenOutputProcessor =
+ FinalBinarySecurityTokenOutputProcessor finalBinarySecurityTokenOutputProcessor =
new FinalBinarySecurityTokenOutputProcessor(securityToken);
finalBinarySecurityTokenOutputProcessor.setXMLSecurityProperties(getSecurityProperties());
finalBinarySecurityTokenOutputProcessor.setAction(getAction());
@@ -98,9 +98,9 @@ public class BinarySecurityTokenOutputPr
finalBinarySecurityTokenOutputProcessor.init(outputProcessorChain);
securityToken.setProcessor(finalBinarySecurityTokenOutputProcessor);
} else if (WSSConstants.SAML_TOKEN_SIGNED.equals(action) && includeToken
- && (securityToken.getTokenType() == null
+ && (securityToken.getTokenType() == null
|| WSSecurityTokenConstants.X509V3Token.equals(securityToken.getTokenType()))) {
- FinalBinarySecurityTokenOutputProcessor finalBinarySecurityTokenOutputProcessor =
+ FinalBinarySecurityTokenOutputProcessor finalBinarySecurityTokenOutputProcessor =
new FinalBinarySecurityTokenOutputProcessor(securityToken);
finalBinarySecurityTokenOutputProcessor.setXMLSecurityProperties(getSecurityProperties());
finalBinarySecurityTokenOutputProcessor.setAction(getAction());
@@ -109,9 +109,9 @@ public class BinarySecurityTokenOutputPr
securityToken.setProcessor(finalBinarySecurityTokenOutputProcessor);
} else if (WSSConstants.ENCRYPT.equals(action)
&& (includeToken || WSSecurityTokenConstants.KEYIDENTIFIER_SECURITY_TOKEN_DIRECT_REFERENCE.equals(keyIdentifier))
- && (securityToken.getTokenType() == null
+ && (securityToken.getTokenType() == null
|| WSSecurityTokenConstants.X509V3Token.equals(securityToken.getTokenType()))) {
- FinalBinarySecurityTokenOutputProcessor finalBinarySecurityTokenOutputProcessor =
+ FinalBinarySecurityTokenOutputProcessor finalBinarySecurityTokenOutputProcessor =
new FinalBinarySecurityTokenOutputProcessor(securityToken);
finalBinarySecurityTokenOutputProcessor.setXMLSecurityProperties(getSecurityProperties());
finalBinarySecurityTokenOutputProcessor.setAction(getAction());
@@ -121,7 +121,7 @@ public class BinarySecurityTokenOutputPr
} else if (WSSConstants.ENCRYPT_WITH_KERBEROS_TOKEN.equals(getAction())
|| WSSConstants.SIGNATURE_WITH_KERBEROS_TOKEN.equals(getAction())
|| WSSConstants.KERBEROS_TOKEN.equals(getAction())) {
- FinalBinarySecurityTokenOutputProcessor finalBinarySecurityTokenOutputProcessor =
+ FinalBinarySecurityTokenOutputProcessor finalBinarySecurityTokenOutputProcessor =
new FinalBinarySecurityTokenOutputProcessor(securityToken);
finalBinarySecurityTokenOutputProcessor.setXMLSecurityProperties(getSecurityProperties());
finalBinarySecurityTokenOutputProcessor.setAction(getAction());
@@ -163,7 +163,7 @@ public class BinarySecurityTokenOutputPr
OutputProcessorUtils.updateSecurityHeaderOrder(
outputProcessorChain, headerElementName, getAction(), false);
OutputProcessorChain subOutputProcessorChain = outputProcessorChain.createSubChain(this);
-
+
List<XMLSecAttribute> attributes = new ArrayList<>(3);
attributes.add(createAttribute(WSSConstants.ATT_NULL_ENCODING_TYPE, WSSConstants.SOAPMESSAGE_NS10_BASE64_ENCODING));
attributes.add(createAttribute(WSSConstants.ATT_NULL_VALUE_TYPE, WSSConstants.NS_GSS_KERBEROS5_AP_REQ));
@@ -175,7 +175,7 @@ public class BinarySecurityTokenOutputPr
);
createEndElementAndOutputAsEvent(subOutputProcessorChain, headerElementName);
if (WSSConstants.ENCRYPT_WITH_KERBEROS_TOKEN.equals(getAction())) {
- OutputProcessorUtils.updateSecurityHeaderOrder(outputProcessorChain, WSSConstants.TAG_xenc_ReferenceList,
+ OutputProcessorUtils.updateSecurityHeaderOrder(outputProcessorChain, WSSConstants.TAG_xenc_ReferenceList,
getAction(), false);
WSSUtils.createReferenceListStructureForEncryption(this, subOutputProcessorChain);
}
@@ -184,7 +184,7 @@ public class BinarySecurityTokenOutputPr
OutputProcessorUtils.updateSecurityHeaderOrder(
outputProcessorChain, headerElementName, getAction(), false);
OutputProcessorChain subOutputProcessorChain = outputProcessorChain.createSubChain(this);
-
+
boolean useSingleCertificate = getSecurityProperties().isUseSingleCert();
WSSUtils.createBinarySecurityTokenStructure(
this, subOutputProcessorChain, securityToken.getId(),
Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/CustomTokenOutputProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/CustomTokenOutputProcessor.java?rev=1782748&r1=1782747&r2=1782748&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/CustomTokenOutputProcessor.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/CustomTokenOutputProcessor.java Mon Feb 13 11:20:02 2017
@@ -50,7 +50,7 @@ public class CustomTokenOutputProcessor
}
@Override
- public void processEvent(XMLSecEvent xmlSecEvent, OutputProcessorChain outputProcessorChain)
+ public void processEvent(XMLSecEvent xmlSecEvent, OutputProcessorChain outputProcessorChain)
throws XMLStreamException, XMLSecurityException {
try {
String tokenId = outputProcessorChain.getSecurityContext().get(WSSConstants.PROP_USE_THIS_TOKEN_ID_FOR_CUSTOM_TOKEN);
Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/DerivedKeyTokenOutputProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/DerivedKeyTokenOutputProcessor.java?rev=1782748&r1=1782747&r2=1782748&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/DerivedKeyTokenOutputProcessor.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/DerivedKeyTokenOutputProcessor.java Mon Feb 13 11:20:02 2017
@@ -57,7 +57,7 @@ public class DerivedKeyTokenOutputProces
}
@Override
- public void processEvent(XMLSecEvent xmlSecEvent, OutputProcessorChain outputProcessorChain)
+ public void processEvent(XMLSecEvent xmlSecEvent, OutputProcessorChain outputProcessorChain)
throws XMLStreamException, XMLSecurityException {
try {
@@ -65,7 +65,7 @@ public class DerivedKeyTokenOutputProces
if (tokenId == null) {
throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE);
}
- SecurityTokenProvider<OutboundSecurityToken> wrappingSecurityTokenProvider =
+ SecurityTokenProvider<OutboundSecurityToken> wrappingSecurityTokenProvider =
outputProcessorChain.getSecurityContext().getSecurityTokenProvider(tokenId);
if (wrappingSecurityTokenProvider == null) {
throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE);
@@ -95,7 +95,7 @@ public class DerivedKeyTokenOutputProces
}
}
- String defaultLabel =
+ String defaultLabel =
WSSConstants.WS_SEC_CONV_DEFAULT_LABEL + WSSConstants.WS_SEC_CONV_DEFAULT_LABEL;
byte[] label = defaultLabel.getBytes(StandardCharsets.UTF_8);
@@ -111,7 +111,7 @@ public class DerivedKeyTokenOutputProces
byte[] secret;
if (WSSecurityTokenConstants.SECURITY_CONTEXT_TOKEN.equals(wrappingSecurityToken.getTokenType())) {
WSPasswordCallback passwordCallback = new WSPasswordCallback(wsuIdDKT, WSPasswordCallback.SECRET_KEY);
- WSSUtils.doSecretKeyCallback(((WSSSecurityProperties)securityProperties).getCallbackHandler(),
+ WSSUtils.doSecretKeyCallback(((WSSSecurityProperties)securityProperties).getCallbackHandler(),
passwordCallback, wsuIdDKT);
if (passwordCallback.getKey() == null) {
throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "noKey",
@@ -170,7 +170,7 @@ public class DerivedKeyTokenOutputProces
}
outputProcessorChain.getSecurityContext().registerSecurityTokenProvider(wsuIdDKT, derivedKeysecurityTokenProvider);
FinalDerivedKeyTokenOutputProcessor finalDerivedKeyTokenOutputProcessor =
- new FinalDerivedKeyTokenOutputProcessor(derivedKeySecurityToken, offset, length,
+ new FinalDerivedKeyTokenOutputProcessor(derivedKeySecurityToken, offset, length,
new String(Base64.encodeBase64(nonce)),
((WSSSecurityProperties)getSecurityProperties()).isUse200512Namespace(),
wrappingSecurityToken.getSha1Identifier());
Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/EncryptOutputProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/EncryptOutputProcessor.java?rev=1782748&r1=1782747&r2=1782748&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/EncryptOutputProcessor.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/EncryptOutputProcessor.java Mon Feb 13 11:20:02 2017
@@ -86,7 +86,7 @@ public class EncryptOutputProcessor exte
}
@Override
- public void processEvent(XMLSecEvent xmlSecEvent, OutputProcessorChain outputProcessorChain)
+ public void processEvent(XMLSecEvent xmlSecEvent, OutputProcessorChain outputProcessorChain)
throws XMLStreamException, XMLSecurityException {
if (xmlSecEvent.getEventType() == XMLStreamConstants.START_ELEMENT) {
XMLSecStartElement xmlSecStartElement = xmlSecEvent.asStartElement();
@@ -98,7 +98,7 @@ public class EncryptOutputProcessor exte
LOG.debug("Matched encryptionPart for encryption");
InternalEncryptionOutputProcessor internalEncryptionOutputProcessor;
String tokenId = outputProcessorChain.getSecurityContext().get(WSSConstants.PROP_USE_THIS_TOKEN_ID_FOR_ENCRYPTION);
- SecurityTokenProvider<OutboundSecurityToken> securityTokenProvider =
+ SecurityTokenProvider<OutboundSecurityToken> securityTokenProvider =
outputProcessorChain.getSecurityContext().getSecurityTokenProvider(tokenId);
OutboundSecurityToken securityToken = securityTokenProvider.getSecurityToken();
EncryptionPartDef encryptionPartDef = new EncryptionPartDef();
@@ -195,7 +195,7 @@ public class EncryptOutputProcessor exte
SecurePart attachmentSecurePart = null;
- Map<Object, SecurePart> dynamicSecureParts =
+ Map<Object, SecurePart> dynamicSecureParts =
outputProcessorChain.getSecurityContext().getAsMap(XMLSecurityConstants.ENCRYPTION_PARTS);
Iterator<Map.Entry<Object, SecurePart>> securePartsMapIterator = dynamicSecureParts.entrySet().iterator();
String externalId = "";
@@ -265,10 +265,10 @@ public class EncryptOutputProcessor exte
Cipher cipher = null;
try {
cipher = Cipher.getInstance(jceAlgorithm);
-
+
int ivLen = JCEMapper.getIVLengthFromURI(encryptionSymAlgorithm) / 8;
byte[] iv = XMLSecurityConstants.generateBytes(ivLen);
- AlgorithmParameterSpec paramSpec =
+ AlgorithmParameterSpec paramSpec =
XMLCipherUtil.constructBlockCipherParameters(encryptionSymAlgorithm, iv, this.getClass());
cipher.init(Cipher.ENCRYPT_MODE, encryptionPartDef.getSymmetricKey(), paramSpec);
@@ -340,7 +340,7 @@ public class EncryptOutputProcessor exte
* Creates the Data structure around the cipher data
*/
@Override
- protected void processEventInternal(XMLSecStartElement xmlSecStartElement, OutputProcessorChain outputProcessorChain)
+ protected void processEventInternal(XMLSecStartElement xmlSecStartElement, OutputProcessorChain outputProcessorChain)
throws XMLStreamException, XMLSecurityException {
List<QName> elementPath = xmlSecStartElement.getElementPath();
@@ -361,7 +361,7 @@ public class EncryptOutputProcessor exte
attributes.add(createAttribute(WSSConstants.ATT_SOAP12_ROLE, actor));
}
}
-
+
boolean mustUnderstand = ((WSSSecurityProperties) getSecurityProperties()).isMustUnderstand();
if (mustUnderstand) {
if (WSSConstants.NS_SOAP11.equals(soapMessageVersion)) {
@@ -370,7 +370,7 @@ public class EncryptOutputProcessor exte
attributes.add(createAttribute(WSSConstants.ATT_SOAP12_MUST_UNDERSTAND, "true"));
}
}
-
+
createStartElementAndOutputAsEvent(outputProcessorChain, WSSConstants.TAG_wsse11_EncryptedHeader, true, attributes);
}
@@ -378,7 +378,7 @@ public class EncryptOutputProcessor exte
}
@Override
- protected void createKeyInfoStructure(OutputProcessorChain outputProcessorChain)
+ protected void createKeyInfoStructure(OutputProcessorChain outputProcessorChain)
throws XMLStreamException, XMLSecurityException {
createStartElementAndOutputAsEvent(outputProcessorChain, XMLSecurityConstants.TAG_dsig_KeyInfo, true, null);
@@ -392,23 +392,23 @@ public class EncryptOutputProcessor exte
if (WSSecurityTokenConstants.KEYIDENTIFIER_ENCRYPTED_KEY_SHA1_IDENTIFIER.equals(keyIdentifier)) {
List<XMLSecAttribute> attributes = new ArrayList<>(1);
attributes.add(createAttribute(WSSConstants.ATT_WSSE11_TOKEN_TYPE, WSSConstants.NS_WSS_ENC_KEY_VALUE_TYPE));
- createStartElementAndOutputAsEvent(outputProcessorChain, WSSConstants.TAG_WSSE_SECURITY_TOKEN_REFERENCE,
+ createStartElementAndOutputAsEvent(outputProcessorChain, WSSConstants.TAG_WSSE_SECURITY_TOKEN_REFERENCE,
false, attributes);
if (securityToken.getSha1Identifier() != null) {
- WSSUtils.createEncryptedKeySha1IdentifierStructure(this, outputProcessorChain,
+ WSSUtils.createEncryptedKeySha1IdentifierStructure(this, outputProcessorChain,
securityToken.getSha1Identifier());
} else {
- WSSUtils.createEncryptedKeySha1IdentifierStructure(this, outputProcessorChain,
+ WSSUtils.createEncryptedKeySha1IdentifierStructure(this, outputProcessorChain,
getEncryptionPartDef().getSymmetricKey());
}
} else if (WSSecurityTokenConstants.KEYIDENTIFIER_KERBEROS_SHA1_IDENTIFIER.equals(keyIdentifier)) {
List<XMLSecAttribute> attributes = new ArrayList<>(1);
attributes.add(createAttribute(WSSConstants.ATT_WSSE11_TOKEN_TYPE, WSSConstants.NS_KERBEROS5_AP_REQ));
- createStartElementAndOutputAsEvent(outputProcessorChain, WSSConstants.TAG_WSSE_SECURITY_TOKEN_REFERENCE,
+ createStartElementAndOutputAsEvent(outputProcessorChain, WSSConstants.TAG_WSSE_SECURITY_TOKEN_REFERENCE,
false, attributes);
- WSSUtils.createKerberosSha1IdentifierStructure(this, outputProcessorChain,
+ WSSUtils.createKerberosSha1IdentifierStructure(this, outputProcessorChain,
securityToken.getSha1Identifier());
} else {
boolean isSAMLToken = false;
@@ -416,37 +416,37 @@ public class EncryptOutputProcessor exte
List<XMLSecAttribute> attributes = new ArrayList<>(2);
attributes.add(createAttribute(WSSConstants.ATT_WSU_ID, IDGenerator.generateID(null)));
attributes.add(createAttribute(WSSConstants.ATT_WSSE11_TOKEN_TYPE, WSSConstants.NS_GSS_KERBEROS5_AP_REQ));
- createStartElementAndOutputAsEvent(outputProcessorChain, WSSConstants.TAG_WSSE_SECURITY_TOKEN_REFERENCE,
+ createStartElementAndOutputAsEvent(outputProcessorChain, WSSConstants.TAG_WSSE_SECURITY_TOKEN_REFERENCE,
false, attributes);
} else if (WSSecurityTokenConstants.SAML_10_TOKEN.equals(securityToken.getTokenType())
|| WSSecurityTokenConstants.SAML_11_TOKEN.equals(securityToken.getTokenType())) {
List<XMLSecAttribute> attributes = new ArrayList<>(2);
attributes.add(createAttribute(WSSConstants.ATT_WSU_ID, IDGenerator.generateID(null)));
attributes.add(createAttribute(WSSConstants.ATT_WSSE11_TOKEN_TYPE, WSSConstants.NS_SAML11_TOKEN_PROFILE_TYPE));
- createStartElementAndOutputAsEvent(outputProcessorChain, WSSConstants.TAG_WSSE_SECURITY_TOKEN_REFERENCE,
+ createStartElementAndOutputAsEvent(outputProcessorChain, WSSConstants.TAG_WSSE_SECURITY_TOKEN_REFERENCE,
false, attributes);
isSAMLToken = true;
} else if (WSSecurityTokenConstants.SAML_20_TOKEN.equals(securityToken.getTokenType())) {
List<XMLSecAttribute> attributes = new ArrayList<>(2);
attributes.add(createAttribute(WSSConstants.ATT_WSU_ID, IDGenerator.generateID(null)));
attributes.add(createAttribute(WSSConstants.ATT_WSSE11_TOKEN_TYPE, WSSConstants.NS_SAML20_TOKEN_PROFILE_TYPE));
- createStartElementAndOutputAsEvent(outputProcessorChain, WSSConstants.TAG_WSSE_SECURITY_TOKEN_REFERENCE,
+ createStartElementAndOutputAsEvent(outputProcessorChain, WSSConstants.TAG_WSSE_SECURITY_TOKEN_REFERENCE,
false, attributes);
isSAMLToken = true;
} else if (WSSecurityTokenConstants.EncryptedKeyToken.equals(securityToken.getTokenType())) {
List<XMLSecAttribute> attributes = new ArrayList<>(2);
attributes.add(createAttribute(WSSConstants.ATT_WSU_ID, IDGenerator.generateID(null)));
attributes.add(createAttribute(WSSConstants.ATT_WSSE11_TOKEN_TYPE, WSSConstants.NS_WSS_ENC_KEY_VALUE_TYPE));
- createStartElementAndOutputAsEvent(outputProcessorChain, WSSConstants.TAG_WSSE_SECURITY_TOKEN_REFERENCE,
+ createStartElementAndOutputAsEvent(outputProcessorChain, WSSConstants.TAG_WSSE_SECURITY_TOKEN_REFERENCE,
false, attributes);
} else {
- createStartElementAndOutputAsEvent(outputProcessorChain, WSSConstants.TAG_WSSE_SECURITY_TOKEN_REFERENCE,
+ createStartElementAndOutputAsEvent(outputProcessorChain, WSSConstants.TAG_WSSE_SECURITY_TOKEN_REFERENCE,
true, null);
}
if (isSAMLToken) {
// Always use KeyIdentifier regardless of the configured KeyIdentifier value
- WSSUtils.createSAMLKeyIdentifierStructure(this, outputProcessorChain, securityToken.getTokenType(),
+ WSSUtils.createSAMLKeyIdentifierStructure(this, outputProcessorChain, securityToken.getTokenType(),
getEncryptionPartDef().getKeyId());
} else {
List<XMLSecAttribute> attributes = new ArrayList<>(1);
Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/EncryptedKeyOutputProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/EncryptedKeyOutputProcessor.java?rev=1782748&r1=1782747&r2=1782748&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/EncryptedKeyOutputProcessor.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/EncryptedKeyOutputProcessor.java Mon Feb 13 11:20:02 2017
@@ -66,7 +66,7 @@ public class EncryptedKeyOutputProcessor
}
@Override
- public void processEvent(XMLSecEvent xmlSecEvent, OutputProcessorChain outputProcessorChain)
+ public void processEvent(XMLSecEvent xmlSecEvent, OutputProcessorChain outputProcessorChain)
throws XMLStreamException, XMLSecurityException {
try {
@@ -106,7 +106,7 @@ public class EncryptedKeyOutputProcessor
boolean sharedToken = encTokenId.equals(sigTokenId);
- FinalEncryptedKeyOutputProcessor finalEncryptedKeyOutputProcessor =
+ FinalEncryptedKeyOutputProcessor finalEncryptedKeyOutputProcessor =
new FinalEncryptedKeyOutputProcessor(encryptedKeySecurityToken);
finalEncryptedKeyOutputProcessor.setXMLSecurityProperties(getSecurityProperties());
finalEncryptedKeyOutputProcessor.setAction(getAction());
@@ -119,7 +119,7 @@ public class EncryptedKeyOutputProcessor
finalEncryptedKeyOutputProcessor.addAfterProcessor(EncryptEndingOutputProcessor.class.getName());
//hint for the headerReordering processor where to place the EncryptedKey
- if (getSecurityProperties().getActions().indexOf(WSSConstants.ENCRYPT)
+ if (getSecurityProperties().getActions().indexOf(WSSConstants.ENCRYPT)
< getSecurityProperties().getActions().indexOf(WSSConstants.SIGNATURE)) {
finalEncryptedKeyOutputProcessor.addBeforeProcessor(WSSSignatureOutputProcessor.class.getName());
finalEncryptedKeyOutputProcessor.setAction(WSSConstants.SIGNATURE);
@@ -152,7 +152,7 @@ public class EncryptedKeyOutputProcessor
finalEncryptedKeyOutputProcessor.addAfterProcessor(EncryptEndingOutputProcessor.class.getName());
//hint for the headerReordering processor where to place the EncryptedKey
- if (getSecurityProperties().getActions().indexOf(WSSConstants.ENCRYPT_WITH_DERIVED_KEY)
+ if (getSecurityProperties().getActions().indexOf(WSSConstants.ENCRYPT_WITH_DERIVED_KEY)
< getSecurityProperties().getActions().indexOf(WSSConstants.SIGNATURE_WITH_DERIVED_KEY)) {
finalEncryptedKeyOutputProcessor.setAction(WSSConstants.SIGNATURE_WITH_DERIVED_KEY);
}
@@ -221,7 +221,7 @@ public class EncryptedKeyOutputProcessor
"failedCredentialLoad"
);
}
-
+
final String encryptionKeyTransportAlgorithm = getSecurityProperties().getEncryptionKeyTransportAlgorithm();
List<XMLSecAttribute> attributes = new ArrayList<>(1);
@@ -234,12 +234,12 @@ public class EncryptedKeyOutputProcessor
final String encryptionKeyTransportMGFAlgorithm = getSecurityProperties().getEncryptionKeyTransportMGFAlgorithm();
- if (XMLSecurityConstants.NS_XENC11_RSAOAEP.equals(encryptionKeyTransportAlgorithm)
+ if (XMLSecurityConstants.NS_XENC11_RSAOAEP.equals(encryptionKeyTransportAlgorithm)
|| XMLSecurityConstants.NS_XENC_RSAOAEPMGF1P.equals(encryptionKeyTransportAlgorithm)) {
byte[] oaepParams = getSecurityProperties().getEncryptionKeyTransportOAEPParams();
if (oaepParams != null) {
- createStartElementAndOutputAsEvent(subOutputProcessorChain, XMLSecurityConstants.TAG_xenc_OAEPparams,
+ createStartElementAndOutputAsEvent(subOutputProcessorChain, XMLSecurityConstants.TAG_xenc_OAEPparams,
false, null);
createCharactersAndOutputAsEvent(subOutputProcessorChain, Base64.encodeBase64String(oaepParams));
createEndElementAndOutputAsEvent(subOutputProcessorChain, XMLSecurityConstants.TAG_xenc_OAEPparams);
@@ -249,7 +249,7 @@ public class EncryptedKeyOutputProcessor
if (encryptionKeyTransportDigestAlgorithm != null) {
attributes = new ArrayList<>(1);
attributes.add(createAttribute(XMLSecurityConstants.ATT_NULL_Algorithm, encryptionKeyTransportDigestAlgorithm));
- createStartElementAndOutputAsEvent(subOutputProcessorChain, XMLSecurityConstants.TAG_dsig_DigestMethod,
+ createStartElementAndOutputAsEvent(subOutputProcessorChain, XMLSecurityConstants.TAG_dsig_DigestMethod,
true, attributes);
createEndElementAndOutputAsEvent(subOutputProcessorChain, XMLSecurityConstants.TAG_dsig_DigestMethod);
}
@@ -257,7 +257,7 @@ public class EncryptedKeyOutputProcessor
if (encryptionKeyTransportMGFAlgorithm != null) {
attributes = new ArrayList<>(1);
attributes.add(createAttribute(XMLSecurityConstants.ATT_NULL_Algorithm, encryptionKeyTransportMGFAlgorithm));
- createStartElementAndOutputAsEvent(subOutputProcessorChain, XMLSecurityConstants.TAG_xenc11_MGF,
+ createStartElementAndOutputAsEvent(subOutputProcessorChain, XMLSecurityConstants.TAG_xenc11_MGF,
true, attributes);
createEndElementAndOutputAsEvent(subOutputProcessorChain, XMLSecurityConstants.TAG_xenc11_MGF);
}
@@ -280,11 +280,11 @@ public class EncryptedKeyOutputProcessor
Cipher cipher = Cipher.getInstance(jceid);
AlgorithmParameterSpec algorithmParameterSpec = null;
- if (XMLSecurityConstants.NS_XENC11_RSAOAEP.equals(encryptionKeyTransportAlgorithm)
+ if (XMLSecurityConstants.NS_XENC11_RSAOAEP.equals(encryptionKeyTransportAlgorithm)
|| XMLSecurityConstants.NS_XENC_RSAOAEPMGF1P.equals(encryptionKeyTransportAlgorithm)) {
String jceDigestAlgorithm = "SHA-1";
- String encryptionKeyTransportDigestAlgorithm =
+ String encryptionKeyTransportDigestAlgorithm =
getSecurityProperties().getEncryptionKeyTransportDigestAlgorithm();
if (encryptionKeyTransportDigestAlgorithm != null) {
jceDigestAlgorithm = JCEAlgorithmMapper.translateURItoJCEID(encryptionKeyTransportDigestAlgorithm);
@@ -330,7 +330,7 @@ public class EncryptedKeyOutputProcessor
}
}
- createCharactersAndOutputAsEvent(subOutputProcessorChain,
+ createCharactersAndOutputAsEvent(subOutputProcessorChain,
new Base64(76, new byte[]{'\n'}).encodeToString(encryptedEphemeralKey));
} catch (NoSuchPaddingException | NoSuchAlgorithmException
@@ -361,14 +361,14 @@ public class EncryptedKeyOutputProcessor
outputDOMElement(securityToken.getCustomTokenReference(), outputProcessorChain);
return;
}
-
+
X509Certificate[] x509Certificates = securityToken.getKeyWrappingToken().getX509Certificates();
if ((x509Certificates == null || x509Certificates.length == 0)
&& securityToken.getKeyWrappingToken().getPublicKey() != null) {
- WSSUtils.createKeyValueTokenStructure(this, outputProcessorChain,
+ WSSUtils.createKeyValueTokenStructure(this, outputProcessorChain,
securityToken.getKeyWrappingToken().getPublicKey());
return;
- }
+ }
List<XMLSecAttribute> attributes = new ArrayList<>(2);
attributes.add(createAttribute(WSSConstants.ATT_WSU_ID, IDGenerator.generateID(null)));
Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/SAMLTokenOutputProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/SAMLTokenOutputProcessor.java?rev=1782748&r1=1782747&r2=1782748&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/SAMLTokenOutputProcessor.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/SAMLTokenOutputProcessor.java Mon Feb 13 11:20:02 2017
@@ -155,7 +155,7 @@ public class SAMLTokenOutputProcessor ex
finalSAMLTokenOutputProcessor = new FinalSAMLTokenOutputProcessor(null, samlAssertionWrapper,
securityTokenReferenceId, senderVouches, includeSTR);
- final SAMLSecurityTokenProvider securityTokenProvider =
+ final SAMLSecurityTokenProvider securityTokenProvider =
new SAMLSecurityTokenProvider(samlKeyInfo, samlCallback, tokenId, ref,
finalSAMLTokenOutputProcessor);
@@ -226,7 +226,7 @@ public class SAMLTokenOutputProcessor ex
}
outputProcessorChain.processEvent(xmlSecEvent);
}
-
+
private GenericOutboundSecurityToken getSecurityToken(SAMLCallback samlCallback,
OutputProcessorChain outputProcessorChain) throws WSSecurityException {
CryptoType cryptoType = new CryptoType(CryptoType.TYPE.ALIAS);
@@ -271,17 +271,17 @@ public class SAMLTokenOutputProcessor ex
}
};
- outputProcessorChain.getSecurityContext().registerSecurityTokenProvider(binarySecurityTokenId,
+ outputProcessorChain.getSecurityContext().registerSecurityTokenProvider(binarySecurityTokenId,
securityTokenProvider);
- outputProcessorChain.getSecurityContext().put(WSSConstants.PROP_USE_THIS_TOKEN_ID_FOR_SIGNATURE,
+ outputProcessorChain.getSecurityContext().put(WSSConstants.PROP_USE_THIS_TOKEN_ID_FOR_SIGNATURE,
binarySecurityTokenId);
return bstSecurityToken;
}
-
- private SAMLKeyInfo getSamlKeyInfo(SAMLCallback samlCallback)
+
+ private SAMLKeyInfo getSamlKeyInfo(SAMLCallback samlCallback)
throws WSSConfigurationException, WSSecurityException {
-
+
final SAMLKeyInfo samlKeyInfo = new SAMLKeyInfo();
SubjectBean subjectBean = samlCallback.getSubject();
@@ -317,10 +317,10 @@ public class SAMLTokenOutputProcessor ex
}
}
}
-
+
return samlKeyInfo;
}
-
+
private static class SAMLSecurityTokenProvider
implements SecurityTokenProvider<OutboundSecurityToken> {
@@ -330,7 +330,7 @@ public class SAMLTokenOutputProcessor ex
private String tokenId;
private Element ref;
private FinalSAMLTokenOutputProcessor finalSAMLTokenOutputProcessor;
-
+
SAMLSecurityTokenProvider(SAMLKeyInfo samlKeyInfo, SAMLCallback samlCallback, String tokenId,
Element ref, FinalSAMLTokenOutputProcessor finalSAMLTokenOutputProcessor) {
this.samlKeyInfo = samlKeyInfo;
@@ -339,14 +339,14 @@ public class SAMLTokenOutputProcessor ex
this.ref = ref;
this.finalSAMLTokenOutputProcessor = finalSAMLTokenOutputProcessor;
}
-
+
@Override
public OutboundSecurityToken getSecurityToken() throws XMLSecurityException {
-
+
if (this.samlSecurityToken != null) {
return this.samlSecurityToken;
}
-
+
WSSecurityTokenConstants.TokenType tokenType;
if (samlCallback.getSamlVersion() == SAMLVersion.VERSION_10) {
tokenType = WSSecurityTokenConstants.SAML_10_TOKEN;
@@ -361,10 +361,10 @@ public class SAMLTokenOutputProcessor ex
} else {
this.samlSecurityToken = new GenericOutboundSecurityToken(
tokenId, tokenType) {
-
+
@Override
public Key getSecretKey(String algorithmURI) throws WSSecurityException {
-
+
Key key;
try {
key = super.getSecretKey(algorithmURI);
@@ -387,7 +387,7 @@ public class SAMLTokenOutputProcessor ex
this.samlSecurityToken.setCustomTokenReference(ref);
return this.samlSecurityToken;
}
-
+
@Override
public String getId() {
return tokenId;
@@ -459,8 +459,8 @@ public class SAMLTokenOutputProcessor ex
}
private boolean includeBST() {
- if (senderVouches
- && getSecurityProperties().getSignatureKeyIdentifier()
+ if (senderVouches
+ && getSecurityProperties().getSignatureKeyIdentifier()
== WSSecurityTokenConstants.KEYIDENTIFIER_SECURITY_TOKEN_DIRECT_REFERENCE
&& securityToken != null
&& !(WSSConstants.SAML_TOKEN_SIGNED.equals(action)
Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/SecurityContextTokenOutputProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/SecurityContextTokenOutputProcessor.java?rev=1782748&r1=1782747&r2=1782748&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/SecurityContextTokenOutputProcessor.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/SecurityContextTokenOutputProcessor.java Mon Feb 13 11:20:02 2017
@@ -57,7 +57,7 @@ public class SecurityContextTokenOutputP
if (tokenId == null) {
throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE);
}
- SecurityTokenProvider<OutboundSecurityToken> wrappingSecurityTokenProvider =
+ SecurityTokenProvider<OutboundSecurityToken> wrappingSecurityTokenProvider =
outputProcessorChain.getSecurityContext().getSecurityTokenProvider(tokenId);
if (wrappingSecurityTokenProvider == null) {
throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE);
@@ -70,7 +70,7 @@ public class SecurityContextTokenOutputP
final String wsuId = IDGenerator.generateID(null);
final String identifier = IDGenerator.generateID(null);
- final GenericOutboundSecurityToken securityContextSecurityToken =
+ final GenericOutboundSecurityToken securityContextSecurityToken =
new GenericOutboundSecurityToken(wsuId, WSSecurityTokenConstants.SECURITY_CONTEXT_TOKEN) {
@Override
@@ -143,7 +143,7 @@ public class SecurityContextTokenOutputP
private final String identifier;
private final boolean use200512Namespace;
- FinalSecurityContextTokenOutputProcessor(OutboundSecurityToken securityToken, String identifier, boolean use200512Namespace)
+ FinalSecurityContextTokenOutputProcessor(OutboundSecurityToken securityToken, String identifier, boolean use200512Namespace)
throws XMLSecurityException {
super();
this.securityToken = securityToken;
Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/SecurityHeaderOutputProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/SecurityHeaderOutputProcessor.java?rev=1782748&r1=1782747&r2=1782748&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/SecurityHeaderOutputProcessor.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/SecurityHeaderOutputProcessor.java Mon Feb 13 11:20:02 2017
@@ -49,7 +49,7 @@ public class SecurityHeaderOutputProcess
}
@Override
- public void processEvent(XMLSecEvent xmlSecEvent, OutputProcessorChain outputProcessorChain)
+ public void processEvent(XMLSecEvent xmlSecEvent, OutputProcessorChain outputProcessorChain)
throws XMLStreamException, XMLSecurityException {
boolean eventHandled = false;
@@ -126,7 +126,7 @@ public class SecurityHeaderOutputProcess
//so output one and add securityHeader
//create subchain and output soap-header and securityHeader
- OutputProcessorChain subOutputProcessorChain =
+ OutputProcessorChain subOutputProcessorChain =
outputProcessorChain.createSubChain(this, xmlSecStartElement.getParentXMLSecStartElement());
createStartElementAndOutputAsEvent(subOutputProcessorChain,
new QName(soapMessageVersion, WSSConstants.TAG_SOAP_HEADER_LN, WSSConstants.PREFIX_SOAPENV), true, null);
@@ -146,7 +146,7 @@ public class SecurityHeaderOutputProcess
case XMLStreamConstants.END_ELEMENT:
XMLSecEndElement xmlSecEndElement = xmlSecEvent.asEndElement();
int documentLevel = xmlSecEndElement.getDocumentLevel();
- String soapMessageVersionNS =
+ String soapMessageVersionNS =
WSSUtils.getSOAPMessageVersionNamespace(xmlSecEndElement.getParentXMLSecStartElement());
if (documentLevel == 2 && WSSConstants.TAG_SOAP_HEADER_LN.equals(xmlSecEndElement.getName().getLocalPart())
&& xmlSecEndElement.getName().getNamespaceURI().equals(soapMessageVersionNS)) {
Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/SecurityHeaderReorderProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/SecurityHeaderReorderProcessor.java?rev=1782748&r1=1782747&r2=1782748&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/SecurityHeaderReorderProcessor.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/SecurityHeaderReorderProcessor.java Mon Feb 13 11:20:02 2017
@@ -87,11 +87,11 @@ public class SecurityHeaderReorderProces
}
@Override
- public void processEvent(XMLSecEvent xmlSecEvent, OutputProcessorChain outputProcessorChain)
+ public void processEvent(XMLSecEvent xmlSecEvent, OutputProcessorChain outputProcessorChain)
throws XMLStreamException, XMLSecurityException {
int documentLevel = xmlSecEvent.getDocumentLevel();
- if (documentLevel < 3
+ if (documentLevel < 3
|| !WSSUtils.isInSecurityHeader(xmlSecEvent, ((WSSSecurityProperties) getSecurityProperties()).getActor())) {
outputProcessorChain.processEvent(xmlSecEvent);
return;
@@ -103,7 +103,7 @@ public class SecurityHeaderReorderProces
if (xmlSecEvent.isEndElement() && xmlSecEvent.asEndElement().getName().equals(WSSConstants.TAG_WSSE_SECURITY)) {
OutputProcessorChain subOutputProcessorChain = outputProcessorChain.createSubChain(this);
- Iterator<Map.Entry<XMLSecurityConstants.Action, Map<SecurityHeaderOrder, Deque<XMLSecEvent>>>> iterator =
+ Iterator<Map.Entry<XMLSecurityConstants.Action, Map<SecurityHeaderOrder, Deque<XMLSecEvent>>>> iterator =
actionEventMap.entrySet().iterator();
loop:
while (iterator.hasNext()) {
@@ -158,15 +158,15 @@ public class SecurityHeaderReorderProces
case XMLStreamConstants.START_ELEMENT:
XMLSecStartElement xmlSecStartElement = xmlSecEvent.asStartElement();
- List<SecurityHeaderOrder> securityHeaderOrderList =
+ List<SecurityHeaderOrder> securityHeaderOrderList =
outputProcessorChain.getSecurityContext().getAsList(SecurityHeaderOrder.class);
SecurityHeaderOrder securityHeaderOrder = securityHeaderOrderList.get(securityHeaderIndex);
- if (!xmlSecStartElement.getName().equals(WSSConstants.TAG_xenc_EncryptedData)
+ if (!xmlSecStartElement.getName().equals(WSSConstants.TAG_xenc_EncryptedData)
&& !xmlSecStartElement.getName().equals(securityHeaderOrder.getSecurityHeaderElementName())) {
throw new WSSecurityException(
WSSecurityException.ErrorCode.FAILURE, "empty",
- new Object[] {"Invalid security header order. Expected "
- + securityHeaderOrder.getSecurityHeaderElementName()
+ new Object[] {"Invalid security header order. Expected "
+ + securityHeaderOrder.getSecurityHeaderElementName()
+ " but got " + xmlSecStartElement.getName()});
}
Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/SignatureConfirmationOutputProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/SignatureConfirmationOutputProcessor.java?rev=1782748&r1=1782747&r2=1782748&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/SignatureConfirmationOutputProcessor.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/SignatureConfirmationOutputProcessor.java Mon Feb 13 11:20:02 2017
@@ -71,7 +71,7 @@ public class SignatureConfirmationOutput
List<XMLSecAttribute> attributes = new ArrayList<>(2);
attributes.add(createAttribute(WSSConstants.ATT_WSU_ID, IDGenerator.generateID(null)));
- String base64SigValue =
+ String base64SigValue =
new Base64(76, new byte[]{'\n'}).encodeToString(signatureValueSecurityEvent.getSignatureValue());
attributes.add(createAttribute(WSSConstants.ATT_NULL_VALUE, base64SigValue));
createStartElementAndOutputAsEvent(subOutputProcessorChain, headerElementName, true, attributes);
Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/TimestampOutputProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/TimestampOutputProcessor.java?rev=1782748&r1=1782747&r2=1782748&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/TimestampOutputProcessor.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/TimestampOutputProcessor.java Mon Feb 13 11:20:02 2017
@@ -66,7 +66,7 @@ public class TimestampOutputProcessor ex
final QName headerElementName = WSSConstants.TAG_WSU_TIMESTAMP;
OutputProcessorUtils.updateSecurityHeaderOrder(outputProcessorChain, headerElementName, getAction(), false);
- XMLGregorianCalendar created =
+ XMLGregorianCalendar created =
WSSConstants.datatypeFactory.newXMLGregorianCalendar(new GregorianCalendar(TimeZone.getTimeZone("UTC")));
GregorianCalendar expiresCalendar = new GregorianCalendar(TimeZone.getTimeZone("UTC"));
Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/UsernameTokenOutputProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/UsernameTokenOutputProcessor.java?rev=1782748&r1=1782747&r2=1782748&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/UsernameTokenOutputProcessor.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/UsernameTokenOutputProcessor.java Mon Feb 13 11:20:02 2017
@@ -54,12 +54,12 @@ public class UsernameTokenOutputProcesso
}
@Override
- public void processEvent(XMLSecEvent xmlSecEvent, OutputProcessorChain outputProcessorChain)
+ public void processEvent(XMLSecEvent xmlSecEvent, OutputProcessorChain outputProcessorChain)
throws XMLStreamException, XMLSecurityException {
try {
CallbackHandler callbackHandler = ((WSSSecurityProperties)getSecurityProperties()).getCallbackHandler();
- WSSConstants.UsernameTokenPasswordType usernameTokenPasswordType =
+ WSSConstants.UsernameTokenPasswordType usernameTokenPasswordType =
((WSSSecurityProperties) getSecurityProperties()).getUsernameTokenPasswordType();
if (callbackHandler == null
@@ -190,20 +190,20 @@ public class UsernameTokenOutputProcesso
attributes.add(createAttribute(WSSConstants.ATT_WSU_ID, this.wsuId));
createStartElementAndOutputAsEvent(subOutputProcessorChain, headerElementName, false, attributes);
createStartElementAndOutputAsEvent(subOutputProcessorChain, WSSConstants.TAG_WSSE_USERNAME, false, null);
- createCharactersAndOutputAsEvent(subOutputProcessorChain,
+ createCharactersAndOutputAsEvent(subOutputProcessorChain,
((WSSSecurityProperties) getSecurityProperties()).getTokenUser());
createEndElementAndOutputAsEvent(subOutputProcessorChain, WSSConstants.TAG_WSSE_USERNAME);
- if (((WSSSecurityProperties) getSecurityProperties()).getUsernameTokenPasswordType()
+ if (((WSSSecurityProperties) getSecurityProperties()).getUsernameTokenPasswordType()
!= WSSConstants.UsernameTokenPasswordType.PASSWORD_NONE && !WSSConstants.USERNAMETOKEN_SIGNED.equals(action)) {
attributes = new ArrayList<>(1);
attributes.add(createAttribute(WSSConstants.ATT_NULL_Type,
- ((WSSSecurityProperties) getSecurityProperties()).getUsernameTokenPasswordType()
+ ((WSSSecurityProperties) getSecurityProperties()).getUsernameTokenPasswordType()
== WSSConstants.UsernameTokenPasswordType.PASSWORD_DIGEST
? WSSConstants.UsernameTokenPasswordType.PASSWORD_DIGEST.getNamespace()
: WSSConstants.UsernameTokenPasswordType.PASSWORD_TEXT.getNamespace()));
createStartElementAndOutputAsEvent(subOutputProcessorChain, WSSConstants.TAG_WSSE_PASSWORD, false, attributes);
createCharactersAndOutputAsEvent(subOutputProcessorChain,
- ((WSSSecurityProperties) getSecurityProperties()).getUsernameTokenPasswordType()
+ ((WSSSecurityProperties) getSecurityProperties()).getUsernameTokenPasswordType()
== WSSConstants.UsernameTokenPasswordType.PASSWORD_DIGEST
? WSSUtils.doPasswordDigest(this.nonceValue, this.created.toXMLFormat(), this.password)
: this.password);
@@ -226,7 +226,7 @@ public class UsernameTokenOutputProcesso
attributes = new ArrayList<>(1);
attributes.add(createAttribute(WSSConstants.ATT_NULL_ENCODING_TYPE, WSSConstants.SOAPMESSAGE_NS10_BASE64_ENCODING));
createStartElementAndOutputAsEvent(subOutputProcessorChain, WSSConstants.TAG_WSSE_NONCE, false, attributes);
- createCharactersAndOutputAsEvent(subOutputProcessorChain,
+ createCharactersAndOutputAsEvent(subOutputProcessorChain,
new Base64(76, new byte[]{'\n'}).encodeToString(this.nonceValue));
createEndElementAndOutputAsEvent(subOutputProcessorChain, WSSConstants.TAG_WSSE_NONCE);
}
Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/WSSSignatureEndingOutputProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/WSSSignatureEndingOutputProcessor.java?rev=1782748&r1=1782747&r2=1782748&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/WSSSignatureEndingOutputProcessor.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/WSSSignatureEndingOutputProcessor.java Mon Feb 13 11:20:02 2017
@@ -116,7 +116,7 @@ public class WSSSignatureEndingOutputPro
|| WSSecurityTokenConstants.KEYIDENTIFIER_ENCRYPTED_KEY_SHA1_IDENTIFIER.equals(keyIdentifier)
|| WSSecurityTokenConstants.KeyIdentifier_EncryptedKey.equals(keyIdentifier)) {
attributes.add(createAttribute(WSSConstants.ATT_WSSE11_TOKEN_TYPE, WSSConstants.NS_WSS_ENC_KEY_VALUE_TYPE));
- } else if (WSSecurityTokenConstants.KEYIDENTIFIER_SECURITY_TOKEN_DIRECT_REFERENCE.equals(keyIdentifier)
+ } else if (WSSecurityTokenConstants.KEYIDENTIFIER_SECURITY_TOKEN_DIRECT_REFERENCE.equals(keyIdentifier)
&& !useSingleCertificate) {
attributes.add(createAttribute(WSSConstants.ATT_WSSE11_TOKEN_TYPE, WSSConstants.NS_X509_PKIPATH_V1));
}
@@ -195,7 +195,7 @@ public class WSSSignatureEndingOutputPro
}
@Override
- protected void createTransformsStructureForSignature(OutputProcessorChain subOutputProcessorChain, SignaturePartDef signaturePartDef)
+ protected void createTransformsStructureForSignature(OutputProcessorChain subOutputProcessorChain, SignaturePartDef signaturePartDef)
throws XMLStreamException, XMLSecurityException {
String[] transforms = signaturePartDef.getTransforms();
if (transforms != null && transforms.length > 0) {
@@ -206,11 +206,11 @@ public class WSSSignatureEndingOutputPro
attributes.add(createAttribute(WSSConstants.ATT_NULL_Algorithm, transforms[0]));
createStartElementAndOutputAsEvent(subOutputProcessorChain, WSSConstants.TAG_dsig_Transform, false, attributes);
if (transforms.length >= 2) {
- createStartElementAndOutputAsEvent(subOutputProcessorChain, WSSConstants.TAG_WSSE_TRANSFORMATION_PARAMETERS,
+ createStartElementAndOutputAsEvent(subOutputProcessorChain, WSSConstants.TAG_WSSE_TRANSFORMATION_PARAMETERS,
false, null);
attributes = new ArrayList<>(1);
attributes.add(createAttribute(WSSConstants.ATT_NULL_Algorithm, transforms[1]));
- createStartElementAndOutputAsEvent(subOutputProcessorChain, WSSConstants.TAG_dsig_CanonicalizationMethod,
+ createStartElementAndOutputAsEvent(subOutputProcessorChain, WSSConstants.TAG_dsig_CanonicalizationMethod,
false, attributes);
createEndElementAndOutputAsEvent(subOutputProcessorChain, WSSConstants.TAG_dsig_CanonicalizationMethod);
createEndElementAndOutputAsEvent(subOutputProcessorChain, WSSConstants.TAG_WSSE_TRANSFORMATION_PARAMETERS);
@@ -228,9 +228,9 @@ public class WSSSignatureEndingOutputPro
&& !WSSConstants.SWA_ATTACHMENT_CONTENT_SIG_TRANS.equals(transform)
&& !WSSConstants.SWA_ATTACHMENT_COMPLETE_SIG_TRANS.equals(transform)) {
attributes = new ArrayList<>(1);
- attributes.add(createAttribute(XMLSecurityConstants.ATT_NULL_PrefixList,
+ attributes.add(createAttribute(XMLSecurityConstants.ATT_NULL_PrefixList,
signaturePartDef.getInclusiveNamespacesPrefixes()));
- createStartElementAndOutputAsEvent(subOutputProcessorChain, XMLSecurityConstants.TAG_c14nExcl_InclusiveNamespaces,
+ createStartElementAndOutputAsEvent(subOutputProcessorChain, XMLSecurityConstants.TAG_c14nExcl_InclusiveNamespaces,
true, attributes);
createEndElementAndOutputAsEvent(subOutputProcessorChain, XMLSecurityConstants.TAG_c14nExcl_InclusiveNamespaces);
}
Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/WSSSignatureOutputProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/WSSSignatureOutputProcessor.java?rev=1782748&r1=1782747&r2=1782748&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/WSSSignatureOutputProcessor.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/WSSSignatureOutputProcessor.java Mon Feb 13 11:20:02 2017
@@ -73,7 +73,7 @@ public class WSSSignatureOutputProcessor
}
@Override
- public void processEvent(XMLSecEvent xmlSecEvent, OutputProcessorChain outputProcessorChain)
+ public void processEvent(XMLSecEvent xmlSecEvent, OutputProcessorChain outputProcessorChain)
throws XMLStreamException, XMLSecurityException {
if (xmlSecEvent.getEventType() == XMLStreamConstants.START_ELEMENT) {
XMLSecStartElement xmlSecStartElement = xmlSecEvent.asStartElement();
@@ -289,7 +289,7 @@ public class WSSSignatureOutputProcessor
class InternalWSSSignatureOutputProcessor extends InternalSignatureOutputProcessor {
- InternalWSSSignatureOutputProcessor(SignaturePartDef signaturePartDef, XMLSecStartElement xmlSecStartElement)
+ InternalWSSSignatureOutputProcessor(SignaturePartDef signaturePartDef, XMLSecStartElement xmlSecStartElement)
throws XMLSecurityException {
super(signaturePartDef, xmlSecStartElement);
this.addBeforeProcessor(InternalWSSSignatureOutputProcessor.class.getName());
Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/resourceResolvers/ResolverSameDocument.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/resourceResolvers/ResolverSameDocument.java?rev=1782748&r1=1782747&r2=1782748&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/resourceResolvers/ResolverSameDocument.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/resourceResolvers/ResolverSameDocument.java Mon Feb 13 11:20:02 2017
@@ -40,12 +40,12 @@ public class ResolverSameDocument extend
public ResourceResolver newInstance(String uri, String baseURI) {
return new ResolverSameDocument(uri);
}
-
+
@Override
public boolean matches(XMLSecStartElement xmlSecStartElement) {
return matches(xmlSecStartElement, XMLSecurityConstants.ATT_NULL_Id);
}
-
+
public boolean matches(XMLSecStartElement xmlSecStartElement, QName idAttributeNS) {
Attribute attribute = xmlSecStartElement.getAttributeByName(WSSConstants.ATT_WSU_ID);
if (attribute != null && attribute.getValue().equals(getId())) {
@@ -63,5 +63,5 @@ public class ResolverSameDocument extend
}
return super.matches(xmlSecStartElement, idAttributeNS);
}
-
+
}
Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/resourceResolvers/ResolverXPointer.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/resourceResolvers/ResolverXPointer.java?rev=1782748&r1=1782747&r2=1782748&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/resourceResolvers/ResolverXPointer.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/resourceResolvers/ResolverXPointer.java Mon Feb 13 11:20:02 2017
@@ -40,7 +40,7 @@ public class ResolverXPointer extends or
public ResourceResolver newInstance(String uri, String baseURI) {
return new ResolverXPointer(uri);
}
-
+
@Override
public boolean matches(XMLSecStartElement xmlSecStartElement) {
return matches(xmlSecStartElement, XMLSecurityConstants.ATT_NULL_Id);
Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/DsaKeyValueSecurityTokenImpl.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/DsaKeyValueSecurityTokenImpl.java?rev=1782748&r1=1782747&r2=1782748&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/DsaKeyValueSecurityTokenImpl.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/DsaKeyValueSecurityTokenImpl.java Mon Feb 13 11:20:02 2017
@@ -62,12 +62,12 @@ public class DsaKeyValueSecurityTokenImp
public Subject getSubject() throws WSSecurityException {
return null;
}
-
+
@Override
public Key getKey(String algorithmURI, XMLSecurityConstants.AlgorithmUsage algorithmUsage,
String correlationID) throws XMLSecurityException {
PublicKey publicKey = getPublicKey();
-
+
try {
return crypto.getPrivateKey(publicKey, callbackHandler);
} catch (WSSecurityException ex) {
Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/ECKeyValueSecurityTokenImpl.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/ECKeyValueSecurityTokenImpl.java?rev=1782748&r1=1782747&r2=1782748&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/ECKeyValueSecurityTokenImpl.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/ECKeyValueSecurityTokenImpl.java Mon Feb 13 11:20:02 2017
@@ -63,12 +63,12 @@ public class ECKeyValueSecurityTokenImpl
public Subject getSubject() throws WSSecurityException {
return null;
}
-
+
@Override
public Key getKey(String algorithmURI, XMLSecurityConstants.AlgorithmUsage algorithmUsage,
String correlationID) throws XMLSecurityException {
PublicKey publicKey = getPublicKey();
-
+
try {
return crypto.getPrivateKey(publicKey, callbackHandler);
} catch (WSSecurityException ex) {
Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/ExternalSecurityTokenImpl.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/ExternalSecurityTokenImpl.java?rev=1782748&r1=1782747&r2=1782748&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/ExternalSecurityTokenImpl.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/ExternalSecurityTokenImpl.java Mon Feb 13 11:20:02 2017
@@ -70,7 +70,7 @@ public class ExternalSecurityTokenImpl e
}
@Override
- protected Key getKey(String algorithmURI, XMLSecurityConstants.AlgorithmUsage algorithmUsage, String correlationID)
+ protected Key getKey(String algorithmURI, XMLSecurityConstants.AlgorithmUsage algorithmUsage, String correlationID)
throws XMLSecurityException {
String keyAlgorithm = JCEMapper.getJCEKeyAlgorithmFromURI(algorithmURI);
return new SecretKeySpec(key, keyAlgorithm);
Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/KerberosServiceSecurityTokenImpl.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/KerberosServiceSecurityTokenImpl.java?rev=1782748&r1=1782747&r2=1782748&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/KerberosServiceSecurityTokenImpl.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/KerberosServiceSecurityTokenImpl.java Mon Feb 13 11:20:02 2017
@@ -182,7 +182,7 @@ public class KerberosServiceSecurityToke
public Principal getPrincipal() throws WSSecurityException {
return principal;
}
-
+
/**
* Get the KerberosTokenDecoder instance used to extract a session key from the received Kerberos
* token.
Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/RsaKeyValueSecurityTokenImpl.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/RsaKeyValueSecurityTokenImpl.java?rev=1782748&r1=1782747&r2=1782748&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/RsaKeyValueSecurityTokenImpl.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/RsaKeyValueSecurityTokenImpl.java Mon Feb 13 11:20:02 2017
@@ -62,12 +62,12 @@ public class RsaKeyValueSecurityTokenImp
public Subject getSubject() throws WSSecurityException {
return null;
}
-
+
@Override
public Key getKey(String algorithmURI, XMLSecurityConstants.AlgorithmUsage algorithmUsage,
String correlationID) throws XMLSecurityException {
PublicKey publicKey = getPublicKey();
-
+
try {
return crypto.getPrivateKey(publicKey, callbackHandler);
} catch (WSSecurityException ex) {
Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/SamlSecurityTokenImpl.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/SamlSecurityTokenImpl.java?rev=1782748&r1=1782747&r2=1782748&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/SamlSecurityTokenImpl.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/SamlSecurityTokenImpl.java Mon Feb 13 11:20:02 2017
@@ -79,7 +79,7 @@ public class SamlSecurityTokenImpl exten
} catch (IOException | UnsupportedCallbackException e) {
throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, e, "noPassword");
}
-
+
secret = pwcb.getKey();
key = pwcb.getKeyObject();
if (this.key instanceof PrivateKey) {
@@ -135,7 +135,7 @@ public class SamlSecurityTokenImpl exten
}
@Override
- protected Key getKey(String algorithmURI, XMLSecurityConstants.AlgorithmUsage algorithmUsage, String correlationID)
+ protected Key getKey(String algorithmURI, XMLSecurityConstants.AlgorithmUsage algorithmUsage, String correlationID)
throws XMLSecurityException {
Key key = null;
if (this.key != null) {
@@ -157,7 +157,7 @@ public class SamlSecurityTokenImpl exten
}
@Override
- protected PublicKey getPubKey(String algorithmURI, XMLSecurityConstants.AlgorithmUsage algorithmUsage, String correlationID)
+ protected PublicKey getPubKey(String algorithmURI, XMLSecurityConstants.AlgorithmUsage algorithmUsage, String correlationID)
throws XMLSecurityException {
if (this.subjectSecurityToken != null) {
return subjectSecurityToken.getPublicKey(algorithmURI, algorithmUsage, correlationID);
Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/SecurityTokenFactoryImpl.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/SecurityTokenFactoryImpl.java?rev=1782748&r1=1782747&r2=1782748&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/SecurityTokenFactoryImpl.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/SecurityTokenFactoryImpl.java Mon Feb 13 11:20:02 2017
@@ -92,32 +92,32 @@ public class SecurityTokenFactoryImpl ex
final SecurityTokenReferenceType securityTokenReferenceType
= XMLSecurityUtils.getQNameType(keyInfoType.getContent(), WSSConstants.TAG_WSSE_SECURITY_TOKEN_REFERENCE);
if (securityTokenReferenceType != null) {
- return getSecurityToken(securityTokenReferenceType, crypto,
+ return getSecurityToken(securityTokenReferenceType, crypto,
((WSSSecurityProperties)securityProperties).getCallbackHandler(), inboundSecurityContext,
((WSSSecurityProperties)securityProperties));
}
final KeyValueType keyValueType
= XMLSecurityUtils.getQNameType(keyInfoType.getContent(), WSSConstants.TAG_dsig_KeyValue);
if (keyValueType != null) {
- return getSecurityToken(keyValueType, crypto, ((WSSSecurityProperties)securityProperties).getCallbackHandler(),
+ return getSecurityToken(keyValueType, crypto, ((WSSSecurityProperties)securityProperties).getCallbackHandler(),
inboundSecurityContext,
((WSSSecurityProperties)securityProperties));
}
} else if (crypto != null && crypto.getDefaultX509Identifier() != null) {
return new X509DefaultSecurityTokenImpl(
- (WSInboundSecurityContext) inboundSecurityContext, crypto,
+ (WSInboundSecurityContext) inboundSecurityContext, crypto,
((WSSSecurityProperties)securityProperties).getCallbackHandler(), crypto.getDefaultX509Identifier(),
- crypto.getDefaultX509Identifier(), WSSecurityTokenConstants.KeyIdentifier_NoKeyInfo,
+ crypto.getDefaultX509Identifier(), WSSecurityTokenConstants.KeyIdentifier_NoKeyInfo,
((WSSSecurityProperties)securityProperties)
);
}
throw new WSSecurityException(WSSecurityException.ErrorCode.INVALID_SECURITY, "noKeyinfo");
}
- public static InboundSecurityToken getSecurityToken(SecurityTokenReferenceType securityTokenReferenceType,
+ public static InboundSecurityToken getSecurityToken(SecurityTokenReferenceType securityTokenReferenceType,
Crypto crypto,
- final CallbackHandler callbackHandler,
+ final CallbackHandler callbackHandler,
InboundSecurityContext inboundSecurityContext,
WSSSecurityProperties securityProperties)
throws XMLSecurityException {
@@ -143,7 +143,7 @@ public class SecurityTokenFactoryImpl ex
final X509DataType x509DataType
= XMLSecurityUtils.getQNameType(securityTokenReferenceType.getAny(), WSSConstants.TAG_dsig_X509Data);
if (x509DataType != null) {
- InboundSecurityToken securityToken =
+ InboundSecurityToken securityToken =
getSecurityToken(x509DataType, securityTokenReferenceType.getId(), crypto, callbackHandler,
inboundSecurityContext, securityProperties);
if (securityToken != null) {
@@ -158,8 +158,8 @@ public class SecurityTokenFactoryImpl ex
final KeyIdentifierType keyIdentifierType
= XMLSecurityUtils.getQNameType(securityTokenReferenceType.getAny(), WSSConstants.TAG_WSSE_KEY_IDENTIFIER);
if (keyIdentifierType != null) {
- InboundSecurityToken securityToken =
- getSecurityToken(keyIdentifierType, securityTokenReferenceType.getId(), tokenType, crypto,
+ InboundSecurityToken securityToken =
+ getSecurityToken(keyIdentifierType, securityTokenReferenceType.getId(), tokenType, crypto,
callbackHandler, inboundSecurityContext, securityProperties);
if (securityToken != null) {
return securityToken;
@@ -181,9 +181,9 @@ public class SecurityTokenFactoryImpl ex
private static InboundSecurityToken getSecurityToken(X509DataType x509DataType,
String securityTokenReferenceId,
Crypto crypto,
- final CallbackHandler callbackHandler,
+ final CallbackHandler callbackHandler,
InboundSecurityContext inboundSecurityContext,
- WSSSecurityProperties securityProperties)
+ WSSSecurityProperties securityProperties)
throws XMLSecurityException {
//Issuer Serial
X509IssuerSerialType x509IssuerSerialType = XMLSecurityUtils.getQNameType(
@@ -200,7 +200,7 @@ public class SecurityTokenFactoryImpl ex
final X509Certificate x509Certificate = x509SecurityToken.getX509Certificates()[0];
Principal principal = new X500Principal(x509IssuerSerialType.getX509IssuerName());
- if (x509Certificate.getSerialNumber().compareTo(x509IssuerSerialType.getX509SerialNumber()) == 0
+ if (x509Certificate.getSerialNumber().compareTo(x509IssuerSerialType.getX509SerialNumber()) == 0
&& x509Certificate.getIssuerX500Principal().equals(principal)) {
return createSecurityTokenProxy(inboundSecurityToken,
WSSecurityTokenConstants.KeyIdentifier_IssuerSerial);
@@ -233,17 +233,17 @@ public class SecurityTokenFactoryImpl ex
(WSInboundSecurityContext) inboundSecurityContext, crypto, callbackHandler,
x509CertificateBytes, securityTokenReferenceId, securityProperties);
}
-
+
return null;
}
-
+
private static InboundSecurityToken getSecurityToken(KeyIdentifierType keyIdentifierType,
String securityTokenReferenceId,
String tokenType,
Crypto crypto,
- final CallbackHandler callbackHandler,
+ final CallbackHandler callbackHandler,
InboundSecurityContext inboundSecurityContext,
- WSSSecurityProperties securityProperties)
+ WSSSecurityProperties securityProperties)
throws XMLSecurityException {
String valueType = keyIdentifierType.getValueType();
if (valueType == null) {
@@ -309,7 +309,7 @@ public class SecurityTokenFactoryImpl ex
} else if (WSSConstants.NS_SAML10_TYPE.equals(valueType) || WSSConstants.NS_SAML20_TYPE.equals(valueType)) {
if (WSSConstants.NS_SAML20_TYPE.equals(valueType) && !WSSConstants.NS_SAML20_TOKEN_PROFILE_TYPE.equals(tokenType)) {
((WSInboundSecurityContext) inboundSecurityContext).handleBSPRule(BSPRule.R6617);
- } else if (WSSConstants.NS_SAML10_TYPE.equals(valueType)
+ } else if (WSSConstants.NS_SAML10_TYPE.equals(valueType)
&& !WSSConstants.NS_SAML11_TOKEN_PROFILE_TYPE.equals(tokenType)) {
((WSInboundSecurityContext) inboundSecurityContext).handleBSPRule(BSPRule.R6611);
}
@@ -342,7 +342,7 @@ public class SecurityTokenFactoryImpl ex
SecurityTokenProvider<? extends InboundSecurityToken> tokenProvider = securityTokenProviders.get(i);
InboundSecurityToken inboundSecurityToken = tokenProvider.getSecurityToken();
if (inboundSecurityToken instanceof KerberosServiceSecurityToken) {
- KerberosServiceSecurityToken kerberosSecurityToken =
+ KerberosServiceSecurityToken kerberosSecurityToken =
(KerberosServiceSecurityToken)inboundSecurityToken;
byte[] tokenDigest = messageDigest.digest(kerberosSecurityToken.getBinaryContent());
if (Arrays.equals(tokenDigest, binaryContent)) {
@@ -363,14 +363,14 @@ public class SecurityTokenFactoryImpl ex
//we do enforce BSP compliance here but will fail anyway since we cannot identify the referenced token
((WSInboundSecurityContext) inboundSecurityContext).handleBSPRule(BSPRule.R3063);
}
-
+
return null;
}
-
+
private static InboundSecurityToken getSecurityToken(org.apache.wss4j.binding.wss10.ReferenceType referenceType,
String tokenType,
InboundSecurityContext inboundSecurityContext,
- WSSSecurityProperties securityProperties)
+ WSSSecurityProperties securityProperties)
throws XMLSecurityException {
String uri = referenceType.getURI();
if (uri == null) {
@@ -447,17 +447,17 @@ public class SecurityTokenFactoryImpl ex
if (!WSSConstants.NS_SAML20_TOKEN_PROFILE_TYPE.equals(tokenType)) {
((WSInboundSecurityContext) inboundSecurityContext).handleBSPRule(BSPRule.R6617);
}
- } else if (WSSecurityTokenConstants.SAML_10_TOKEN.equals(samlTokenType)
+ } else if (WSSecurityTokenConstants.SAML_10_TOKEN.equals(samlTokenType)
&& !WSSConstants.NS_SAML11_TOKEN_PROFILE_TYPE.equals(tokenType)) {
((WSInboundSecurityContext) inboundSecurityContext).handleBSPRule(BSPRule.R6611);
}
}
-
+
return createSecurityTokenProxy(securityTokenProvider.getSecurityToken(),
WSSecurityTokenConstants.KEYIDENTIFIER_SECURITY_TOKEN_DIRECT_REFERENCE);
}
-
+
public static InboundSecurityToken getSecurityToken(KeyValueType keyValueType, final Crypto crypto,
final CallbackHandler callbackHandler, SecurityContext securityContext,
WSSSecurityProperties securityProperties)
Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/securityToken/WSSecurityTokenConstants.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/securityToken/WSSecurityTokenConstants.java?rev=1782748&r1=1782747&r2=1782748&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/securityToken/WSSecurityTokenConstants.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/securityToken/WSSecurityTokenConstants.java Mon Feb 13 11:20:02 2017
@@ -26,32 +26,32 @@ public class WSSecurityTokenConstants ex
public static final TokenUsage TOKENUSAGE_MAIN_ENCRYPTION = new TokenUsage("MainEncryption");
public static final TokenUsage TOKENUSAGE_SUPPORTING_TOKENS = new TokenUsage("SupportingTokens");
public static final TokenUsage TOKENUSAGE_SIGNED_SUPPORTING_TOKENS = new TokenUsage("SignedSupportingTokens");
- public static final TokenUsage TOKENUSAGE_ENDORSING_SUPPORTING_TOKENS =
+ public static final TokenUsage TOKENUSAGE_ENDORSING_SUPPORTING_TOKENS =
new TokenUsage("EndorsingSupportingTokens");
- public static final TokenUsage TOKENUSAGE_SIGNED_ENDORSING_SUPPORTING_TOKENS =
+ public static final TokenUsage TOKENUSAGE_SIGNED_ENDORSING_SUPPORTING_TOKENS =
new TokenUsage("SignedEndorsingSupportingTokens");
- public static final TokenUsage TOKENUSAGE_SIGNED_ENCRYPTED_SUPPORTING_TOKENS =
+ public static final TokenUsage TOKENUSAGE_SIGNED_ENCRYPTED_SUPPORTING_TOKENS =
new TokenUsage("SignedEncryptedSupportingTokens");
- public static final TokenUsage TOKENUSAGE_ENCRYPTED_SUPPORTING_TOKENS =
+ public static final TokenUsage TOKENUSAGE_ENCRYPTED_SUPPORTING_TOKENS =
new TokenUsage("EncryptedSupportingTokens");
- public static final TokenUsage TOKENUSAGE_ENDORSING_ENCRYPTED_SUPPORTING_TOKENS =
+ public static final TokenUsage TOKENUSAGE_ENDORSING_ENCRYPTED_SUPPORTING_TOKENS =
new TokenUsage("EndorsingEncryptedSupportingTokens");
- public static final TokenUsage TOKENUSAGE_SIGNED_ENDORSING_ENCRYPTED_SUPPORTING_TOKENS =
+ public static final TokenUsage TOKENUSAGE_SIGNED_ENDORSING_ENCRYPTED_SUPPORTING_TOKENS =
new TokenUsage("SignedEndorsingEncryptedSupportingTokens");
- public static final KeyIdentifier KEYIDENTIFIER_SECURITY_TOKEN_DIRECT_REFERENCE =
+ public static final KeyIdentifier KEYIDENTIFIER_SECURITY_TOKEN_DIRECT_REFERENCE =
new KeyIdentifier("SecurityTokenDirectReference");
- public static final KeyIdentifier KEYIDENTIFIER_THUMBPRINT_IDENTIFIER =
+ public static final KeyIdentifier KEYIDENTIFIER_THUMBPRINT_IDENTIFIER =
new KeyIdentifier("ThumbprintIdentifier");
- public static final KeyIdentifier KEYIDENTIFIER_ENCRYPTED_KEY_SHA1_IDENTIFIER =
+ public static final KeyIdentifier KEYIDENTIFIER_ENCRYPTED_KEY_SHA1_IDENTIFIER =
new KeyIdentifier("EncryptedKeySha1Identifier");
- public static final KeyIdentifier KEYIDENTIFIER_KERBEROS_SHA1_IDENTIFIER =
+ public static final KeyIdentifier KEYIDENTIFIER_KERBEROS_SHA1_IDENTIFIER =
new KeyIdentifier("KerberosSha1Identifier");
- public static final KeyIdentifier KEYIDENTIFIER_EMBEDDED_KEY_IDENTIFIER_REF =
+ public static final KeyIdentifier KEYIDENTIFIER_EMBEDDED_KEY_IDENTIFIER_REF =
new KeyIdentifier("EmbeddedKeyIdentifierRef");
- public static final KeyIdentifier KEYIDENTIFIER_USERNAME_TOKEN_REFERENCE =
+ public static final KeyIdentifier KEYIDENTIFIER_USERNAME_TOKEN_REFERENCE =
new KeyIdentifier("UsernameTokenReference");
- public static final KeyIdentifier KEYIDENTIFIER_EXTERNAL_REFERENCE =
+ public static final KeyIdentifier KEYIDENTIFIER_EXTERNAL_REFERENCE =
new KeyIdentifier("ExternalReference");
public static final TokenType USERNAME_TOKEN = new TokenType("UsernameToken");
Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/setup/ConfigurationConverter.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/setup/ConfigurationConverter.java?rev=1782748&r1=1782747&r2=1782748&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/setup/ConfigurationConverter.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/setup/ConfigurationConverter.java Mon Feb 13 11:20:02 2017
@@ -605,7 +605,7 @@ public final class ConfigurationConverte
properties.setDerivedKeyKeyIdentifier(convertedDerivedKeyIdentifier);
}
}
-
+
private static Collection<Pattern> getCertConstraints(String certConstraints) {
String[] certConstraintsList = certConstraints.split(",");
if (certConstraintsList != null && certConstraintsList.length > 0) {
@@ -618,12 +618,12 @@ public final class ConfigurationConverte
LOG.error(ex.getMessage(), ex);
}
}
-
+
return certConstraintsCollection;
}
return Collections.emptyList();
}
-
+
private static void configureParts(Object secureParts, WSSSecurityProperties properties,
String digestAlgo, boolean required, boolean signature) {
if (secureParts != null) {