summaryrefslogtreecommitdiff
path: root/bkucommon
diff options
context:
space:
mode:
Diffstat (limited to 'bkucommon')
-rw-r--r--bkucommon/pom.xml6
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/cms/Signature.java11
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/xsect/AlgorithmMethodFactoryImpl.java10
-rw-r--r--bkucommon/src/test/java/at/gv/egiz/bku/binding/AbstractBindingProcessorTest.java4
4 files changed, 15 insertions, 16 deletions
diff --git a/bkucommon/pom.xml b/bkucommon/pom.xml
index 2031a827..e9baae09 100644
--- a/bkucommon/pom.xml
+++ b/bkucommon/pom.xml
@@ -65,7 +65,11 @@
</dependency>
<dependency>
<groupId>iaik</groupId>
- <artifactId>iaik_ecc_signed</artifactId>
+ <artifactId>iaik_eccelerate</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>iaik</groupId>
+ <artifactId>iaik_eccelerate_cms</artifactId>
</dependency>
<dependency>
<groupId>commons-fileupload</groupId>
diff --git a/bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/cms/Signature.java b/bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/cms/Signature.java
index 8743192e..fc42dcb4 100644
--- a/bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/cms/Signature.java
+++ b/bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/cms/Signature.java
@@ -39,7 +39,6 @@ import iaik.cms.ContentInfo;
import iaik.cms.IssuerAndSerialNumber;
import iaik.cms.SignedData;
import iaik.cms.SignerInfo;
-import iaik.security.ecc.interfaces.ECDSAParams;
import iaik.smime.ess.ESSCertID;
import iaik.smime.ess.ESSCertIDv2;
import iaik.x509.X509ExtensionException;
@@ -271,16 +270,14 @@ public class Signature {
}
} else if (("EC".equals(algorithm)) || ("ECDSA".equals(algorithm))) {
-
int fieldSize = 0;
- if (publicKey instanceof iaik.security.ecc.ecdsa.ECPublicKey) {
- ECDSAParams params = ((iaik.security.ecc.ecdsa.ECPublicKey) publicKey).getParameter();
- fieldSize = params.getG().getCurve().getField().getSize().bitLength();
- } else if (publicKey instanceof ECPublicKey) {
+ if (publicKey instanceof ECPublicKey) {
ECParameterSpec params = ((ECPublicKey) publicKey).getParams();
fieldSize = params.getCurve().getField().getFieldSize();
+ } else {
+ throw new NoSuchAlgorithmException("Public key type not supported.");
}
-
+
if (useStrongHash && fieldSize >= 512) {
signatureAlgorithm = AlgorithmID.ecdsa_With_SHA512;
digestAlgorithm = AlgorithmID.sha512;
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 317e9e1f..896552d8 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
@@ -24,7 +24,6 @@
package at.gv.egiz.bku.slcommands.impl.xsect;
-import iaik.security.ecc.interfaces.ECDSAParams;
import iaik.xml.crypto.XmldsigMore;
import java.security.InvalidAlgorithmParameterException;
@@ -103,14 +102,13 @@ public class AlgorithmMethodFactoryImpl implements AlgorithmMethodFactory {
} else if (("EC".equals(algorithm)) || ("ECDSA".equals(algorithm))) {
int fieldSize = 0;
- if (publicKey instanceof iaik.security.ecc.ecdsa.ECPublicKey) {
- ECDSAParams params = ((iaik.security.ecc.ecdsa.ECPublicKey) publicKey).getParameter();
- fieldSize = params.getG().getCurve().getField().getSize().bitLength();
- } else if (publicKey instanceof ECPublicKey) {
+ if (publicKey instanceof ECPublicKey) {
ECParameterSpec params = ((ECPublicKey) publicKey).getParams();
fieldSize = params.getCurve().getField().getFieldSize();
+ } else {
+ throw new NoSuchAlgorithmException("Public key type not supported.");
}
-
+
if (useStrongHash && fieldSize >= 512) {
signatureAlgorithmURI = XmldsigMore.SIGNATURE_ECDSA_SHA512;
digestAlgorithmURI = DigestMethod.SHA512;
diff --git a/bkucommon/src/test/java/at/gv/egiz/bku/binding/AbstractBindingProcessorTest.java b/bkucommon/src/test/java/at/gv/egiz/bku/binding/AbstractBindingProcessorTest.java
index 898c9d27..6f86caf7 100644
--- a/bkucommon/src/test/java/at/gv/egiz/bku/binding/AbstractBindingProcessorTest.java
+++ b/bkucommon/src/test/java/at/gv/egiz/bku/binding/AbstractBindingProcessorTest.java
@@ -27,7 +27,7 @@ package at.gv.egiz.bku.binding;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
-import iaik.security.ecc.provider.ECCProvider;
+import iaik.security.ec.provider.ECCelerate;
import iaik.security.provider.IAIK;
import iaik.xml.crypto.XSecProvider;
@@ -47,7 +47,7 @@ public abstract class AbstractBindingProcessorTest {
@BeforeClass
public static void setUpClass() {
Security.insertProviderAt(new IAIK(), 1);
- Security.insertProviderAt(new ECCProvider(false), 2);
+ Security.insertProviderAt(new ECCelerate(false), 2);
XSecProvider.addAsProvider(false);
ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext(