camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject camel git commit: Add the ability to pass a KeyStoreParameters Object to the DefaultKeyAccessor
Date Wed, 26 Nov 2014 10:56:33 GMT
Repository: camel
Updated Branches:
  refs/heads/camel-2.14.x dccab0870 -> 3b56eeab0


Add the ability to pass a KeyStoreParameters Object to the DefaultKeyAccessor


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/3b56eeab
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/3b56eeab
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/3b56eeab

Branch: refs/heads/camel-2.14.x
Commit: 3b56eeab075b93cc2800a552fb3ed55dc2929f31
Parents: dccab08
Author: Colm O hEigeartaigh <coheigea@apache.org>
Authored: Wed Nov 26 10:51:20 2014 +0000
Committer: Colm O hEigeartaigh <coheigea@apache.org>
Committed: Wed Nov 26 10:53:11 2014 +0000

----------------------------------------------------------------------
 .../component/xmlsecurity/api/DefaultKeySelector.java    | 11 +++++++++++
 1 file changed, 11 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/3b56eeab/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/api/DefaultKeySelector.java
----------------------------------------------------------------------
diff --git a/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/api/DefaultKeySelector.java
b/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/api/DefaultKeySelector.java
index 4f82f87..bcb8982 100644
--- a/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/api/DefaultKeySelector.java
+++ b/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/api/DefaultKeySelector.java
@@ -16,6 +16,8 @@
  */
 package org.apache.camel.component.xmlsecurity.api;
 
+import java.io.IOException;
+import java.security.GeneralSecurityException;
 import java.security.Key;
 import java.security.KeyStore;
 import java.security.KeyStoreException;
@@ -30,6 +32,8 @@ import javax.xml.crypto.KeySelectorResult;
 import javax.xml.crypto.XMLCryptoContext;
 import javax.xml.crypto.dsig.keyinfo.KeyInfo;
 
+import org.apache.camel.util.jsse.KeyStoreParameters;
+
 /**
  * Default implementation for the key selector. The key is read from a key-store
  * for a given alias. Depending on the purpose a private or public key is
@@ -60,6 +64,13 @@ public class DefaultKeySelector extends KeySelector {
     public void setPassword(char[] password) {
         keyStoreAndAlias.setPassword(password);
     }
+    
+    public void setKeyStoreParameters(KeyStoreParameters parameters) 
+        throws GeneralSecurityException, IOException {
+        if (parameters != null) {
+            keyStoreAndAlias.setKeyStore(parameters.createKeyStore());
+        }
+    }
 
     public KeySelectorResult select(KeyInfo keyInfo, KeySelector.Purpose purpose, AlgorithmMethod
method, XMLCryptoContext context)
         throws KeySelectorException {


Mime
View raw message