|
61 | 61 | import org.springframework.ws.soap.security.callback.CleanupCallback;
|
62 | 62 | import org.springframework.ws.soap.security.wss4j2.callback.UsernameTokenPrincipalCallback;
|
63 | 63 |
|
64 |
| -import static java.util.Collections.emptyList; |
65 |
| - |
66 | 64 | /**
|
67 | 65 | * A WS-Security endpoint interceptor based on Apache's WSS4J. This interceptor supports
|
68 | 66 | * messages created by the
|
@@ -211,7 +209,7 @@ public class Wss4jSecurityInterceptor extends AbstractWsSecurityInterceptor impl
|
211 | 209 | // To maintain same behavior as default, this flag is set to true
|
212 | 210 | private boolean removeSecurityHeader = true;
|
213 | 211 |
|
214 |
| - private List<Pattern> signatureSubjectDnPatterns = emptyList(); |
| 212 | + private List<Pattern> signatureSubjectDnPatterns = Collections.emptyList(); |
215 | 213 |
|
216 | 214 | /**
|
217 | 215 | * Create a {@link WSSecurityEngine} by default.
|
@@ -244,15 +242,6 @@ public void setSecurementActor(String securementActor) {
|
244 | 242 | this.handler.setOption(WSHandlerConstants.ACTOR, securementActor);
|
245 | 243 | }
|
246 | 244 |
|
247 |
| - /** |
248 |
| - * Defines whether to use a single certificate or a whole certificate chain when |
249 |
| - * constructing a BinarySecurityToken used for direct reference in signature. The |
250 |
| - * default is "true", meaning that only a single certificate is used. |
251 |
| - */ |
252 |
| - public void setSecurementSignatureSingleCertificate(boolean useSingleCertificate) { |
253 |
| - handler.setOption(WSHandlerConstants.USE_SINGLE_CERTIFICATE, useSingleCertificate); |
254 |
| - } |
255 |
| - |
256 | 245 | public void setSecurementEncryptionCrypto(Crypto securementEncryptionCrypto) {
|
257 | 246 | this.handler.setSecurementEncryptionCrypto(securementEncryptionCrypto);
|
258 | 247 | }
|
@@ -545,13 +534,11 @@ public void setValidationSignatureCrypto(Crypto signatureCrypto) {
|
545 | 534 | * Certificate constraints which will be applied to the subject DN of the certificate
|
546 | 535 | * used for signature validation, after trust verification of the certificate chain
|
547 | 536 | * associated with the certificate.
|
548 |
| - * @param patterns A list of regex patterns which will be applied to the subject DN. |
549 |
| - * |
550 |
| - * @see <a href="https://ws.apache.org/wss4j/config.html">WSS4J configuration: |
551 |
| - * SIG_SUBJECT_CERT_CONSTRAINTS</a> |
| 537 | + * @param patterns a list of regex patterns which will be applied to the subject DN. |
| 538 | + * @see ConfigurationConstants#SIG_SUBJECT_CERT_CONSTRAINTS |
552 | 539 | */
|
553 | 540 | public void setValidationSubjectDnConstraints(List<Pattern> patterns) {
|
554 |
| - signatureSubjectDnPatterns = patterns; |
| 541 | + this.signatureSubjectDnPatterns = patterns; |
555 | 542 | }
|
556 | 543 |
|
557 | 544 | /**
|
@@ -768,7 +755,7 @@ protected RequestData initializeRequestData(MessageContext messageContext) {
|
768 | 755 | // allow for qualified password types for .Net interoperability
|
769 | 756 | requestData.setAllowNamespaceQualifiedPasswordTypes(true);
|
770 | 757 |
|
771 |
| - requestData.setSubjectCertConstraints(signatureSubjectDnPatterns); |
| 758 | + requestData.setSubjectCertConstraints(this.signatureSubjectDnPatterns); |
772 | 759 | return requestData;
|
773 | 760 | }
|
774 | 761 |
|
@@ -808,8 +795,7 @@ protected RequestData initializeValidationRequestData(MessageContext messageCont
|
808 | 795 | // allow for qualified password types for .Net interoperability
|
809 | 796 | requestData.setAllowNamespaceQualifiedPasswordTypes(true);
|
810 | 797 |
|
811 |
| - requestData.setSubjectCertConstraints(signatureSubjectDnPatterns); |
812 |
| - |
| 798 | + requestData.setSubjectCertConstraints(this.signatureSubjectDnPatterns); |
813 | 799 | return requestData;
|
814 | 800 | }
|
815 | 801 |
|
|
0 commit comments