diff options
Diffstat (limited to 'src/test/java/org/uic/barcode')
-rw-r--r-- | src/test/java/org/uic/barcode/test/DynamicFrameDoubleSignatureTest.java | 8 | ||||
-rw-r--r-- | src/test/java/org/uic/barcode/test/DynamicFrameFcbVersion3Test.java | 8 |
2 files changed, 7 insertions, 9 deletions
diff --git a/src/test/java/org/uic/barcode/test/DynamicFrameDoubleSignatureTest.java b/src/test/java/org/uic/barcode/test/DynamicFrameDoubleSignatureTest.java index bd0f9a4..6533938 100644 --- a/src/test/java/org/uic/barcode/test/DynamicFrameDoubleSignatureTest.java +++ b/src/test/java/org/uic/barcode/test/DynamicFrameDoubleSignatureTest.java @@ -5,6 +5,7 @@ import java.security.InvalidKeyException; import java.security.KeyPair;
import java.security.KeyPairGenerator;
import java.security.NoSuchAlgorithmException;
+import java.security.Provider;
import java.security.SecureRandom;
import java.security.Security;
import java.security.SignatureException;
@@ -37,6 +38,8 @@ public class DynamicFrameDoubleSignatureTest { public IUicRailTicket testFCBticket = null;
+ public Provider provider = null;
+
@Before public void initialize() {
@@ -44,10 +47,11 @@ public class DynamicFrameDoubleSignatureTest { signatureAlgorithmOID = Constants.ECDSA_SHA256;
keyPairAlgorithmOID = Constants.KG_EC_256;
- elipticCurve = "secp256r1";
+ elipticCurve = "secp256k1";
testFCBticket = SimpleUICTestTicket.getUicTestTicket();
+ provider = new BouncyCastleProvider();
Security.addProvider(new BouncyCastleProvider());
try {
@@ -155,7 +159,7 @@ public class DynamicFrameDoubleSignatureTest { 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()));
+ KeyPair kp = new KeyPair(SecurityUtils.convert(keyPair.getPublic(), provider),SecurityUtils.convert(keyPair.getPrivate(), provider));
return kp;
}
diff --git a/src/test/java/org/uic/barcode/test/DynamicFrameFcbVersion3Test.java b/src/test/java/org/uic/barcode/test/DynamicFrameFcbVersion3Test.java index f8a03ba..7f03658 100644 --- a/src/test/java/org/uic/barcode/test/DynamicFrameFcbVersion3Test.java +++ b/src/test/java/org/uic/barcode/test/DynamicFrameFcbVersion3Test.java @@ -159,13 +159,7 @@ public class DynamicFrameFcbVersion3Test { }
- 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";
|