I get the same error as of previous mail for mp3 files and when I give the URL of an image file following error occurs.
Exception in thread "main" org.apache.xml.security.signature.ReferenceNotInitializedException: Invalid byte 1 of 1-byte UTF-8 sequence. Original Exception was org.apache.xml.security.signature.ReferenceNotInitializedException: Invalid byte 1 of 1-byte UTF-8 sequence. Original Exception was org.apache.xml.security.signature.XMLSignatureException: Invalid byte 1 of 1-byte UTF-8 sequence. Original Exception was org.apache.xml.security.transforms.TransformationException: Invalid byte 1 of 1-byte UTF-8 sequence. Original Exception was org.apache.xml.security.c14n.CanonicalizationException: Invalid byte 1 of 1-byte UTF-8 sequence. Original Exception was org.apache.xerces.impl.io.MalformedByteSequenceException: Invalid byte 1 of 1-byte UTF-8 sequence. at org.apache.xml.security.signature.Reference.calculateDigest(Reference.java:710) at org.apache.xml.security.signature.Reference.generateDigestValue(Reference.java:396) at org.apache.xml.security.signature.Manifest.generateDigestValues(Manifest.java:206) at org.apache.xml.security.signature.XMLSignature.sign(XMLSignature.java:595) Hope these details will be useful. On Thu, May 31, 2012 at 1:34 PM, Pushpalanka Jayawardhana < [email protected]> wrote: > Hi all, > > I want to generate a detached signature for several files of the above > types. Going through archives I tried following. > > *sig.addDocument("/home/pushpalanka/Wookie/trunk/README",transforms, > Constants.ALGO_ID_DIGEST_SHA1 );* > * > * > But it gives the error, > [Fatal Error] :1:1: Content is not allowed in prolog. > Exception in thread "main" > org.apache.xml.security.signature.ReferenceNotInitializedException: Content > is not allowed in prolog. > Original Exception was > org.apache.xml.security.signature.ReferenceNotInitializedException: Content > is not allowed in prolog. > Original Exception was > org.apache.xml.security.signature.XMLSignatureException: Content is not > allowed in prolog. > Original Exception was > org.apache.xml.security.transforms.TransformationException: Content is not > allowed in prolog. > Original Exception was > org.apache.xml.security.c14n.CanonicalizationException: Content is not > allowed in prolog. > Original Exception was org.xml.sax.SAXParseException: Content is not > allowed in prolog. > at > org.apache.xml.security.signature.Reference.calculateDigest(Reference.java:710) > at > org.apache.xml.security.signature.Reference.generateDigestValue(Reference.java:396) > at > org.apache.xml.security.signature.Manifest.generateDigestValues(Manifest.java:206) > at > org.apache.xml.security.signature.XMLSignature.sign(XMLSignature.java:595) > > I am grateful for any guidance on the correct way to do this. > -- > Pushpalanka Jayawardhana | http://pushpalankajaya.blogspot.com > > Twitter: http://twitter.com/Pushpalanka | Slideshare: > http://www.slideshare.net/Pushpalanka > > > -- Pushpalanka Jayawardhana | Undergraduate | Computer Science and Engineering University of Moratuwa +94779716248 | http://pushpalankajaya.blogspot.com Twitter: http://twitter.com/Pushpalanka | Slideshare: http://www.slideshare.net/Pushpalanka
