code: public void initializePKCS11ImplProvider(String tokenConfigName) throws Exception {
          final String configFile = tokenConfigName;
          try {
              hwProvider = AccessController.doPrivileged(new PrivilegedExceptionAction<Provider>() {
                  @Override
                  public Provider run() throws Exception {
                      Provider p = createPKCS11Provider(configFile);
                      // if no provider found throw ProviderException
                      if (p == null) {
                          throw new ProviderException("No PKCS11 provider available.");
                      }
                      Security.addProvider(p);
                      if (tc.isDebugEnabled())
                          Tr.debug(tc, "The provider: " + p + "is added at the end of the provider list");
                      return p;
                  }
              });
          } catch (PrivilegedActionException e) {
              Exception ex = e.getException();
              if (tc.isDebugEnabled())
                  Tr.debug(tc, "Cannot initialize IBMPKCS11Impl provider: " + ex);
              FFDCFilter.processException(ex, getClass().getName(), "initializePKCS11ImplProvider");
              throw ex;
          }
      }
docs: /*
  Initalizes the pkcs11 provider and add it to the Security provider list