diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/java/org/uic/barcode/test/SsbFrameBarcodeTestGroup.java | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/test/java/org/uic/barcode/test/SsbFrameBarcodeTestGroup.java b/src/test/java/org/uic/barcode/test/SsbFrameBarcodeTestGroup.java index f6ec58b..b0f1589 100644 --- a/src/test/java/org/uic/barcode/test/SsbFrameBarcodeTestGroup.java +++ b/src/test/java/org/uic/barcode/test/SsbFrameBarcodeTestGroup.java @@ -7,6 +7,7 @@ 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;
import java.security.SignatureException;
@@ -40,6 +41,8 @@ public class SsbFrameBarcodeTestGroup { public SsbFrame ssbFrame = null;
+ public Provider provider = null;
+
/**
* Initialize.
*
@@ -55,7 +58,8 @@ public class SsbFrameBarcodeTestGroup { algorithmOID = Constants.DSA_SHA224;
keySize = 1024;
- Security.addProvider(new BouncyCastleProvider());
+ provider = new BouncyCastleProvider();
+ Security.addProvider(provider);
try {
keyPair = generateDSAKeys(keySize);
@@ -90,7 +94,7 @@ public class SsbFrameBarcodeTestGroup { assert(enc != null);
try {
- enc.signLevel1("1080", keyPair.getPrivate(), algorithmOID, "1");
+ enc.signLevel1("1080", keyPair.getPrivate(), algorithmOID, "1",provider);
} catch (Exception e) {
assert(false);
}
@@ -129,7 +133,7 @@ public class SsbFrameBarcodeTestGroup { assert(enc != null);
try {
- enc.signLevel1("4711", keyPair.getPrivate(), algorithmOID, "1");
+ enc.signLevel1("4711", keyPair.getPrivate(), algorithmOID, "1", provider);
} catch (Exception e) {
assert(false);
}
@@ -158,7 +162,7 @@ public class SsbFrameBarcodeTestGroup { int signatureCheck = 0;
try {
- signatureCheck = dec.validateLevel1(keyPair.getPublic(),algorithmOID);
+ signatureCheck = dec.validateLevel1(keyPair.getPublic(),algorithmOID,provider);
} catch (InvalidKeyException | NoSuchAlgorithmException | SignatureException | IllegalArgumentException
| UnsupportedOperationException | IOException | EncodingFormatException e) {
assert(false);
|