diff options
Diffstat (limited to 'src/main/java/org/uic/barcode/utils')
-rw-r--r-- | src/main/java/org/uic/barcode/utils/AlgorithmNameResolver.java | 14 | ||||
-rw-r--r-- | src/main/java/org/uic/barcode/utils/SecurityUtils.java | 5 |
2 files changed, 11 insertions, 8 deletions
diff --git a/src/main/java/org/uic/barcode/utils/AlgorithmNameResolver.java b/src/main/java/org/uic/barcode/utils/AlgorithmNameResolver.java index 28f90e6..16cd638 100644 --- a/src/main/java/org/uic/barcode/utils/AlgorithmNameResolver.java +++ b/src/main/java/org/uic/barcode/utils/AlgorithmNameResolver.java @@ -111,6 +111,12 @@ public class AlgorithmNameResolver { String name = null;
+ if (map.get(type) != null) {
+ if (map.get(type).get(oid) != null) {
+ return map.get(type).get(oid);
+ }
+ }
+
if (provider != null) {
Service service = provider.getService(type,oid);
if (service != null) {
@@ -133,13 +139,7 @@ public class AlgorithmNameResolver { return name;
}
}
-
- if (map.get(type) != null) {
- if (map.get(type).get(oid) != null) {
- return map.get(type).get(oid);
- }
- }
-
+
//fallback if the provider did not implement OIDs
if (oid.startsWith("1.2.840.10045.4")) {
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);
|