Class DummyCryptoKeyReaderImpl

java.lang.Object
org.apache.pulsar.client.api.DummyCryptoKeyReaderImpl
All Implemented Interfaces:
Serializable, CryptoKeyReader

public class DummyCryptoKeyReaderImpl extends Object implements CryptoKeyReader
An empty implement. Doesn't provide any public key or private key, and just returns `null`.
See Also:
  • Field Details

  • Method Details

    • getPublicKey

      public EncryptionKeyInfo getPublicKey(String keyName, Map<String,String> metadata)
      Description copied from interface: CryptoKeyReader
      Return the encryption key corresponding to the key name in the argument.

      This method should be implemented to return the EncryptionKeyInfo. This method will be called at the time of producer creation as well as consumer receiving messages. Hence, application should not make any blocking calls within the implementation.

      Specified by:
      getPublicKey in interface CryptoKeyReader
      Parameters:
      keyName - Unique name to identify the key
      metadata - Additional information needed to identify the key
      Returns:
      EncryptionKeyInfo with details about the public key
    • getPrivateKey

      public EncryptionKeyInfo getPrivateKey(String keyName, Map<String,String> metadata)
      Specified by:
      getPrivateKey in interface CryptoKeyReader
      Parameters:
      keyName - Unique name to identify the key
      metadata - Additional information needed to identify the key
      Returns:
      byte array of the private key value