Package org.apache.pulsar.client.api
Interface MessageCrypto<MetadataT,BuilderT>
-
-
Field Summary
Fields Modifier and Type Field Description static intIV_LEN
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddPublicKeyCipher(java.util.Set<java.lang.String> keyNames, CryptoKeyReader keyReader)booleandecrypt(java.util.function.Supplier<MetadataT> messageMetadataSupplier, java.nio.ByteBuffer payload, java.nio.ByteBuffer outBuffer, CryptoKeyReader keyReader)voidencrypt(java.util.Set<java.lang.String> encKeys, CryptoKeyReader keyReader, java.util.function.Supplier<BuilderT> messageMetadataBuilderSupplier, java.nio.ByteBuffer payload, java.nio.ByteBuffer outBuffer)intgetMaxOutputSize(int inputLen)Return the maximum for a given buffer to be encrypted or decrypted.booleanremoveKeyCipher(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)
-
-