summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCGantert345 <57003061+CGantert345@users.noreply.github.com>2022-04-11 15:06:48 +0200
committerCGantert345 <57003061+CGantert345@users.noreply.github.com>2022-04-11 15:06:48 +0200
commite670f1fdbc43f0d0854896a1afe2815f8a9f4c87 (patch)
treeff4440aa710bf6a93de0309a57eaa1167162a96f
parentTimeStamp using java compliant with older android version (diff)
downloadUIC-barcode-e670f1fdbc43f0d0854896a1afe2815f8a9f4c87.tar
UIC-barcode-e670f1fdbc43f0d0854896a1afe2815f8a9f4c87.tar.gz
UIC-barcode-e670f1fdbc43f0d0854896a1afe2815f8a9f4c87.tar.bz2
UIC-barcode-e670f1fdbc43f0d0854896a1afe2815f8a9f4c87.tar.lz
UIC-barcode-e670f1fdbc43f0d0854896a1afe2815f8a9f4c87.tar.xz
UIC-barcode-e670f1fdbc43f0d0854896a1afe2815f8a9f4c87.tar.zst
UIC-barcode-e670f1fdbc43f0d0854896a1afe2815f8a9f4c87.zip
-rw-r--r--src/main/java/org/uic/barcode/dynamicFrame/api/SimpleDynamicFrame.java43
-rw-r--r--src/main/java/org/uic/barcode/utils/AlgorithmNameResolver.java187
-rw-r--r--src/main/java/org/uic/barcode/utils/SecurityUtils.java129
-rw-r--r--src/test/java/org/uic/barcode/test/DynamicFrameDoubleSignatureProviderSelectionTest.java13
-rw-r--r--src/test/java/org/uic/barcode/test/DynamicFrameDoubleSignatureTest.java27
-rw-r--r--src/test/java/org/uic/barcode/test/DynamicFrameDynamicContentApiTest.java2
-rw-r--r--src/test/java/org/uic/barcode/test/DynamicFrameDynamicContentTest.java4
-rw-r--r--src/test/java/org/uic/barcode/test/DynamicFrameFcbVersion1Test.java2
-rw-r--r--src/test/java/org/uic/barcode/test/DynamicFrameFcbVersion3Test.java2
-rw-r--r--src/test/java/org/uic/barcode/test/DynamicFrameSimpleTest.java2
-rw-r--r--src/test/java/org/uic/barcode/test/DynamicFrameV2FcbVersion3Test.java2
-rw-r--r--src/test/java/org/uic/barcode/test/DynamicFrameV2SignatureInsert2Test.java2
-rw-r--r--src/test/java/org/uic/barcode/test/DynamicFrameV2SignatureInsertTest.java2
-rw-r--r--src/test/java/org/uic/barcode/test/DynamicFrameV2ValidityDateTest.java2
14 files changed, 312 insertions, 107 deletions
diff --git a/src/main/java/org/uic/barcode/dynamicFrame/api/SimpleDynamicFrame.java b/src/main/java/org/uic/barcode/dynamicFrame/api/SimpleDynamicFrame.java
index a05a936..ef31166 100644
--- a/src/main/java/org/uic/barcode/dynamicFrame/api/SimpleDynamicFrame.java
+++ b/src/main/java/org/uic/barcode/dynamicFrame/api/SimpleDynamicFrame.java
@@ -20,6 +20,7 @@ import org.uic.barcode.dynamicFrame.v1.DynamicFrameCoderV1;
import org.uic.barcode.dynamicFrame.v2.DynamicFrameCoderV2;
import org.uic.barcode.ticket.EncodingFormatException;
import org.uic.barcode.utils.AlgorithmNameResolver;
+import org.uic.barcode.utils.SecurityUtils;
@@ -132,13 +133,15 @@ public class SimpleDynamicFrame implements IDynamicFrame {
*
* Note: an appropriate security provider (e.g. BC) must be registered before
*
- * @param prov the registered security provider
+ * @param provider the registered security provider
* @return the return error code
* @throws EncodingFormatException
*/
@Override
public int validateLevel2(Provider prov) throws EncodingFormatException {
+ Provider provider = prov;
+
if (getLevel2Data() == null
|| getLevel2Data().getLevel1Data() == null
|| getLevel2Data().getLevel1Data().getLevel2KeyAlg() == null
@@ -159,7 +162,7 @@ public class SimpleDynamicFrame implements IDynamicFrame {
String keyAlgName = null;
try {
- keyAlgName = AlgorithmNameResolver.getName(AlgorithmNameResolver.TYPE_KEY_GENERATOR_ALG, level2KeyAlg,prov);
+ keyAlgName = AlgorithmNameResolver.getName(AlgorithmNameResolver.TYPE_KEY_GENERATOR_ALG, level2KeyAlg,provider);
} catch (Exception e1) {
return Constants.LEVEL2_VALIDATION_KEY_ALG_NOT_IMPLEMENTED;
}
@@ -171,7 +174,20 @@ public class SimpleDynamicFrame implements IDynamicFrame {
try {
byte[] keyBytes = this.getLevel2Data().getLevel1Data().getLevel2publicKey();
X509EncodedKeySpec keySpec = new X509EncodedKeySpec(keyBytes);
- key = KeyFactory.getInstance(keyAlgName).generatePublic(keySpec);
+
+ KeyFactory keyFactory = null;
+ if (provider == null) {
+ keyFactory = SecurityUtils.findKeyFactory(level2KeyAlg, keyBytes);
+ provider = keyFactory.getProvider();
+ } else {
+ keyFactory = KeyFactory.getInstance(keyAlgName,provider);
+ }
+ if (keyFactory != null) {
+ key = keyFactory.generatePublic(keySpec);
+ } else {
+ return Constants.LEVEL2_VALIDATION_KEY_ALG_NOT_IMPLEMENTED;
+ }
+
} catch (InvalidKeySpecException e1) {
return Constants.LEVEL2_VALIDATION_KEY_ALG_NOT_IMPLEMENTED;
} catch (NoSuchAlgorithmException e1) {
@@ -183,7 +199,7 @@ public class SimpleDynamicFrame implements IDynamicFrame {
String sigAlgName = null;
try {
- sigAlgName = AlgorithmNameResolver.getName(AlgorithmNameResolver.TYPE_SIGNATURE_ALG,level2SigAlg,prov);
+ sigAlgName = AlgorithmNameResolver.getSignatureAlgorithmName(level2SigAlg,provider);
} catch (Exception e1) {
return Constants.LEVEL2_VALIDATION_SIG_ALG_NOT_IMPLEMENTED;
}
@@ -191,12 +207,12 @@ public class SimpleDynamicFrame implements IDynamicFrame {
return Constants.LEVEL2_VALIDATION_SIG_ALG_NOT_IMPLEMENTED;
}
- Signature sig;
+ Signature sig = null;
try {
- if (prov == null) {
+ if (provider == null) {
sig = Signature.getInstance(sigAlgName);
} else {
- sig = Signature.getInstance(sigAlgName, prov);
+ sig = Signature.getInstance(sigAlgName,provider);
}
} catch (NoSuchAlgorithmException e) {
return Constants.LEVEL2_VALIDATION_SIG_ALG_NOT_IMPLEMENTED;
@@ -321,7 +337,7 @@ public class SimpleDynamicFrame implements IDynamicFrame {
} else {
return Constants.LEVEL1_VALIDATION_FRAUD;
}
- } catch (SignatureException e) {
+ } catch (Exception e) {
return Constants.LEVEL1_VALIDATION_SIG_ALG_NOT_IMPLEMENTED;
}
}
@@ -344,6 +360,9 @@ public class SimpleDynamicFrame implements IDynamicFrame {
//find the algorithm name for the signature OID
String algo = AlgorithmNameResolver.getSignatureAlgorithmName(this.getLevel2Data().getLevel1Data().getLevel2SigningAlg(), prov);
Signature sig = null;
+ if (prov == null) {
+ prov = SecurityUtils.findPrivateKeyProvider(key);
+ }
if (prov != null) {
sig = Signature.getInstance(algo,prov);
} else {
@@ -438,10 +457,16 @@ public class SimpleDynamicFrame implements IDynamicFrame {
ILevel1Data level1Data = level2Data.getLevel1Data();
if (level1Data == null) return;
+
+ if (prov == null) {
+ //check for a provider supporting the key
+ prov = SecurityUtils.findPrivateKeyProvider(key);
+ }
//find the algorithm name for the signature OID
- String algo = AlgorithmNameResolver.getSignatureAlgorithmName(level1Data.getLevel1SigningAlg());
+ String algo = AlgorithmNameResolver.getSignatureAlgorithmName(level1Data.getLevel1SigningAlg(), prov);
Signature sig = null;
+
if (prov != null) {
sig = Signature.getInstance(algo, prov);
} else {
diff --git a/src/main/java/org/uic/barcode/utils/AlgorithmNameResolver.java b/src/main/java/org/uic/barcode/utils/AlgorithmNameResolver.java
index a3154f3..28f90e6 100644
--- a/src/main/java/org/uic/barcode/utils/AlgorithmNameResolver.java
+++ b/src/main/java/org/uic/barcode/utils/AlgorithmNameResolver.java
@@ -3,98 +3,161 @@ package org.uic.barcode.utils;
import java.security.Provider;
import java.security.Provider.Service;
import java.security.Security;
+import java.util.HashMap;
+/**
+ * The Class AlgorithmNameResolver.
+ */
public class AlgorithmNameResolver {
+ /** The Constant TYPE_KEY_GENERATOR_ALG. */
public static final String TYPE_KEY_GENERATOR_ALG = "KeyPairGenerator";
+
+ /** The Constant TYPE_SIGNATURE_ALG. */
public static final String TYPE_SIGNATURE_ALG = "Signature";
+ /** The map. */
+ private static HashMap<String, HashMap<String, String>> map = new HashMap<String, HashMap<String, String>>();
+
+ /**
+ * Adds an entry for a mapping of algorithm type and oid to an algorithm name
+ *
+ * @param type the algorithm type
+ * @param oid the algorithm OID
+ * @param name the algorithm name
+ */
+ public static void addMap (String type, String oid, String name) {
+
+ if (map.get(type) == null) {
+ HashMap<String,String> list = new HashMap<String , String>();
+ list.put(oid, name);
+ map.put(type, list);
+ } else {
+ map.get(type).put(oid, name);
+ }
+ }
+
+ /**
+ * Gets the signature algorithm name.
+ *
+ * @param oid the oid
+ * @return the signature algorithm name
+ * @throws Exception the exception
+ */
public static String getSignatureAlgorithmName (String oid) throws Exception {
- Provider[] provs = Security.getProviders();
- for (Provider prov : provs) {
- Service service = prov.getService(AlgorithmNameResolver.TYPE_SIGNATURE_ALG,oid);
- if (service != null) {
- return service.getAlgorithm();
- }
- }
- return null;
+ return getSignatureAlgorithmName (oid, null);
}
+ /**
+ * Gets the signature algorithm name.
+ *
+ * @param oid the oid
+ * @param provider the provider
+ * @return the signature algorithm name
+ * @throws Exception the exception
+ */
public static String getSignatureAlgorithmName (String oid, Provider provider) throws Exception {
+ return getAlgorithmName(AlgorithmNameResolver.TYPE_SIGNATURE_ALG,oid,provider);
+
+ }
+
+ /**
+ * Gets the name.
+ *
+ * @param type the type
+ * @param oid the oid
+ * @return the name
+ * @throws Exception the exception
+ */
+ public static String getName (String type, String oid) throws Exception {
+
+ return getAlgorithmName(type,oid,null);
+
+ }
+
+
+ /**
+ * Gets the name.
+ *
+ * @param type the type
+ * @param oid the oid
+ * @param provider the provider
+ * @return the name
+ * @throws Exception the exception
+ */
+ public static String getName(String type, String oid, Provider provider) throws Exception {
+
+ return getAlgorithmName(type,oid,provider);
+
+ }
+
+
+
+ /**
+ * Gets the algorithm name.
+ *
+ * @param type the type
+ * @param oid the oid
+ * @param provider the provider
+ * @return the algorithm name
+ * @throws Exception the exception
+ */
+ public static String getAlgorithmName (String type, String oid, Provider provider) throws Exception {
+
+ String name = null;
+
if (provider != null) {
- Service service = provider.getService(AlgorithmNameResolver.TYPE_SIGNATURE_ALG,oid);
- return service.getAlgorithm();
+ Service service = provider.getService(type,oid);
+ if (service != null) {
+ name = service.getAlgorithm();
+ }
+
+ if (name != null && name.length() > 0) {
+ return name;
+ }
}
Provider[] provs = Security.getProviders();
for (Provider prov : provs) {
- Service service = prov.getService(AlgorithmNameResolver.TYPE_SIGNATURE_ALG,oid);
+ Service service = prov.getService(type,oid);
if (service != null) {
- return service.getAlgorithm();
+ name = service.getAlgorithm();
+ }
+ if (name != null && name.length() > 0) {
+ return name;
}
}
- return null;
-
- }
-
-
- public static String getName (String type, String oid) throws Exception {
-
- Provider[] provs = Security.getProviders();
- for (Provider prov : provs) {
- Service service = prov.getService(type,oid);
- if (service != null) {
- return service.getAlgorithm();
- }
- }
-
- if (oid.startsWith("1.2.840.10045")) {
+
+ if (map.get(type) != null) {
+ if (map.get(type).get(oid) != null) {
+ return map.get(type).get(oid);
+ }
+ }
+
+
+ //fallback if the provider did not implement OIDs
+ if (oid.startsWith("1.2.840.10045.4")) {
return "ECDSA";
- } else if (oid.startsWith("1.2.840.10040")) {
- return "DSA";
- }
-
- return null;
-
- }
-
-
- public static String getName(String type, String oid, Provider provider) throws Exception {
-
- Service service = null;
- if (provider == null) {
-
- Provider[] provs = Security.getProviders();
- for (Provider prov : provs) {
- service = prov.getService(type,oid);
- }
-
- } else {
- service = provider.getService(type,oid);
- }
-
-
-
- if (service != null) {
- return service.getAlgorithm();
- }
-
- if (oid.startsWith("1.2.840.10045")) {
+ } else if (oid.startsWith("1.2.840.10045.3")) {
+ return "EC";
+ } else if (oid.startsWith("1.2.840.10045")) {
return "ECDSA";
} else if (oid.startsWith("1.2.840.10040")) {
return "DSA";
}
-
- return null;
-
- }
+
+ return null;
+
+ }
+
+
diff --git a/src/main/java/org/uic/barcode/utils/SecurityUtils.java b/src/main/java/org/uic/barcode/utils/SecurityUtils.java
new file mode 100644
index 0000000..542208b
--- /dev/null
+++ b/src/main/java/org/uic/barcode/utils/SecurityUtils.java
@@ -0,0 +1,129 @@
+package org.uic.barcode.utils;
+
+import java.security.KeyFactory;
+import java.security.NoSuchAlgorithmException;
+import java.security.PrivateKey;
+import java.security.Provider;
+import java.security.PublicKey;
+import java.security.Security;
+import java.security.spec.InvalidKeySpecException;
+import java.security.spec.PKCS8EncodedKeySpec;
+import java.security.spec.X509EncodedKeySpec;
+
+public class SecurityUtils {
+
+ public static KeyFactory findKeyFactory(String oid, byte[] keyBytes) {
+
+ X509EncodedKeySpec keySpec = new X509EncodedKeySpec(keyBytes);
+
+ String name = null;
+ try {
+ name = AlgorithmNameResolver.getName(AlgorithmNameResolver.TYPE_KEY_GENERATOR_ALG, oid);
+ } catch (Exception e2) {
+ return null;
+ }
+ if (name == null || name.length() == 0) {
+ return null;
+ }
+
+ KeyFactory keyFactory = null;
+
+ Provider[] provs = Security.getProviders();
+ for (Provider provider : provs) {
+ try {
+ keyFactory = KeyFactory.getInstance(name,provider);
+ } catch (NoSuchAlgorithmException e1) {
+ //try next
+ }
+ if (keyFactory != null) {
+ try {
+ keyFactory.generatePublic(keySpec);
+ return keyFactory;
+ } catch (Exception e) {
+ //try next
+ }
+ }
+ }
+ return null;
+
+ }
+
+
+ public static Provider findPrivateKeyProvider(PrivateKey key) {
+
+ String name = key.getAlgorithm();
+ byte[] keyBytes = key.getEncoded();
+
+
+ PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(keyBytes);
+
+
+ KeyFactory keyFactory = null;
+
+ Provider[] provs = Security.getProviders();
+ for (Provider provider : provs) {
+ try {
+ keyFactory = KeyFactory.getInstance(name,provider);
+ } catch (NoSuchAlgorithmException e1) {
+ //try next
+ }
+ if (keyFactory != null) {
+ try {
+ keyFactory.generatePrivate(keySpec);
+ return provider;
+ } catch (Exception e) {
+ provider = null;
+ //try next
+ }
+ }
+ }
+
+ return null;
+ }
+
+
+
+ public static PublicKey convertPublicKey(PublicKey key) {
+
+
+ PublicKey publicKey;
+ try {
+ publicKey = KeyFactory.getInstance("RSA").generatePublic(new X509EncodedKeySpec(key.getEncoded()));
+ } catch (InvalidKeySpecException | NoSuchAlgorithmException e) {
+ return key;
+ }
+
+ return publicKey;
+
+ }
+
+
+ public static PublicKey convert(PublicKey key, Provider provider) {
+
+ PublicKey publicKey;
+ try {
+ publicKey = KeyFactory.getInstance("RSA", provider).generatePublic(new X509EncodedKeySpec(key.getEncoded()));
+ } catch (InvalidKeySpecException | NoSuchAlgorithmException e) {
+ return key;
+ }
+
+ return publicKey;
+
+
+ }
+
+
+ public static PrivateKey convertPrivateKey(PrivateKey key) {
+
+
+ PrivateKey privateKey;
+ try {
+ privateKey = KeyFactory.getInstance("RSA").generatePrivate(new PKCS8EncodedKeySpec(key.getEncoded()));
+ } catch (InvalidKeySpecException | NoSuchAlgorithmException e) {
+ return key;
+ }
+
+ return privateKey;
+
+ }
+}
diff --git a/src/test/java/org/uic/barcode/test/DynamicFrameDoubleSignatureProviderSelectionTest.java b/src/test/java/org/uic/barcode/test/DynamicFrameDoubleSignatureProviderSelectionTest.java
index f531f70..59f3b47 100644
--- a/src/test/java/org/uic/barcode/test/DynamicFrameDoubleSignatureProviderSelectionTest.java
+++ b/src/test/java/org/uic/barcode/test/DynamicFrameDoubleSignatureProviderSelectionTest.java
@@ -1,12 +1,10 @@
package org.uic.barcode.test;
import java.io.IOException;
-import java.security.InvalidAlgorithmParameterException;
import java.security.InvalidKeyException;
import java.security.KeyPair;
import java.security.KeyPairGenerator;
import java.security.NoSuchAlgorithmException;
-import java.security.NoSuchProviderException;
import java.security.Provider;
import java.security.SecureRandom;
import java.security.Security;
@@ -28,6 +26,7 @@ import org.uic.barcode.test.utils.Level2TestDataFactory;
import org.uic.barcode.test.utils.SimpleUICTestTicket;
import org.uic.barcode.ticket.EncodingFormatException;
import org.uic.barcode.ticket.api.spec.IUicRailTicket;
+import org.uic.barcode.utils.AlgorithmNameResolver;
public class DynamicFrameDoubleSignatureProviderSelectionTest {
@@ -48,7 +47,7 @@ public class DynamicFrameDoubleSignatureProviderSelectionTest {
signatureAlgorithmOID = Constants.ECDSA_SHA256;
keyPairAlgorithmOID = Constants.KG_EC_256;
- elipticCurve = "secp256k1";
+ elipticCurve = "secp256r1";
testFCBticket = SimpleUICTestTicket.getUicTestTicket();
@@ -152,16 +151,10 @@ public class DynamicFrameDoubleSignatureProviderSelectionTest {
}
- public KeyPair generateECDSAKeys(String keyAlgorithmName, String paramName) throws NoSuchAlgorithmException, NoSuchProviderException, InvalidAlgorithmParameterException{
- ECParameterSpec ecSpec = ECNamedCurveTable.getParameterSpec(paramName);
- KeyPairGenerator g = KeyPairGenerator.getInstance(keyAlgorithmName, "BC");
- g.initialize(ecSpec, new SecureRandom());
- return g.generateKeyPair();
- }
public KeyPair generateECKeys(String keyAlgorithmOid, String curve) throws Exception{
- String keyAlgorithmName = "ECDSA";
+ String keyAlgorithmName = AlgorithmNameResolver.getName(AlgorithmNameResolver.TYPE_KEY_GENERATOR_ALG, keyAlgorithmOid);
ECParameterSpec ecSpec = ECNamedCurveTable.getParameterSpec(curve);
KeyPairGenerator g = KeyPairGenerator.getInstance(keyAlgorithmName, "BC");
g.initialize(ecSpec, new SecureRandom());
diff --git a/src/test/java/org/uic/barcode/test/DynamicFrameDoubleSignatureTest.java b/src/test/java/org/uic/barcode/test/DynamicFrameDoubleSignatureTest.java
index 160ebc1..bd0f9a4 100644
--- a/src/test/java/org/uic/barcode/test/DynamicFrameDoubleSignatureTest.java
+++ b/src/test/java/org/uic/barcode/test/DynamicFrameDoubleSignatureTest.java
@@ -1,21 +1,18 @@
package org.uic.barcode.test;
import java.io.IOException;
-import java.security.InvalidAlgorithmParameterException;
import java.security.InvalidKeyException;
import java.security.KeyPair;
import java.security.KeyPairGenerator;
import java.security.NoSuchAlgorithmException;
-import java.security.NoSuchProviderException;
import java.security.SecureRandom;
import java.security.Security;
import java.security.SignatureException;
+import java.security.spec.ECGenParameterSpec;
import java.util.Arrays;
import java.util.zip.DataFormatException;
-import org.bouncycastle.jce.ECNamedCurveTable;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
-import org.bouncycastle.jce.spec.ECParameterSpec;
import org.junit.Before;
import org.junit.Test;
import org.uic.barcode.Decoder;
@@ -27,6 +24,7 @@ import org.uic.barcode.test.utils.Level2TestDataFactory;
import org.uic.barcode.test.utils.SimpleUICTestTicket;
import org.uic.barcode.ticket.EncodingFormatException;
import org.uic.barcode.ticket.api.spec.IUicRailTicket;
+import org.uic.barcode.utils.SecurityUtils;
public class DynamicFrameDoubleSignatureTest {
@@ -46,7 +44,7 @@ public class DynamicFrameDoubleSignatureTest {
signatureAlgorithmOID = Constants.ECDSA_SHA256;
keyPairAlgorithmOID = Constants.KG_EC_256;
- elipticCurve = "secp256k1";
+ elipticCurve = "secp256r1";
testFCBticket = SimpleUICTestTicket.getUicTestTicket();
@@ -148,20 +146,17 @@ public class DynamicFrameDoubleSignatureTest {
}
- public KeyPair generateECDSAKeys(String keyAlgorithmName, String paramName) throws NoSuchAlgorithmException, NoSuchProviderException, InvalidAlgorithmParameterException{
- ECParameterSpec ecSpec = ECNamedCurveTable.getParameterSpec(paramName);
- KeyPairGenerator g = KeyPairGenerator.getInstance(keyAlgorithmName, "BC");
- g.initialize(ecSpec, new SecureRandom());
- return g.generateKeyPair();
- }
public KeyPair generateECKeys(String keyAlgorithmOid, String curve) throws Exception{
- String keyAlgorithmName = "ECDSA";
- ECParameterSpec ecSpec = ECNamedCurveTable.getParameterSpec(curve);
- KeyPairGenerator g = KeyPairGenerator.getInstance(keyAlgorithmName, "BC");
- g.initialize(ecSpec, new SecureRandom());
- return g.generateKeyPair();
+ //ECNamedCurveGenParameterSpec namedParamSpec = new ECNamedCurveGenParameterSpec(elipticCurve);
+
+ ECGenParameterSpec namedParamSpec = new ECGenParameterSpec(elipticCurve);
+ KeyPairGenerator ecKPGen = KeyPairGenerator.getInstance("EC", "BC");
+ ecKPGen.initialize(namedParamSpec, new SecureRandom());
+ KeyPair keyPair = ecKPGen.generateKeyPair();
+ KeyPair kp = new KeyPair(SecurityUtils.convertPublicKey(keyPair.getPublic()),SecurityUtils.convertPrivateKey(keyPair.getPrivate()));
+ return kp;
}
diff --git a/src/test/java/org/uic/barcode/test/DynamicFrameDynamicContentApiTest.java b/src/test/java/org/uic/barcode/test/DynamicFrameDynamicContentApiTest.java
index 4c039ff..da701bd 100644
--- a/src/test/java/org/uic/barcode/test/DynamicFrameDynamicContentApiTest.java
+++ b/src/test/java/org/uic/barcode/test/DynamicFrameDynamicContentApiTest.java
@@ -54,7 +54,7 @@ public class DynamicFrameDynamicContentApiTest {
signatureAlgorithmOID = Constants.ECDSA_SHA256;
keyPairAlgorithmOID = Constants.KG_EC_256;
- elipticCurve = "secp256k1";
+ elipticCurve = "secp256r1";
testFCBticket = SimpleUICTestTicket.getUicTestTicket();
diff --git a/src/test/java/org/uic/barcode/test/DynamicFrameDynamicContentTest.java b/src/test/java/org/uic/barcode/test/DynamicFrameDynamicContentTest.java
index 656dbb4..b91cd0c 100644
--- a/src/test/java/org/uic/barcode/test/DynamicFrameDynamicContentTest.java
+++ b/src/test/java/org/uic/barcode/test/DynamicFrameDynamicContentTest.java
@@ -57,10 +57,10 @@ public class DynamicFrameDynamicContentTest {
signatureAlgorithmOID = Constants.ECDSA_SHA256;
keyPairAlgorithmOID = Constants.KG_EC_256;
- elipticCurve = "secp256k1";
+ elipticCurve = "secp256r1";
testFCBticket = SimpleUICTestTicket.getUicTestTicket();
-
+
Security.addProvider(new BouncyCastleProvider());
try {
diff --git a/src/test/java/org/uic/barcode/test/DynamicFrameFcbVersion1Test.java b/src/test/java/org/uic/barcode/test/DynamicFrameFcbVersion1Test.java
index f5a4705..dafeb49 100644
--- a/src/test/java/org/uic/barcode/test/DynamicFrameFcbVersion1Test.java
+++ b/src/test/java/org/uic/barcode/test/DynamicFrameFcbVersion1Test.java
@@ -43,7 +43,7 @@ public class DynamicFrameFcbVersion1Test {
signatureAlgorithmOID = Constants.ECDSA_SHA256;
keyPairAlgorithmOID = Constants.KG_EC_256;
- elipticCurve = "secp256k1";
+ elipticCurve = "secp256r1";
testFCBticket = SimpleUICTestTicket.getUicTestTicket();
diff --git a/src/test/java/org/uic/barcode/test/DynamicFrameFcbVersion3Test.java b/src/test/java/org/uic/barcode/test/DynamicFrameFcbVersion3Test.java
index 4eb821a..f8a03ba 100644
--- a/src/test/java/org/uic/barcode/test/DynamicFrameFcbVersion3Test.java
+++ b/src/test/java/org/uic/barcode/test/DynamicFrameFcbVersion3Test.java
@@ -43,7 +43,7 @@ public class DynamicFrameFcbVersion3Test {
signatureAlgorithmOID = Constants.ECDSA_SHA256;
keyPairAlgorithmOID = Constants.KG_EC_256;
- elipticCurve = "secp256k1";
+ elipticCurve = "secp256r1";
testFCBticket = SimpleUICTestTicket.getUicTestTicket();
diff --git a/src/test/java/org/uic/barcode/test/DynamicFrameSimpleTest.java b/src/test/java/org/uic/barcode/test/DynamicFrameSimpleTest.java
index 2c7cce3..931324d 100644
--- a/src/test/java/org/uic/barcode/test/DynamicFrameSimpleTest.java
+++ b/src/test/java/org/uic/barcode/test/DynamicFrameSimpleTest.java
@@ -42,7 +42,7 @@ public class DynamicFrameSimpleTest {
signatureAlgorithmOID = Constants.ECDSA_SHA256;
keyPairAlgorithmOID = Constants.KG_EC_256;
- elipticCurve = "secp256k1";
+ elipticCurve = "secp256r1";
testFCBticket = SimpleUICTestTicket.getUicTestTicket();
diff --git a/src/test/java/org/uic/barcode/test/DynamicFrameV2FcbVersion3Test.java b/src/test/java/org/uic/barcode/test/DynamicFrameV2FcbVersion3Test.java
index 5fcb07a..ab4c39e 100644
--- a/src/test/java/org/uic/barcode/test/DynamicFrameV2FcbVersion3Test.java
+++ b/src/test/java/org/uic/barcode/test/DynamicFrameV2FcbVersion3Test.java
@@ -43,7 +43,7 @@ public class DynamicFrameV2FcbVersion3Test {
signatureAlgorithmOID = Constants.ECDSA_SHA256;
keyPairAlgorithmOID = Constants.KG_EC_256;
- elipticCurve = "secp256k1";
+ elipticCurve = "secp256r1";
testFCBticket = SimpleUICTestTicket.getUicTestTicket();
diff --git a/src/test/java/org/uic/barcode/test/DynamicFrameV2SignatureInsert2Test.java b/src/test/java/org/uic/barcode/test/DynamicFrameV2SignatureInsert2Test.java
index c50172b..5b5a8ae 100644
--- a/src/test/java/org/uic/barcode/test/DynamicFrameV2SignatureInsert2Test.java
+++ b/src/test/java/org/uic/barcode/test/DynamicFrameV2SignatureInsert2Test.java
@@ -54,7 +54,7 @@ public class DynamicFrameV2SignatureInsert2Test {
signatureAlgorithmOID = Constants.ECDSA_SHA256;
keyPairAlgorithmOID = Constants.KG_EC_256;
- elipticCurve = "secp256k1";
+ elipticCurve = "secp256r1";
testFCBticket = SimpleUICTestTicket.getUicTestTicket();
diff --git a/src/test/java/org/uic/barcode/test/DynamicFrameV2SignatureInsertTest.java b/src/test/java/org/uic/barcode/test/DynamicFrameV2SignatureInsertTest.java
index 90d3c2b..68be52e 100644
--- a/src/test/java/org/uic/barcode/test/DynamicFrameV2SignatureInsertTest.java
+++ b/src/test/java/org/uic/barcode/test/DynamicFrameV2SignatureInsertTest.java
@@ -54,7 +54,7 @@ public class DynamicFrameV2SignatureInsertTest {
signatureAlgorithmOID = Constants.ECDSA_SHA256;
keyPairAlgorithmOID = Constants.KG_EC_256;
- elipticCurve = "secp256k1";
+ elipticCurve = "secp256r1";
testFCBticket = SimpleUICTestTicket.getUicTestTicket();
diff --git a/src/test/java/org/uic/barcode/test/DynamicFrameV2ValidityDateTest.java b/src/test/java/org/uic/barcode/test/DynamicFrameV2ValidityDateTest.java
index d4f5d6a..a198b97 100644
--- a/src/test/java/org/uic/barcode/test/DynamicFrameV2ValidityDateTest.java
+++ b/src/test/java/org/uic/barcode/test/DynamicFrameV2ValidityDateTest.java
@@ -47,7 +47,7 @@ public class DynamicFrameV2ValidityDateTest {
signatureAlgorithmOID = Constants.ECDSA_SHA256;
keyPairAlgorithmOID = Constants.KG_EC_256;
- elipticCurve = "secp256k1";
+ elipticCurve = "secp256r1";
testFCBticket = SimpleUICTestTicket.getUicTestTicket();