diff options
-rw-r--r-- | src/main/java/org/uic/barcode/dynamicFrame/api/SimpleDynamicFrame.java | 8 |
1 files changed, 5 insertions, 3 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 59ccd52..ae1b4e2 100644 --- a/src/main/java/org/uic/barcode/dynamicFrame/api/SimpleDynamicFrame.java +++ b/src/main/java/org/uic/barcode/dynamicFrame/api/SimpleDynamicFrame.java @@ -361,13 +361,15 @@ public class SimpleDynamicFrame implements IDynamicFrame { */
@Override
public void signLevel2(PrivateKey key, Provider prov) throws Exception {
+
+ if (prov == null) {
+ prov = SecurityUtils.findPrivateKeyProvider(key);
+ }
//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 {
|