xmlbeans-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alistair Young <alist...@smo.uhi.ac.uk>
Subject Re: XMLSignature support
Date Thu, 19 Jan 2006 15:46:59 GMT
aha! daft me spotted the problem. When saving the signed xml to file  
I was setting all sorts of pretty print options, which of course  
ruined the digest etc.

Works fine now: XML -> XMLBeans -> XMLSignature.sign() -> XMLBeans ->  
XML -> XMLBeans -> XMLSignature.checkSignatureValue()

Alistair


On 19 Jan 2006, at 15:04, Alistair Young wrote:

> I saw mails from last August suggesting you can't verify a  
> signature once you've loaded a doc into XMLBeans:
>
> ResponseDocument responseDocument = ResponseDocument.Factory.parse 
> (samlResponse);
> ResponseType responseType = responseDocument.getResponse();
>
> CertificateFactory certFactory = CertificateFactory.getInstance("x. 
> 509");
> ByteArrayInputStream certByteStream = new ByteArrayInputStream 
> (x509CertBytes[cc]);
> X509Certificate x509Cert = (X509Certificate) 
> certFactory.generateCertificate(certByteStream);
> certByteStream.close();
>
> SignatureType sigType = responseType.getSignature();
> XMLSignature sig = new XMLSignature((Element)sigType.getDomNode(),  
> "");
> sig.checkSignatureValue(x509Cert);
>
> always fails to verify the signature. I heard something about  
> XMLBeans not adding prefixes when loading from file.
>
> Is this still the case or is there something I can use in  
> XmlOptions when loading?
>
> thanks,
>
> Alistair
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
> For additional commands, e-mail: user-help@xmlbeans.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org


Mime
View raw message