summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/main/java/org/uic/barcode/utils/SecurityUtils.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main/java/org/uic/barcode/utils/SecurityUtils.java b/src/main/java/org/uic/barcode/utils/SecurityUtils.java
index 1fcc18a..fc6a135 100644
--- a/src/main/java/org/uic/barcode/utils/SecurityUtils.java
+++ b/src/main/java/org/uic/barcode/utils/SecurityUtils.java
@@ -68,7 +68,10 @@ public class SecurityUtils {
String name = key.getAlgorithm();
byte[] keyBytes = key.getEncoded();
-
+
+ if (keyBytes == null || keyBytes.length == 0) {
+ return null;
+ }
PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(keyBytes);