Map<String, Object> transformerProperties = new HashMap<String, Object>(2);
transformerProperties.put(
AttachmentContentSignatureTransform.ATTACHMENT, attachment);
transformer.setProperties(transformerProperties);
transformer.transform(inputStream);
transformer.doFinal();
digestOutputStream.close();
//reset the inputStream to be able to reuse it
inputStream.reset();