fs.writeFilesystem(bos);
bos.close();
fs = new POIFSFileSystem(new ByteArrayInputStream(bos.toByteArray()));
info = new EncryptionInfo(fs);
AgileDecryptor agDec = (AgileDecryptor)info.getDecryptor();
boolean passed = agDec.verifyPassword(certData.keypair, certData.x509);
assertTrue("certificate verification failed", passed);
fis = agDec.getDataStream(fs);
byte byteActual[] = IOUtils.toByteArray(fis);
fis.close();
assertThat(byteExpected, equalTo(byteActual));
}