Package org.apache.pulsar.client.api
Interface MessageCrypto<MetadataT,BuilderT>
-
-
Field Summary
Fields Modifier and Type Field Description static int
IV_LEN
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addPublicKeyCipher(java.util.Set<java.lang.String> keyNames, CryptoKeyReader keyReader)
boolean
decrypt(java.util.function.Supplier<MetadataT> messageMetadataSupplier, java.nio.ByteBuffer payload, java.nio.ByteBuffer outBuffer, CryptoKeyReader keyReader)
void
encrypt(java.util.Set<java.lang.String> encKeys, CryptoKeyReader keyReader, java.util.function.Supplier<BuilderT> messageMetadataBuilderSupplier, java.nio.ByteBuffer payload, java.nio.ByteBuffer outBuffer)
int
getMaxOutputSize(int inputLen)
Return the maximum for a given buffer to be encrypted or decrypted.boolean
removeKeyCipher(java.lang.String keyName)
-
-
-
Field Detail
-
IV_LEN
static final int IV_LEN
- See Also:
- Constant Field Values
-
-
Method Detail
-
addPublicKeyCipher
void addPublicKeyCipher(java.util.Set<java.lang.String> keyNames, CryptoKeyReader keyReader) throws PulsarClientException.CryptoException
-
removeKeyCipher
boolean removeKeyCipher(java.lang.String keyName)
-
getMaxOutputSize
int getMaxOutputSize(int inputLen)
Return the maximum for a given buffer to be encrypted or decrypted. This is meant to allow to pre-allocate a buffer with enough space to be passed as- Parameters:
inputLen
- the length of the input buffer- Returns:
- the maximum size of the buffer to hold the encrypted/decrypted version of the input buffer
-
encrypt
void encrypt(java.util.Set<java.lang.String> encKeys, CryptoKeyReader keyReader, java.util.function.Supplier<BuilderT> messageMetadataBuilderSupplier, java.nio.ByteBuffer payload, java.nio.ByteBuffer outBuffer) throws PulsarClientException
- Throws:
PulsarClientException
-
decrypt
boolean decrypt(java.util.function.Supplier<MetadataT> messageMetadataSupplier, java.nio.ByteBuffer payload, java.nio.ByteBuffer outBuffer, CryptoKeyReader keyReader)
-
-