code: private static CertificateProvider newCertificateProvider(ComponentManager manager, Store store)
          throws GeneralSecurityException
      {
          try {
              CertificateProvider provider = manager.getInstance(CertificateProvider.class, "BCStoreX509");
              ((BcStoreX509CertificateProvider) provider).setStore(store);
  
              return provider;
          } catch (ComponentLookupException e) {
              throw new GeneralSecurityException("Unable to initialize the certificates store", e);
          }
      }
docs: Wrap a bouncy castle store into an adapter for the CertificateProvider interface.
  
  @param manager the component manager.
  @param store the store.
  @return a certificate provider wrapping the store.
  @throws GeneralSecurityException if unable to initialize the provider.