summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCGantert345 <57003061+CGantert345@users.noreply.github.com>2022-05-02 10:00:40 +0200
committerCGantert345 <57003061+CGantert345@users.noreply.github.com>2022-05-02 10:00:40 +0200
commit2ecd0bdcbd06e580671ebf16904655a2a56ddba5 (patch)
treeef763df07e8317a93cb9d30cd932a8676c550402
parentnull pointer exception fixed (diff)
downloadUIC-barcode-2ecd0bdcbd06e580671ebf16904655a2a56ddba5.tar
UIC-barcode-2ecd0bdcbd06e580671ebf16904655a2a56ddba5.tar.gz
UIC-barcode-2ecd0bdcbd06e580671ebf16904655a2a56ddba5.tar.bz2
UIC-barcode-2ecd0bdcbd06e580671ebf16904655a2a56ddba5.tar.lz
UIC-barcode-2ecd0bdcbd06e580671ebf16904655a2a56ddba5.tar.xz
UIC-barcode-2ecd0bdcbd06e580671ebf16904655a2a56ddba5.tar.zst
UIC-barcode-2ecd0bdcbd06e580671ebf16904655a2a56ddba5.zip
Diffstat (limited to '')
-rw-r--r--src/main/java/org/uic/barcode/dynamicFrame/api/SimpleDynamicFrame.java8
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 {