From cb977cef1904eb9e42dd27094047542fee6fd2e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Nicoll?= Date: Mon, 10 Mar 2025 06:33:38 +0100 Subject: [PATCH] Polish contribution See gh-153 --- .../wss4j2/Wss4jSecurityInterceptor.java | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/spring-ws-security/src/main/java/org/springframework/ws/soap/security/wss4j2/Wss4jSecurityInterceptor.java b/spring-ws-security/src/main/java/org/springframework/ws/soap/security/wss4j2/Wss4jSecurityInterceptor.java index 31576e18..fc913d6b 100644 --- a/spring-ws-security/src/main/java/org/springframework/ws/soap/security/wss4j2/Wss4jSecurityInterceptor.java +++ b/spring-ws-security/src/main/java/org/springframework/ws/soap/security/wss4j2/Wss4jSecurityInterceptor.java @@ -595,14 +595,6 @@ public class Wss4jSecurityInterceptor extends AbstractWsSecurityInterceptor impl this.enableRevocation = enableRevocation; } - /** - * Enables the {@code useSingleCertificate} attribute on WS-Security headers on outgoing messages. Default is - * {@code true}. - */ - public void setUseSingleCertificate(boolean useSingleCertificate) { - handler.setOption(WSHandlerConstants.USE_SINGLE_CERTIFICATE, useSingleCertificate); - } - /** * Set the WS-I Basic Security Profile compliance mode. Default is {@code true}. */ @@ -623,6 +615,18 @@ public class Wss4jSecurityInterceptor extends AbstractWsSecurityInterceptor impl this.addInclusivePrefixes = addInclusivePrefixes; } + /** + * Set whether to use a single certificate or a whole certificate chain when + * constructing a {@code BinarySecurityToken} used for direct reference in signature. + * default is {@code true}, meaning that only a single certificate is used. + * @param useSingleCertificate whether to use a single certificate + * @since 4.1.0 + * @see WSHandlerConstants#USE_SINGLE_CERTIFICATE + */ + public void setUseSingleCertificate(boolean useSingleCertificate) { + this.handler.setOption(WSHandlerConstants.USE_SINGLE_CERTIFICATE, useSingleCertificate); + } + /** * Sets whether the RSA 1.5 key transport algorithm is allowed. */