Package com.google.crypto.tink.subtle
Interface StreamSegmentDecrypter
-
public interface StreamSegmentDecrypterStreamSegmentDecrypter is a helper class that decrypts individual segments of a stream.Instances of this interfaces are passed to
StreamingAeadDecryptingChannel. Each instance must be initialized with the header of the ciphertext.- Since:
- 1.1.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voiddecryptSegment(java.nio.ByteBuffer ciphertext, int segmentNr, boolean isLastSegment, java.nio.ByteBuffer plaintext)Decrypts a ciphetext segment.voidinit(java.nio.ByteBuffer header, byte[] aad)
-
-
-
Method Detail
-
init
void init(java.nio.ByteBuffer header, byte[] aad) throws java.security.GeneralSecurityException- Throws:
java.security.GeneralSecurityException
-
decryptSegment
void decryptSegment(java.nio.ByteBuffer ciphertext, int segmentNr, boolean isLastSegment, java.nio.ByteBuffer plaintext) throws java.security.GeneralSecurityExceptionDecrypts a ciphetext segment.- Parameters:
segmentNr- the number of the segmentisLastSegment- true if this segment is the last segment of the ciphertext stream. The last segment is encrypted (or authenticated) differently to detect truncated ciphertext.plaintext- the decrypted plaintext.- Throws:
java.security.GeneralSecurityException- if ciphertext was not a valid ciphertext for the given segment.
-
-