throws IOException, SAXException, TikaException {
try {
CMSSignedDataParser parser =
new CMSSignedDataParser(new CloseShieldInputStream(stream));
try {
CMSTypedStream content = parser.getSignedContent();
if (content == null) {
throw new TikaException("cannot parse detached pkcs7 signature (no signed data to parse)");
}
InputStream input = content.getContentStream();
try {
Parser delegate =
context.get(Parser.class, EmptyParser.INSTANCE);
delegate.parse(input, handler, metadata, context);
} finally {