private byte[] _canonicalize(XMLSignatureInput input) throws Exception {
byte[] inputContentBytes = input.getBytes();
//ContentType contentType = new ContentType(((AttachmentSignatureInput)input).getContentType());
// rf. RFC822
MimeHeaderCanonicalizer mHCanonicalizer = CanonicalizerFactory.getMimeHeaderCanonicalizer("US-ASCII");
byte[] outputHeaderBytes = mHCanonicalizer._canonicalize( ((AttachmentSignatureInput)input).getMimeHeaders().iterator());
Canonicalizer canonicalizer =
CanonicalizerFactory.
getCanonicalizer(((AttachmentSignatureInput)input).getContentType());
byte[] outputContentBytes = canonicalizer.canonicalize(inputContentBytes);