Skip to content

Commit

Permalink
fix: move pkcs11 initialization into plugin startup instead of install (
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeDombo authored Jul 25, 2023
1 parent 946d5e5 commit b982d65
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -167,13 +167,14 @@ protected void install() throws InterruptedException {
throw new RuntimeException(String.format("Failed to install PKCS11CryptoKeyService. "
+ "Make sure that configuration format for %s service is valid.", PKCS11_SERVICE_NAME));
}
if (!initializePkcs11Lib() || !initializePkcs11Provider()) {
serviceErrored("Can't initialize PKCS11");
}
}

@Override
protected void startup() throws InterruptedException {
if (!initializePkcs11Lib() || !initializePkcs11Provider()) {
serviceErrored("Can't initialize PKCS11");
return;
}
try {
securityService.registerCryptoKeyProvider(this);
securityService.registerMqttConnectionProvider(this);
Expand Down

0 comments on commit b982d65

Please sign in to comment.