You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by co...@apache.org on 2014/11/26 11:52:08 UTC
camel git commit: Add the ability to pass a KeyStoreParameters Object
to the DefaultKeyAccessor
Repository: camel
Updated Branches:
refs/heads/master bd364a95f -> 9ad9c0525
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/9ad9c052
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/9ad9c052
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/9ad9c052
Branch: refs/heads/master
Commit: 9ad9c0525759fe75425373a736ecef1a46b600fc
Parents: bd364a9
Author: Colm O hEigeartaigh <co...@apache.org>
Authored: Wed Nov 26 10:51:20 2014 +0000
Committer: Colm O hEigeartaigh <co...@apache.org>
Committed: Wed Nov 26 10:51:57 2014 +0000
----------------------------------------------------------------------
.../component/xmlsecurity/api/DefaultKeySelector.java | 11 +++++++++++
1 file changed, 11 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/9ad9c052/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 {