Class CertificateProviderStore

java.lang.Object
io.grpc.xds.internal.security.certprovider.CertificateProviderStore

@ThreadSafe public final class CertificateProviderStore extends Object
Global map of all ref-counted CertificateProviders that have been instantiated in the application. Also propagates updates received from a CertificateProvider to all the CertificateProvider.Watchers registered for that CertificateProvider. The Store is meant to be used internally by gRPC and *not* a public API.
  • Constructor Details

  • Method Details

    • createOrGetProvider

      public io.grpc.xds.internal.security.certprovider.CertificateProviderStore.Handle createOrGetProvider(String certName, String pluginName, Object config, CertificateProvider.Watcher watcher, boolean notifyCertUpdates)
      Creates or retrieves a CertificateProvider instance, increments its ref-count and registers the watcher passed. Returns a CertificateProviderStore.Handle that can be Closeable.close()d when the instance is no longer needed by the caller.
      Parameters:
      notifyCertUpdates - when true, the caller is interested in identity cert updates. When false, the caller cannot depend on receiving the CertificateProvider.Watcher.updateCertificate(PrivateKey, List) callbacks but may still receive these callbacks which should be ignored.
      Throws:
      IllegalArgumentException - in case of errors in processing config or the plugin is incapable of sending cert updates when notifyCertUpdates is true.
      UnsupportedOperationException - if the plugin is incapable of sending cert updates when notifyCertUpdates is true.
    • getInstance

      public static CertificateProviderStore getInstance()
      Gets the CertificateProviderStore singleton instance.