Static methods for obtaining
StreamingAead instances.
Usage
KeysetHandle keysetHandle = ...;
StreamingAead streamingAead = StreamingAeadFactory.getPrimitive(keysetHandle);
java.nio.channels.FileChannel ciphertextDestination =
new FileOutputStream(ciphertextFile).getChannel();
byte[] aad = ...
WritableByteChannel encryptingChannel = s.newEncryptingChannel(ciphertextDestination, aad);
while ( ... ) {
int r = encryptingChannel.write(buffer);
...
}
encryptingChannel.close();
The returned primitive works with a keyset (rather than a single key). To encrypt a plaintext,
it uses the primary key in the keyset. To decrypt, the primitive tries the enabled keys from the
keyset to select the right key for decryption. All keys in a keyset of StreamingAead have type
OutputPrefixType.RAW.