You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ws.apache.org by dk...@apache.org on 2019/10/31 14:36:31 UTC
[ws-wss4j] 05/05: Merging to tag.
This is an automated email from the ASF dual-hosted git repository.
dkulp pushed a commit to annotated tag 1_6_0-alpha
in repository https://gitbox.apache.org/repos/asf/ws-wss4j.git
commit d3d2069dc0bbf8315d6a5b92c5f8c166b822f0cd
Author: Colm O hEigeartaigh <co...@apache.org>
AuthorDate: Fri Feb 11 11:36:29 2011 +0000
Merging to tag.
---
.../org/apache/ws/security/handler/WSHandler.java | 29 +++++++++++++---------
1 file changed, 17 insertions(+), 12 deletions(-)
diff --git a/src/main/java/org/apache/ws/security/handler/WSHandler.java b/src/main/java/org/apache/ws/security/handler/WSHandler.java
index ca8580d..04d2a89 100644
--- a/src/main/java/org/apache/ws/security/handler/WSHandler.java
+++ b/src/main/java/org/apache/ws/security/handler/WSHandler.java
@@ -433,10 +433,7 @@ public abstract class WSHandler {
if (sigPropFile != null) {
crypto = (Crypto) cryptos.get(sigPropFile);
if (crypto == null) {
- crypto =
- CryptoFactory.getInstance(
- sigPropFile, this.getClassLoader(reqData.getMsgContext())
- );
+ crypto = loadCryptoFromPropertiesFile(sigPropFile, reqData);
cryptos.put(sigPropFile, crypto);
}
} else if (getString(WSHandlerConstants.SIG_PROP_REF_ID, reqData.getMsgContext()) != null) {
@@ -459,6 +456,20 @@ public abstract class WSHandler {
return crypto;
}
+
+ /**
+ * A hook to allow subclass to load Crypto instances from property files in a different
+ * way.
+ * @param propFilename The property file name
+ * @param reqData The RequestData object
+ * @return A Crypto instance that has been loaded
+ */
+ protected Crypto loadCryptoFromPropertiesFile(String propFilename, RequestData reqData) {
+ return
+ CryptoFactory.getInstance(
+ propFilename, this.getClassLoader(reqData.getMsgContext())
+ );
+ }
/**
* Hook to allow subclasses to load their Encryption Crypto however they
@@ -476,10 +487,7 @@ public abstract class WSHandler {
if (encPropFile != null) {
crypto = (Crypto) cryptos.get(encPropFile);
if (crypto == null) {
- crypto =
- CryptoFactory.getInstance(
- encPropFile, this.getClassLoader(reqData.getMsgContext())
- );
+ crypto = loadCryptoFromPropertiesFile(encPropFile, reqData);
cryptos.put(encPropFile, crypto);
}
} else if (getString(WSHandlerConstants.ENC_PROP_REF_ID, reqData.getMsgContext()) != null) {
@@ -995,10 +1003,7 @@ public abstract class WSHandler {
if (decPropFile != null) {
crypto = (Crypto) cryptos.get(decPropFile);
if (crypto == null) {
- crypto =
- CryptoFactory.getInstance(
- decPropFile, this.getClassLoader(reqData.getMsgContext())
- );
+ crypto = loadCryptoFromPropertiesFile(decPropFile, reqData);
cryptos.put(decPropFile, crypto);
}
} else if (getString(WSHandlerConstants.DEC_PROP_REF_ID, reqData.getMsgContext()) != null) {