JceCtrCryptoCodec.JceCtrCipher, OpensslCtrCryptoCodec.OpensslCtrCipher@Private
@Evolving
public interface Decryptor
| Modifier and Type | Method | Description |
|---|---|---|
void |
decrypt(java.nio.ByteBuffer inBuffer,
java.nio.ByteBuffer outBuffer) |
This presents a direct interface decrypting with direct ByteBuffers.
|
void |
init(byte[] key,
byte[] iv) |
Initialize the decryptor and the internal decryption context.
|
boolean |
isContextReset() |
Indicate whether the decryption context is reset.
|
void init(byte[] key,
byte[] iv)
throws java.io.IOException
key - decryption key.iv - decryption initialization vectorjava.io.IOException - if initialization failsboolean isContextReset()
Certain modes, like CTR, require a different IV depending on the position in the stream. Generally, the decryptor maintains any necessary context for calculating the IV and counter so that no reinit is necessary during the decryption. Reinit before each operation is inefficient.
void decrypt(java.nio.ByteBuffer inBuffer,
java.nio.ByteBuffer outBuffer)
throws java.io.IOException
This function does not always decrypt the entire buffer and may potentially need to be called multiple times to process an entire buffer. The object may hold the decryption context internally.
Some implementations may require sufficient space in the destination buffer to decrypt the entire input buffer.
Upon return, inBuffer.position() will be advanced by the number of bytes read and outBuffer.position() by bytes written. Implementations should not modify inBuffer.limit() and outBuffer.limit().
inBuffer - a direct ByteBuffer to read from. inBuffer may
not be null and inBuffer.remaining() must be > 0outBuffer - a direct ByteBuffer to write to. outBuffer may
not be null and outBuffer.remaining() must be > 0java.io.IOException - if decryption failsCopyright © 2008–2025 Apache Software Foundation. All rights reserved.