summaryrefslogtreecommitdiff
path: root/bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/xsect/AlgorithmMethodFactoryImpl.java
diff options
context:
space:
mode:
authortkellner <tkellner@8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4>2011-05-17 14:04:25 +0000
committertkellner <tkellner@8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4>2011-05-17 14:04:25 +0000
commitdf1f2ef69011c6754030fa22a42c080e31b99b03 (patch)
treeccd3f2b9a191fc83d95d6ccce6c74ffab90fc6c7 /bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/xsect/AlgorithmMethodFactoryImpl.java
parent379b5636bfe4919c83c185964ae552e442b8d28c (diff)
downloadmocca-df1f2ef69011c6754030fa22a42c080e31b99b03.tar.gz
mocca-df1f2ef69011c6754030fa22a42c080e31b99b03.tar.bz2
mocca-df1f2ef69011c6754030fa22a42c080e31b99b03.zip
Enable switching to SHA-2 mode via config parameter
git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@935 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4
Diffstat (limited to 'bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/xsect/AlgorithmMethodFactoryImpl.java')
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/xsect/AlgorithmMethodFactoryImpl.java14
1 files changed, 8 insertions, 6 deletions
diff --git a/bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/xsect/AlgorithmMethodFactoryImpl.java b/bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/xsect/AlgorithmMethodFactoryImpl.java
index f1219a6c..49ed4486 100644
--- a/bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/xsect/AlgorithmMethodFactoryImpl.java
+++ b/bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/xsect/AlgorithmMethodFactoryImpl.java
@@ -45,7 +45,7 @@ public class AlgorithmMethodFactoryImpl implements AlgorithmMethodFactory {
/**
* Use SHA-2?
*/
- private static boolean SHA2 = false;
+ private boolean SHA2 = false;
/**
* The signature algorithm URI.
@@ -61,19 +61,21 @@ public class AlgorithmMethodFactoryImpl implements AlgorithmMethodFactory {
* The algorithm parameters for the signature algorithm.
*/
private SignatureMethodParameterSpec signatureMethodParameterSpec;
-
+
/**
- * Creates a new AlgrithmMethodFactory with the given
+ * Creates a new AlgorithmMethodFactory with the given
* <code>signingCertificate</code>.
*
- * @param signingCertificate
+ * @param signingCertificate
*
* @throws NoSuchAlgorithmException
* if the public key algorithm of the given
* <code>signingCertificate</code> is not supported
*/
- public AlgorithmMethodFactoryImpl(X509Certificate signingCertificate)
- throws NoSuchAlgorithmException {
+ public AlgorithmMethodFactoryImpl(X509Certificate signingCertificate, boolean useSHA2)
+ throws NoSuchAlgorithmException {
+
+ SHA2 = useSHA2;
PublicKey publicKey = signingCertificate.getPublicKey();
String algorithm = publicKey.getAlgorithm();