diff options
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();
|