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 2026/05/29 11:53:16 UTC
(ws-wss4j) branch 3_0_x-fixes updated: WSS-726 Make EncryptedKeyProcessor.getAsymmetricDecryptedByte overridable (#616)
This is an automated email from the ASF dual-hosted git repository.
coheigea pushed a commit to branch 3_0_x-fixes
in repository https://gitbox.apache.org/repos/asf/ws-wss4j.git
The following commit(s) were added to refs/heads/3_0_x-fixes by this push:
new 15d36f9aa WSS-726 Make EncryptedKeyProcessor.getAsymmetricDecryptedByte overridable (#616)
15d36f9aa is described below
commit 15d36f9aa06f6ed48d0ef733de79e716d52b4556
Author: gmextec <16...@users.noreply.github.com>
AuthorDate: Fri May 29 13:50:58 2026 +0200
WSS-726 Make EncryptedKeyProcessor.getAsymmetricDecryptedByte overridable (#616)
Allow overriding EncryptedKeyProcessor#getAsymmetricDecryptedByte in order to customize Cipher init and decryption
see https://issues.apache.org/jira/projects/WSS/issues/WSS-726
---
.../wss4j/dom/processor/EncryptedKeyProcessor.java | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/EncryptedKeyProcessor.java b/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/EncryptedKeyProcessor.java
index 87b8f2b19..046a18543 100644
--- a/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/EncryptedKeyProcessor.java
+++ b/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/EncryptedKeyProcessor.java
@@ -341,7 +341,19 @@ public class EncryptedKeyProcessor implements Processor {
return X509Util.getSecretKey(keyInfoChildElement, algorithmURI, data.getCallbackHandler());
}
- private static byte[] getAsymmetricDecryptedBytes(
+ /**
+ * Initializes the cipher decrypting the encryptedEphemeralKey as indicated by the encryptedKeyTransportMethod
+ * @param data
+ * @param wsDocInfo
+ * @param encryptedKeyTransportMethod
+ * @param encryptedEphemeralKey
+ * @param refList
+ * @param encryptedKeyElement
+ * @param privateKey
+ * @return the decrypted key or, in case of an exception during the decryption, a randomKey
+ * @throws WSSecurityException
+ */
+ protected byte[] getAsymmetricDecryptedBytes(
RequestData data,
WSDocInfo wsDocInfo,
String encryptedKeyTransportMethod,
@@ -508,7 +520,7 @@ public class EncryptedKeyProcessor implements Processor {
* Generates a random secret key using the algorithm specified in the
* first DataReference URI
*/
- private static byte[] getRandomKey(Element refList, WSDocInfo wsDocInfo) throws WSSecurityException {
+ protected static byte[] getRandomKey(Element refList, WSDocInfo wsDocInfo) throws WSSecurityException {
try {
String alg = "AES";
int size = 16;