From c45fc85b78f3d8701346a231f07b7ffa984ca4ed Mon Sep 17 00:00:00 2001 From: CGantert345 <57003061+CGantert345@users.noreply.github.com> Date: Fri, 23 Apr 2021 13:41:58 +0200 Subject: update --- src/main/java/org/uic/barcode/staticFrame/StaticFrame.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/main/java/org/uic/barcode/staticFrame/StaticFrame.java') 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(); -- cgit v1.2.3