Interface PublicKeyProvider

All Known Subinterfaces:
CryptoKeyProvider
All Known Implementing Classes:
PemFileKeyProvider

public interface PublicKeyProvider
Producer-side SPI: load a public key by name for end-to-end message encryption.

The provider is consulted at producer creation time and on every key rotation. The signature is asynchronous so an implementation backed by a remote KMS (Vault, AWS KMS, GCP KMS, ...) can fetch keys without blocking the client's IO thread. For local key stores, return a completed future.

For a simple file-based provider, see PemFileKeyProvider.

  • Method Details

    • getPublicKey

      CompletableFuture<EncryptionKey> getPublicKey(String keyName)
      Look up the public key with the given name.
      Parameters:
      keyName - the key identifier as configured on the producer
      Returns:
      a future completing with the public key, or completing exceptionally if the key cannot be found or loaded