{
cipherOutput = cipher.doFinal(plaintext);
}
catch (IllegalBlockSizeException | BadPaddingException e)
{
throw new JoseException(e.toString(), e);
}
CipherOutput result = new CipherOutput();
int tagIndex = cipherOutput.length - tagByteLength;
result.ciphertext = ByteUtil.subArray(cipherOutput, 0, tagIndex);