Class CryptoInputStream<K extends MasterKey<K>>

java.lang.Object
java.io.InputStream
com.amazonaws.encryptionsdk.CryptoInputStream<K>
Type Parameters:
K - The type of MasterKeys used to manipulate the data.
All Implemented Interfaces:
Closeable, AutoCloseable

public class CryptoInputStream<K extends MasterKey<K>> extends InputStream
A CryptoInputStream is a subclass of java.io.InputStream. It performs cryptographic transformation of the bytes passing through it.

The CryptoInputStream wraps a provided InputStream object and performs cryptographic transformation of the bytes read from the wrapped InputStream. It uses the cryptography handler provided during construction to invoke methods that perform the cryptographic transformations.

In short, reading from the CryptoInputStream returns bytes that are the cryptographic transformations of the bytes read from the wrapped InputStream.

For example, if the cryptography handler provides methods for decryption, the CryptoInputStream will read ciphertext bytes from the wrapped InputStream, decrypt, and return them as plaintext bytes.

This class adheres strictly to the semantics, especially the failure semantics, of its ancestor class java.io.InputStream. This class overrides all the methods specified in its ancestor class.

To instantiate an instance of this class, please see AwsCrypto.