aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/api/PdfAsFactory.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/api/PdfAsFactory.java b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/api/PdfAsFactory.java
index a96d6690..92b690cf 100644
--- a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/api/PdfAsFactory.java
+++ b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/api/PdfAsFactory.java
@@ -70,7 +70,12 @@ public class PdfAsFactory {
if (Security.getProvider(name) == null) {
// register IAIK provider at first position
try {
- Security.insertProviderAt(provider, position);
+ if(position < 0) {
+ // add provider add default position.
+ Security.addProvider(provider);
+ } else {
+ Security.insertProviderAt(provider, position);
+ }
} catch (SecurityException e) {
logger.info("Failed to register required security Provider.", e);
}
@@ -97,7 +102,8 @@ public class PdfAsFactory {
//IAIK.addAsProvider();
//ECCelerate.addAsProvider();
registerProvider(new IAIK(), 1);
- registerProvider(new ECCelerate(), 2);
+ registerProvider(new ECCelerate(), -1);
+ //registerProvider(new ECCelerate(), 2);
System.out
.println("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++");