diff options
author | CGantert345 <57003061+CGantert345@users.noreply.github.com> | 2021-05-12 14:15:18 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-12 14:15:18 +0200 |
commit | 18ba6785f9c8f271c0886496e6b8ed7cd0005333 (patch) | |
tree | 3aaf04d2c909fda779e173edad48923b552c13fd /src/main/java/org/uic/barcode/staticFrame/StaticFrame.java | |
parent | Merge pull request #22 from irrationalism/feature/restructure-pom (diff) | |
parent | Merge branch 'master' into asn1_comments_1 (diff) | |
download | UIC-barcode-18ba6785f9c8f271c0886496e6b8ed7cd0005333.tar UIC-barcode-18ba6785f9c8f271c0886496e6b8ed7cd0005333.tar.gz UIC-barcode-18ba6785f9c8f271c0886496e6b8ed7cd0005333.tar.bz2 UIC-barcode-18ba6785f9c8f271c0886496e6b8ed7cd0005333.tar.lz UIC-barcode-18ba6785f9c8f271c0886496e6b8ed7cd0005333.tar.xz UIC-barcode-18ba6785f9c8f271c0886496e6b8ed7cd0005333.tar.zst UIC-barcode-18ba6785f9c8f271c0886496e6b8ed7cd0005333.zip |
Diffstat (limited to 'src/main/java/org/uic/barcode/staticFrame/StaticFrame.java')
-rw-r--r-- | src/main/java/org/uic/barcode/staticFrame/StaticFrame.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/main/java/org/uic/barcode/staticFrame/StaticFrame.java b/src/main/java/org/uic/barcode/staticFrame/StaticFrame.java index 639af69..2759bf0 100644 --- a/src/main/java/org/uic/barcode/staticFrame/StaticFrame.java +++ b/src/main/java/org/uic/barcode/staticFrame/StaticFrame.java @@ -655,7 +655,7 @@ public class StaticFrame { * @throws NoSuchAlgorithmException the no such algorithm exception
* @throws SignatureException the signature exception
* @throws IllegalArgumentException the illegal argument exception
- * @throws UnsupportedOperationException the unsupported operatign exception
+ * @throws UnsupportedOperationException the unsupported operating exception
* @throws EncodingFormatException
* @throws IOException
*/
@@ -669,6 +669,9 @@ public class StaticFrame { algo = service.getAlgorithm();
}
}
+ if (algo == null) {
+ throw new NoSuchAlgorithmException("No service for algorithm found: " + signingAlg);
+ }
Signature sig = Signature.getInstance(algo);
sig.initVerify(key);
sig.update(getDataForSignature());
@@ -697,8 +700,12 @@ public class StaticFrame { Service service = prov.getService("Signature",signingAlg);
if (service != null) {
algo = service.getAlgorithm();
+ break;
}
}
+ if (algo == null) {
+ throw new NoSuchAlgorithmException("No service for algorthm found: " + signingAlg);
+ }
Signature sig = Signature.getInstance(algo);
sig.initSign(key);
signedData = getDataForSignature();
|