You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Mei Wu <me...@usc.edu> on 2004/03/21 03:43:24 UTC
Ws-Security ds:keyInfo for secrete key
Hi,
I am developing a message level security framework in which secrete key is
included. I am a bit confused about how to create a ds:KeyInfo for such a
secrete key, since if I follow WS-Security to create:
<ds:KeyInfo>
<wsse:SecurityTokenReference>
<wsse:Reference URI="#00001"/>
</wsse:SecurityTokenReference>
</ds:KeyInfo>
only, it will give me an AxisFault : "Didn't get a key"
org.apache.xml.security.signature.XMLSignatureException: Didn't get a key
at
org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:260)
at
org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:169)
at
org.apache.axis.encoding.DeserializationContextImpl.endElement(DeserializationContextImpl.java:1015)
at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown
Source)
at
org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
at
org.apache.axis.encoding.DeserializationContextImpl.parse(DeserializationContextImpl.java:242)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:538)
at org.apache.axis.Message.getSOAPEnvelope(Message.java:376)
at org.apache.axis.client.Call.invokeEngine(Call.java:2583)
at org.apache.axis.client.Call.invoke(Call.java:2553)
at org.apache.axis.client.Call.invoke(Call.java:1753)
at samples.security.Client.doService(Client.java:69)
at samples.security.Client.main(Client.java:95)
However, I am not able to create a <ds:KeyValue> which is not a DSA or RSA
key, I tried to create a KeyValue and pass a non-standard element (with a
wsse namespace) to it, such as :
KeyValue kv = new KeyValue(doc, securityTokenReference)
It does not seem to work, it creates an empty <ds:KeyValue> within
<ds:KeyInfo>, which again gets the same AxisFault.
I create my secrete key as:
char[] passwordchars = new char[password.length()];
SignatureAlgorithm sa = new SignatureAlgorithm(doc,
"http://www.w3.org/2000/09/xmldsig#hmac-sha1",
33);
SecretKey sk = new SecretKeySpec(password.getBytes(),
sa.getJCEAlgorithmString());
I have no idea what KeyInfo can be constructed for HMAC key.
Thanks very much.
Mei
Need help adding Object to Signature
Posted by pacow <pe...@justgive.org>.
I am working with a service that expects the soap:Body element of the request to be deuplicated within the signature in and Object, like so:
-------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<Envelope>
<Header><Signature>
<SignedInfo>[SignedInfoElements]
<Reference URI="#LocalRef">[RefElements]</Reference>
</SignedInfo>
<SignatureValue>[SigValue]</SignatureValue>
<Object Id="LocalRef"><soap:Body>[BodyElements]</soap:Body></Object>
</Signature></Header>
<soap:Body>[BodyElements]</soap:Body>
</Envelope>
-------------------------------------------------------------------------
When I try to create an ObjectContainer to add to the XMLSignature I get this exception:
"org.apache.xml.security.exceptions.XMLSecurityException:
Cannot create a {http://www.w3.org/2000/09/xmldsig#}Object from a
{http://schemas.xmlsoap.org/soap/envelope/}Body element"
Am I going about this the wrong way? Any advice would be most appreciated.
-peter
Re: Significance of 'baseURI' in XMLSignature constructor/Signing
issues
Posted by Vishal Mahajan <Vi...@Sun.COM>.
Hi Peter,
pacow wrote:
>also, I have attached a copy of my SOAP request. i add a reference in
>the signature to '#Body', do i then need to add an id='Body' attribute to
>the soap:Body tag, or elsewhere?
>
Yes, you would need to add an attribute to the soap:Body element. Adding
SOAP-SEC:id="Body" attribute to soap:Body in one of the ways to do that.
It would be better than simply putting id="Body" because the former
attribute is definitely of ID type in SOAP-SEC namespace.
Vishal
>
>thanks,
>-peter
>
>p.s. - is it a problem that the 'SignatureValue' is broken across 3 lines?
>
>
>
>------------------------------------------------------------------------
>
><?xml version="1.0" encoding="UTF-8"?>
><soapenv:Envelope soapenv:mustUnderstand="1" xmlns:SOAP-SEC="http://schemas.xmlsoap.org/soap/security/2000-12" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
> <soapenv:Header><SOAP-SEC:Signature><ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
><ds:SignedInfo>
><ds:CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/>
><ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
><ds:Reference URI="#Body">
><ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
><ds:DigestValue>2jmj7l5rSw0yVb/vlWAYkK/YBwk=</ds:DigestValue>
></ds:Reference>
></ds:SignedInfo>
><ds:SignatureValue>
>CLrgbscpDCb4jRhDuvpKKIvgY1W3wARpPuvuSVvwjBqAOjiZJL/gxOsgUMHkFHitzdm4u8/zbwfn
>SCnDSvXfwg5DusPmQOK2JR5yLYSCm32FPM5c7T4flFxZZUBtU44QY2rkhXMXZqXW+vnMinY5Cfcs
>I2JQWSVA5HSsa+7C+ek=
></ds:SignatureValue>
></ds:Signature></SOAP-SEC:Signature> </soapenv:Header>
> <soapenv:Body>
> <ns1:getMRPointsWithCard soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="urn:mraccount">
> <request href="#id0"/>
> </ns1:getMRPointsWithCard>
> <multiRef id="id0" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns2:MyWebService" xmlns:ns2="http://www.myservice.com/schemas/MyWebService" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
> <ID xsi:type="xsd:int">7777</ID>
> <PostalCode xsi:type="xsd:string">38611</PostalCode>
> <Number xsi:type="xsd:string">592009</Number>
> <requestID xsi:type="xsd:string">TestRequestId</requestID>
> <Date xsi:type="xsd:string">03/01/2008</Date>
> <clientID xsi:type="xsd:string">TestClientID</clientID>
> </multiRef>
> </soapenv:Body>
></soapenv:Envelope>
>
>
Significance of 'baseURI' in XMLSignature constructor/Signing issues
Posted by pacow <pe...@justgive.org>.
What is the significance of the variable 'baseURI' in the XMLSignature
constructor? If I am not refefring to an external file, and there are no
relative URIs in my document, can i leave baseURI blank? or is there
some way to indicate that the generated document is the location of the
baseURI? does the baseURI affect how the document is signed?
also, I have attached a copy of my SOAP request. i add a reference in
the signature to '#Body', do i then need to add an id='Body' attribute to
the soap:Body tag, or elsewhere?
thanks,
-peter
p.s. - is it a problem that the 'SignatureValue' is broken across 3 lines?
RE: Significance of 'baseURI' in XMLSignature constructor
Posted by Richard Martin <rm...@essex.ac.uk>.
Hi peter,
With regards to the baseURI I think this is explained in the FAQ. Check it
out, if it doesn't help you might want to ask the same question on the XML
security mailing list.
http://xml.apache.org/security/Java/faq.html#baseURI
The actor and mustUnderstand attribs are explained by the w3c:
http://www.w3schools.com/SOAP/soap_header.asp?output=print
Hope this helps!
Regards,
Richard
-----Original Message-----
From: pacow [mailto:peter@justgive.org]
Sent: 29 March 2004 03:44
To: axis-user@ws.apache.org
Subject: Significance of 'baseURI' in XMLSignature constructor
What is the significance of the variable 'baseURI' in the XMLSignature
constructor?
> ex: XMLSignature sig = new XMLSignature(doc, baseURI,
XMLSignature.ALGO_ID_SIGNATURE_RSA);
>
does it affect how the document is signed? also, how does it relate to
the following attributes of the '<soapenv:Envelope..>' tag?
> env.addAttribute(Constants.URI_SOAP11_ENV, "actor", "some-uri");
> env.addAttribute(Constants.URI_SOAP11_ENV, "mustUnderstand", "1");
>
finally, what is the significance of these 2 attributes? what do they need
to
refer to for the signature to be verified properly? are they even required
at all?
thanks,
-peter
Significance of 'baseURI' in XMLSignature constructor
Posted by pacow <pe...@justgive.org>.
What is the significance of the variable 'baseURI' in the XMLSignature
constructor?
> ex: XMLSignature sig = new XMLSignature(doc, baseURI, XMLSignature.ALGO_ID_SIGNATURE_RSA);
>
does it affect how the document is signed? also, how does it relate to
the following attributes of the '<soapenv:Envelope..>' tag?
> env.addAttribute(Constants.URI_SOAP11_ENV, "actor", "some-uri");
> env.addAttribute(Constants.URI_SOAP11_ENV, "mustUnderstand", "1");
>
finally, what is the significance of these 2 attributes? what do they need to
refer to for the signature to be verified properly? are they even required
at all?
thanks,
-peter
Re: XML signature format issue in request?
Posted by "Dimuthu Leelarathne." <mu...@opensource.lk>.
Hi Peter,
Are you using wss4j?
Dimuthu.
----- Original Message -----
From: "pacow" <pe...@justgive.org>
To: <ax...@ws.apache.org>
Sent: Monday, March 29, 2004 8:00 AM
Subject: XML signature format issue in request?
> I'm having trouble getting my signature verified by the host server
> (who is remote and uses ibm software), in my code i call:
>
> FileOutputStream f = new FileOutputStream(fileName);
> f.write(requestMessage.getSOAPPartAsBytes());
> f.flush();
>
> to observe the request as it is sent, one curious thing i note
> is that the signature is broken up, and displayed over three lines:
>
> <ds:SignatureValue>
>
STnDSvXfwg5DupPnQOK2JR5yLYSTn32FPM5c7T4YlFxZZUBtU44QY2rkhXMXZqXW+vnMinY5Tfcs
>
TLrgbscpDTb4jRhDuvlKKIvgY1W3wURpPuvuSVFwjBqUOjiZJL/gxOsgUMLZFLitzdn4u8/zbwfn
> I2JQWSVU5LSNa+7T+ek=
> </ds:SignatureValue>
>
> is this a problem? shouldn't it be like this:
>
>
<ds:SignatureValue>STnDSvXfwg5DupPnQOK2JR5yLYSTn32FPM5c7T4YlFxZZUBtU44QY2rkh
XMXZqXW+vnMinY5TfcsTLrgbscpDTb4jRhDuvlKKIvgY1W3wURpPuvuSVFwjBqUOjiZJL/gxOsgU
MLZFLitzdn4u8/zbwfnI2JQWSVU5LSNa+7T+ek=</ds:SignatureValue>
>
> ?
>
> thanks,
> -peter
XML signature format issue in request?
Posted by pacow <pe...@justgive.org>.
I'm having trouble getting my signature verified by the host server
(who is remote and uses ibm software), in my code i call:
FileOutputStream f = new FileOutputStream(fileName);
f.write(requestMessage.getSOAPPartAsBytes());
f.flush();
to observe the request as it is sent, one curious thing i note
is that the signature is broken up, and displayed over three lines:
<ds:SignatureValue>
STnDSvXfwg5DupPnQOK2JR5yLYSTn32FPM5c7T4YlFxZZUBtU44QY2rkhXMXZqXW+vnMinY5Tfcs
TLrgbscpDTb4jRhDuvlKKIvgY1W3wURpPuvuSVFwjBqUOjiZJL/gxOsgUMLZFLitzdn4u8/zbwfn
I2JQWSVU5LSNa+7T+ek=
</ds:SignatureValue>
is this a problem? shouldn't it be like this:
<ds:SignatureValue>STnDSvXfwg5DupPnQOK2JR5yLYSTn32FPM5c7T4YlFxZZUBtU44QY2rkhXMXZqXW+vnMinY5TfcsTLrgbscpDTb4jRhDuvlKKIvgY1W3wURpPuvuSVFwjBqUOjiZJL/gxOsgUMLZFLitzdn4u8/zbwfnI2JQWSVU5LSNa+7T+ek=</ds:SignatureValue>
?
thanks,
-peter
Re: where are the xml-Security api docs v 1.4?
Posted by Mei Wu <me...@usc.edu>.
isn't it in the src/doc? I think I downloaded the source bundle and doc is
in there.
----- Original Message -----
From: "pacow" <pe...@justgive.org>
To: <ax...@ws.apache.org>
Sent: Friday, March 26, 2004 4:43 PM
Subject: where are the xml-Security api docs v 1.4?
> where can i find the xml-Security api docs for version 1.4? \
> am i blind? i can't find them anywhere!!
>
> -peter
>
where are the xml-Security api docs v 1.4?
Posted by pacow <pe...@justgive.org>.
where can i find the xml-Security api docs for version 1.4? \
am i blind? i can't find them anywhere!!
-peter
Re: Need help signing a SOAP Request with a Digital Signature
Posted by pacow <pe...@justgive.org>.
thanks Mei, i will checkout the ClientHandler example.
-peter
Mei Wu wrote:
> Hey, the sample.security package has a simple way although it is not a wsdl
> generated client stubs, but I think you can deploy the ClientHandler to do
> it just as in the sample, so whether or not it is wsdl generated is not
> important.
>
> Mei
> ----- Original Message -----
> From: "peter anthony cowan" <pe...@justgive.org>
> To: <ax...@ws.apache.org>
> Sent: Monday, March 22, 2004 11:48 PM
> Subject: Need help signing a SOAP Request with a Digital Signature
>
> > Can anyone recommend to me or point me somewhere that describes
> > a simple, straightforward way to sign a SOAP request with a Digital
> Signature
> > within the Axis framework? I am aware of the XMLSecurity library, but
> > there doesn't seem to be a complete example for a Client.
> >
> > I am trying to transition from using the classes automatically generated
> by the
> > wsdl; is there a way to integrate these into the signing process? Any
> advice
> > would be greatly appreciated.
> >
> > -peter
> >
> >
> >
Re: Need help signing a SOAP Request with a Digital Signature
Posted by Anne Thomas Manes <an...@manes.net>.
Still alpha, and it requires Axis 1.2.
A beta should be available shortly.
At 10:55 AM 3/23/2004, you wrote:
>I have not heard of that, do you have a link?
>
>Is it production ready?
>
>thanks,
>-peter
>
>Yves Langisch wrote:
>
> > Have a look at the WSS4J project. They provide Axis handlers for signing
> > and encrypting as it is described in WS Security.
> >
> > Yves
> >
> > Mei Wu wrote:
> > > Hey, the sample.security package has a simple way although it is not
> a wsdl
> > > generated client stubs, but I think you can deploy the ClientHandler
> to do
> > > it just as in the sample, so whether or not it is wsdl generated is not
> > > important.
> > >
> > > Mei
> > > ----- Original Message -----
> > > From: "peter anthony cowan" <pe...@justgive.org>
> > > To: <ax...@ws.apache.org>
> > > Sent: Monday, March 22, 2004 11:48 PM
> > > Subject: Need help signing a SOAP Request with a Digital Signature
> > >
> > >
> > >
> > >>Can anyone recommend to me or point me somewhere that describes
> > >>a simple, straightforward way to sign a SOAP request with a Digital
> > >
> > > Signature
> > >
> > >>within the Axis framework? I am aware of the XMLSecurity library, but
> > >>there doesn't seem to be a complete example for a Client.
> > >>
> > >>I am trying to transition from using the classes automatically generated
> > >
> > > by the
> > >
> > >>wsdl; is there a way to integrate these into the signing process? Any
> > >
> > > advice
> > >
> > >>would be greatly appreciated.
> > >>
> > >>-peter
> > >>
> > >>
> > >>
> > >
> > >
> > >
~~~~~~~~~~~~~~~~~~
Anne Thomas Manes
VP & Research Director
Burton Group
Re: Need help signing a SOAP Request with a Digital Signature
Posted by Yves Langisch <li...@langisch.ch>.
Peter,
Here is the link: http://ws.apache.org/ws-fx/wss4j/
Please note that they just moved the project from sourceforge thus you
won't find lots of info. Just download the source, there you'll find
some good info and examples. AFAIK the library is not yet production
ready since there is no released standard yet for Web Service Security
but there is a lot of engagement from the Oasis group. Anyway, I made
very good experience with WSS4J.
Yves
peter anthony cowan wrote:
> I have not heard of that, do you have a link?
>
> Is it production ready?
>
> thanks,
> -peter
>
> Yves Langisch wrote:
>
>
>>Have a look at the WSS4J project. They provide Axis handlers for signing
>>and encrypting as it is described in WS Security.
>>
>>Yves
>>
>>Mei Wu wrote:
>>
>>>Hey, the sample.security package has a simple way although it is not a wsdl
>>>generated client stubs, but I think you can deploy the ClientHandler to do
>>>it just as in the sample, so whether or not it is wsdl generated is not
>>>important.
>>>
>>>Mei
>>>----- Original Message -----
>>>From: "peter anthony cowan" <pe...@justgive.org>
>>>To: <ax...@ws.apache.org>
>>>Sent: Monday, March 22, 2004 11:48 PM
>>>Subject: Need help signing a SOAP Request with a Digital Signature
>>>
>>>
>>>
>>>
>>>>Can anyone recommend to me or point me somewhere that describes
>>>>a simple, straightforward way to sign a SOAP request with a Digital
>>>
>>>Signature
>>>
>>>
>>>>within the Axis framework? I am aware of the XMLSecurity library, but
>>>>there doesn't seem to be a complete example for a Client.
>>>>
>>>>I am trying to transition from using the classes automatically generated
>>>
>>>by the
>>>
>>>
>>>>wsdl; is there a way to integrate these into the signing process? Any
>>>
>>>advice
>>>
>>>
>>>>would be greatly appreciated.
>>>>
>>>>-peter
>>>>
>>>>
>>>>
>>>
>>>
>>>
>
>
RE: Need help signing a SOAP Request with a Digital Signature
Posted by Abhinav Maheshwari <ab...@contata.co.in>.
They have not release it yet but you can subscribe to the developer mailing
list. The link is :
http://ws.apache.org/ws-fx/wss4j/index.html
You may find the following to be of use. This is another sourceforge project
for Axis security handlers.
http://axis-wsse.sourceforge.net/
Best regards,
Abhinav Maheshwari
-----Original Message-----
From: peter anthony cowan [mailto:peter@justgive.org]
Sent: Tuesday, March 23, 2004 1:57 PM
To: axis-user@ws.apache.org
Subject: Re: Need help signing a SOAP Request with a Digital Signature
I have not heard of that, do you have a link?
Is it production ready?
thanks,
-peter
Yves Langisch wrote:
> Have a look at the WSS4J project. They provide Axis handlers for signing
> and encrypting as it is described in WS Security.
>
> Yves
>
> Mei Wu wrote:
> > Hey, the sample.security package has a simple way although it is not a
wsdl
> > generated client stubs, but I think you can deploy the ClientHandler to
do
> > it just as in the sample, so whether or not it is wsdl generated is not
> > important.
> >
> > Mei
> > ----- Original Message -----
> > From: "peter anthony cowan" <pe...@justgive.org>
> > To: <ax...@ws.apache.org>
> > Sent: Monday, March 22, 2004 11:48 PM
> > Subject: Need help signing a SOAP Request with a Digital Signature
> >
> >
> >
> >>Can anyone recommend to me or point me somewhere that describes
> >>a simple, straightforward way to sign a SOAP request with a Digital
> >
> > Signature
> >
> >>within the Axis framework? I am aware of the XMLSecurity library, but
> >>there doesn't seem to be a complete example for a Client.
> >>
> >>I am trying to transition from using the classes automatically generated
> >
> > by the
> >
> >>wsdl; is there a way to integrate these into the signing process? Any
> >
> > advice
> >
> >>would be greatly appreciated.
> >>
> >>-peter
> >>
> >>
> >>
> >
> >
> >
Re: Need help signing a SOAP Request with a Digital Signature
Posted by peter anthony cowan <pe...@justgive.org>.
I have not heard of that, do you have a link?
Is it production ready?
thanks,
-peter
Yves Langisch wrote:
> Have a look at the WSS4J project. They provide Axis handlers for signing
> and encrypting as it is described in WS Security.
>
> Yves
>
> Mei Wu wrote:
> > Hey, the sample.security package has a simple way although it is not a wsdl
> > generated client stubs, but I think you can deploy the ClientHandler to do
> > it just as in the sample, so whether or not it is wsdl generated is not
> > important.
> >
> > Mei
> > ----- Original Message -----
> > From: "peter anthony cowan" <pe...@justgive.org>
> > To: <ax...@ws.apache.org>
> > Sent: Monday, March 22, 2004 11:48 PM
> > Subject: Need help signing a SOAP Request with a Digital Signature
> >
> >
> >
> >>Can anyone recommend to me or point me somewhere that describes
> >>a simple, straightforward way to sign a SOAP request with a Digital
> >
> > Signature
> >
> >>within the Axis framework? I am aware of the XMLSecurity library, but
> >>there doesn't seem to be a complete example for a Client.
> >>
> >>I am trying to transition from using the classes automatically generated
> >
> > by the
> >
> >>wsdl; is there a way to integrate these into the signing process? Any
> >
> > advice
> >
> >>would be greatly appreciated.
> >>
> >>-peter
> >>
> >>
> >>
> >
> >
> >
Re: Need help signing a SOAP Request with a Digital Signature
Posted by Yves Langisch <li...@langisch.ch>.
Have a look at the WSS4J project. They provide Axis handlers for signing
and encrypting as it is described in WS Security.
Yves
Mei Wu wrote:
> Hey, the sample.security package has a simple way although it is not a wsdl
> generated client stubs, but I think you can deploy the ClientHandler to do
> it just as in the sample, so whether or not it is wsdl generated is not
> important.
>
> Mei
> ----- Original Message -----
> From: "peter anthony cowan" <pe...@justgive.org>
> To: <ax...@ws.apache.org>
> Sent: Monday, March 22, 2004 11:48 PM
> Subject: Need help signing a SOAP Request with a Digital Signature
>
>
>
>>Can anyone recommend to me or point me somewhere that describes
>>a simple, straightforward way to sign a SOAP request with a Digital
>
> Signature
>
>>within the Axis framework? I am aware of the XMLSecurity library, but
>>there doesn't seem to be a complete example for a Client.
>>
>>I am trying to transition from using the classes automatically generated
>
> by the
>
>>wsdl; is there a way to integrate these into the signing process? Any
>
> advice
>
>>would be greatly appreciated.
>>
>>-peter
>>
>>
>>
>
>
>
AW: Need help signing a SOAP Request with a Digital Signature
Posted by yla <li...@langisch.ch>.
Peter,
Check-out WSS4J: http://ws.apache.org/ws-fx/wss4j/
Regards,
Yves
-----Ursprüngliche Nachricht-----
Von: pacow [mailto:peter@justgive.org]
Gesendet: Donnerstag, 25. März 2004 21:52
An: axis-user@ws.apache.org
Betreff: Re: Need help signing a SOAP Request with a Digital Signature
There is no such sample in my xmlsec package(v.1.4), what is the full
path and classname? can someone who has this sample forward me a copy?
thanks.
-peter
Mei Wu wrote:
> Hey, the sample.security package has a simple way although it is not a
> wsdl generated client stubs, but I think you can deploy the
> ClientHandler to do it just as in the sample, so whether or not it is
> wsdl generated is not important.
>
> Mei
> ----- Original Message -----
> From: "peter anthony cowan" <pe...@justgive.org>
> To: <ax...@ws.apache.org>
> Sent: Monday, March 22, 2004 11:48 PM
> Subject: Need help signing a SOAP Request with a Digital Signature
>
> > Can anyone recommend to me or point me somewhere that describes a
> > simple, straightforward way to sign a SOAP request with a Digital
> Signature
> > within the Axis framework? I am aware of the XMLSecurity library,
> > but there doesn't seem to be a complete example for a Client.
> >
> > I am trying to transition from using the classes automatically
> > generated
> by the
> > wsdl; is there a way to integrate these into the signing process?
> > Any
> advice
> > would be greatly appreciated.
> >
> > -peter
> >
> >
> >
Re: Need help signing a SOAP Request with a Digital Signature
Posted by pacow <pe...@justgive.org>.
There is no such sample in my xmlsec package(v.1.4), what is the full path and
classname? can someone who has this sample forward me a copy? thanks.
-peter
Mei Wu wrote:
> Hey, the sample.security package has a simple way although it is not a wsdl
> generated client stubs, but I think you can deploy the ClientHandler to do
> it just as in the sample, so whether or not it is wsdl generated is not
> important.
>
> Mei
> ----- Original Message -----
> From: "peter anthony cowan" <pe...@justgive.org>
> To: <ax...@ws.apache.org>
> Sent: Monday, March 22, 2004 11:48 PM
> Subject: Need help signing a SOAP Request with a Digital Signature
>
> > Can anyone recommend to me or point me somewhere that describes
> > a simple, straightforward way to sign a SOAP request with a Digital
> Signature
> > within the Axis framework? I am aware of the XMLSecurity library, but
> > there doesn't seem to be a complete example for a Client.
> >
> > I am trying to transition from using the classes automatically generated
> by the
> > wsdl; is there a way to integrate these into the signing process? Any
> advice
> > would be greatly appreciated.
> >
> > -peter
> >
> >
> >
Re: Need help signing a SOAP Request with a Digital Signature
Posted by Mei Wu <me...@usc.edu>.
I think I use 1.4 src/bin for xml security plug-in, and it works fine.
----- Original Message -----
From: "pacow" <pe...@justgive.org>
To: <ax...@ws.apache.org>
Sent: Thursday, March 25, 2004 12:06 AM
Subject: Re: Need help signing a SOAP Request with a Digital Signature
> At the xml sexurity site it looks like there is a version 1.4 w/src, and a
> version 2.0 as binary, but i can find absolutely no information about
> v.2.0 on the site, or elsewhere. what is the story with this? can v.2.0
> just be plugged into the lib directory of a web app an be used? it looks
> like there may be some version inconsistencies with java 1.4+.
>
> thanks,
> -peter
>
> Mei Wu wrote:
>
> > Hey, the sample.security package has a simple way although it is not a
wsdl
> > generated client stubs, but I think you can deploy the ClientHandler to
do
> > it just as in the sample, so whether or not it is wsdl generated is not
> > important.
> >
> > Mei
> > ----- Original Message -----
> > From: "peter anthony cowan" <pe...@justgive.org>
> > To: <ax...@ws.apache.org>
> > Sent: Monday, March 22, 2004 11:48 PM
> > Subject: Need help signing a SOAP Request with a Digital Signature
> >
> > > Can anyone recommend to me or point me somewhere that describes
> > > a simple, straightforward way to sign a SOAP request with a Digital
> > Signature
> > > within the Axis framework? I am aware of the XMLSecurity library, but
> > > there doesn't seem to be a complete example for a Client.
> > >
> > > I am trying to transition from using the classes automatically
generated
> > by the
> > > wsdl; is there a way to integrate these into the signing process? Any
> > advice
> > > would be greatly appreciated.
> > >
> > > -peter
> > >
> > >
> > >
>
Re: Need help signing a SOAP Request with a Digital Signature
Posted by pacow <pe...@justgive.org>.
At the xml sexurity site it looks like there is a version 1.4 w/src, and a
version 2.0 as binary, but i can find absolutely no information about
v.2.0 on the site, or elsewhere. what is the story with this? can v.2.0
just be plugged into the lib directory of a web app an be used? it looks
like there may be some version inconsistencies with java 1.4+.
thanks,
-peter
Mei Wu wrote:
> Hey, the sample.security package has a simple way although it is not a wsdl
> generated client stubs, but I think you can deploy the ClientHandler to do
> it just as in the sample, so whether or not it is wsdl generated is not
> important.
>
> Mei
> ----- Original Message -----
> From: "peter anthony cowan" <pe...@justgive.org>
> To: <ax...@ws.apache.org>
> Sent: Monday, March 22, 2004 11:48 PM
> Subject: Need help signing a SOAP Request with a Digital Signature
>
> > Can anyone recommend to me or point me somewhere that describes
> > a simple, straightforward way to sign a SOAP request with a Digital
> Signature
> > within the Axis framework? I am aware of the XMLSecurity library, but
> > there doesn't seem to be a complete example for a Client.
> >
> > I am trying to transition from using the classes automatically generated
> by the
> > wsdl; is there a way to integrate these into the signing process? Any
> advice
> > would be greatly appreciated.
> >
> > -peter
> >
> >
> >
Re: Need help signing a SOAP Request with a Digital Signature
Posted by Mei Wu <me...@usc.edu>.
Hey, the sample.security package has a simple way although it is not a wsdl
generated client stubs, but I think you can deploy the ClientHandler to do
it just as in the sample, so whether or not it is wsdl generated is not
important.
Mei
----- Original Message -----
From: "peter anthony cowan" <pe...@justgive.org>
To: <ax...@ws.apache.org>
Sent: Monday, March 22, 2004 11:48 PM
Subject: Need help signing a SOAP Request with a Digital Signature
> Can anyone recommend to me or point me somewhere that describes
> a simple, straightforward way to sign a SOAP request with a Digital
Signature
> within the Axis framework? I am aware of the XMLSecurity library, but
> there doesn't seem to be a complete example for a Client.
>
> I am trying to transition from using the classes automatically generated
by the
> wsdl; is there a way to integrate these into the signing process? Any
advice
> would be greatly appreciated.
>
> -peter
>
>
>
Need help signing a SOAP Request with a Digital Signature
Posted by peter anthony cowan <pe...@justgive.org>.
Can anyone recommend to me or point me somewhere that describes
a simple, straightforward way to sign a SOAP request with a Digital Signature
within the Axis framework? I am aware of the XMLSecurity library, but
there doesn't seem to be a complete example for a Client.
I am trying to transition from using the classes automatically generated by the
wsdl; is there a way to integrate these into the signing process? Any advice
would be greatly appreciated.
-peter
Re: Ws-Security ds:keyInfo for secrete key
Posted by Mei Wu <me...@usc.edu>.
On Saturday 20 March 2004 06:43 pm, Mei Wu wrote:
I found the problem is actually caused by a global handler
(samples.security.LogHandler) that I though was undeployed. So, it might be a
much simpler question: how do I undeploy such a global handler?
I did :
java org.apache.axis.client.AdminClient
samples/security/serversecuritydeploy.wsdd
My webserver is running at 8080, and it does seem to do some work that prints
out a lot of information when I executed it and at last it showed :
- org.apache.axis.i18n.resource::handleGetObject(empty00)
- NSPop (empty)
<Admin>Done processing</Admin>
But, the LogHandler is still processing each soap message, I use the original
serversecuritydeploy.wsdd packed in the sample :
<undeployment xmlns="http://xml.apache.org/axis/wsdd/"
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
<globalConfiguration>
<requestFlow>
<!-- define the Server Signature Verification handler configuration -->
<handler name="track" type="java:samples.security.LogHandler">
<parameter name="filename" value="MyService.log"/>
</handler>
</requestFlow>
</globalConfiguration>
</undeployment>
Any clue what went wrong?
thanks
Mei
> Hi,
>
> I am developing a message level security framework in which secrete key is
> included. I am a bit confused about how to create a ds:KeyInfo for such a
> secrete key, since if I follow WS-Security to create:
>
> <ds:KeyInfo>
>
> <wsse:SecurityTokenReference>
> <wsse:Reference URI="#00001"/>
> </wsse:SecurityTokenReference>
>
> </ds:KeyInfo>
>
> only, it will give me an AxisFault : "Didn't get a key"
>
> org.apache.xml.security.signature.XMLSignatureException: Didn't get a key
> at
> org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:
>260) at
> org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:1
>69) at
> org.apache.axis.encoding.DeserializationContextImpl.endElement(Deserializat
>ionContextImpl.java:1015) at
> org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
> at
> org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown
> Source)
> at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispat
>cher.dispatch(Unknown Source)
> at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
> Source)
> at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
> Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
> Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at
> org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at
> javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
> at
> org.apache.axis.encoding.DeserializationContextImpl.parse(DeserializationCo
>ntextImpl.java:242) at
> org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:538) at
> org.apache.axis.Message.getSOAPEnvelope(Message.java:376) at
> org.apache.axis.client.Call.invokeEngine(Call.java:2583) at
> org.apache.axis.client.Call.invoke(Call.java:2553)
> at org.apache.axis.client.Call.invoke(Call.java:1753)
> at samples.security.Client.doService(Client.java:69)
> at samples.security.Client.main(Client.java:95)
>
>
> However, I am not able to create a <ds:KeyValue> which is not a DSA or RSA
> key, I tried to create a KeyValue and pass a non-standard element (with a
> wsse namespace) to it, such as :
> KeyValue kv = new KeyValue(doc, securityTokenReference)
>
> It does not seem to work, it creates an empty <ds:KeyValue> within
> <ds:KeyInfo>, which again gets the same AxisFault.
>
> I create my secrete key as:
>
> char[] passwordchars = new char[password.length()];
>
> SignatureAlgorithm sa = new SignatureAlgorithm(doc,
>
> "http://www.w3.org/2000/09/xmldsig#hmac-sha1",
> 33);
>
> SecretKey sk = new SecretKeySpec(password.getBytes(),
> sa.getJCEAlgorithmString());
>
> I have no idea what KeyInfo can be constructed for HMAC key.
>
> Thanks very much.
>
> Mei
Re: Questions Regarding Security example ClientSigningHandler
Posted by Mei Wu <me...@usc.edu>.
thanks, will try that...
----- Original Message -----
From: "pacow" <pe...@justgive.org>
To: <ax...@ws.apache.org>
Sent: Friday, March 26, 2004 12:02 AM
Subject: Re: Questions Regarding Security example ClientSigningHandler
> ahh.. look for the files client-config.wsdd and server-config.wsdd (they
should
> be where you deployed from, i think); they save the state
> of your axis server. you can remove directives from them manually to
undeploy
> stuff.
>
> Mei Wu wrote:
>
> > yeah, undeploy doesn't work for me either, I renamed the
> > clienthandlerdeploy(something like that).wsdd, and then, it no longer
calls
> > that handler, but I still can't undeploy the global server side handler:
> > loghandler, anyone has any idea to undeploy that? -- I tried to
undeploy, it
> > shows lots of printouts and no exception, but the handler is still
there.
> >
> > Perhaps it filters the messgae that's gone through the client side
handler ,
> > which is the Axis binary code...
> > ----- Original Message -----
> > From: "pacow" <pe...@justgive.org>
> > To: <ax...@ws.apache.org>
> > Sent: Thursday, March 25, 2004 10:56 PM
> > Subject: Re: Questions Regarding Security example ClientSigningHandler
> >
> > > ah.. that may be it, as i'm using precompile class files from the
> > AxisBinary
> > > distribution.
> > >
> > > though now i have to figure out how to undeploy the Handler, since the
> > > undeploy.wsdd
> > > is not working.
> > >
> > > also, any ideas as to why it filters some clients but not others? it
only
> > > filters examples that
> > > came with the Axis binary, not Clients i have created on my own...
???
> > >
> > > thanks,
> > > -peter
> > >
> > > Mei Wu wrote:
> > >
> > > > looks to me like you have an mismatched xml security library, have
you
> > > > checked which version Axis supports?
> > > > I believe I am use 1.4...
> > > > ----- Original Message -----
> > > > From: "pacow" <pe...@justgive.org>
> > > > To: <ax...@ws.apache.org>
> > > > Sent: Thursday, March 25, 2004 10:06 PM
> > > > Subject: Questions Regarding Security example ClientSigningHandler
> > > >
> > > > > 1) Can I verify that the handler has actually been deployed? When
I
> > run
> > > > the command "java
> > > > > org.apache.axis.utils.Admin client
> > > > samples/security/clientsecuritydeploy.wsdd", I get no feedback,
> > > > > though no Exceptions either.
> > > > >
> > > > > 2) When I run "java org.apache.axis.client.AdminClient list" to
see
> > what
> > > > has been deployed, I get a
> > > > > message that seems to affirm that the ClientHandler has been
deployed,
> > but
> > > > I also get this Exception
> > > > >
> > > > > Beginning Client signing...
> > > > > Exception in thread "main" java.lang.NoSuchMethodError:
> > > > >
> > > >
> >
org.apache.xml.security.signature.XMLSignature.sign(Ljava/security/PrivateKe
> > > > y;)V
> > > > > at
> > > >
samples.security.SignedSOAPEnvelope.init(SignedSOAPEnvelope.java:150)
> > > > > at
> > > >
samples.security.SignedSOAPEnvelope.<init>(SignedSOAPEnvelope.java:104)
> > > > > at
> > > >
> >
samples.security.ClientSigningHandler.invoke(ClientSigningHandler.java:89)
> > > > > etc....
> > > > >
> > > > > Is this an error within the SignedSOAPEnvelope class, or a config
> > issue?
> > > > > When I attempt to undeploy the handler with "java
> > > > org.apache.axis.utils.Admin client
> > > > > samples/security/clientsecurityundeploy.wsdd", I get no feedback
once
> > > > again, but it doesn't appear to
> > > > > undeploy, as when I run the AdminClient afterwards I get the same
> > > > Exception.
> > > > >
> > > > > 3) When I run my own custom clients that are based off of classes
> > > > generated by wsdls, I do not get this
> > > > > exception, but I don't get any type of Signing message ('Beginning
> > Client
> > > > signing...') either... Does
> > > > > the Handler only work for certain types of calls???
> > > > >
> > > > > Any help would be appreciated,
> > > > > -peter
> > > > >
> > >
>
Re: Questions Regarding Security example ClientSigningHandler
Posted by pacow <pe...@justgive.org>.
ahh.. look for the files client-config.wsdd and server-config.wsdd (they should
be where you deployed from, i think); they save the state
of your axis server. you can remove directives from them manually to undeploy
stuff.
Mei Wu wrote:
> yeah, undeploy doesn't work for me either, I renamed the
> clienthandlerdeploy(something like that).wsdd, and then, it no longer calls
> that handler, but I still can't undeploy the global server side handler:
> loghandler, anyone has any idea to undeploy that? -- I tried to undeploy, it
> shows lots of printouts and no exception, but the handler is still there.
>
> Perhaps it filters the messgae that's gone through the client side handler ,
> which is the Axis binary code...
> ----- Original Message -----
> From: "pacow" <pe...@justgive.org>
> To: <ax...@ws.apache.org>
> Sent: Thursday, March 25, 2004 10:56 PM
> Subject: Re: Questions Regarding Security example ClientSigningHandler
>
> > ah.. that may be it, as i'm using precompile class files from the
> AxisBinary
> > distribution.
> >
> > though now i have to figure out how to undeploy the Handler, since the
> > undeploy.wsdd
> > is not working.
> >
> > also, any ideas as to why it filters some clients but not others? it only
> > filters examples that
> > came with the Axis binary, not Clients i have created on my own... ???
> >
> > thanks,
> > -peter
> >
> > Mei Wu wrote:
> >
> > > looks to me like you have an mismatched xml security library, have you
> > > checked which version Axis supports?
> > > I believe I am use 1.4...
> > > ----- Original Message -----
> > > From: "pacow" <pe...@justgive.org>
> > > To: <ax...@ws.apache.org>
> > > Sent: Thursday, March 25, 2004 10:06 PM
> > > Subject: Questions Regarding Security example ClientSigningHandler
> > >
> > > > 1) Can I verify that the handler has actually been deployed? When I
> run
> > > the command "java
> > > > org.apache.axis.utils.Admin client
> > > samples/security/clientsecuritydeploy.wsdd", I get no feedback,
> > > > though no Exceptions either.
> > > >
> > > > 2) When I run "java org.apache.axis.client.AdminClient list" to see
> what
> > > has been deployed, I get a
> > > > message that seems to affirm that the ClientHandler has been deployed,
> but
> > > I also get this Exception
> > > >
> > > > Beginning Client signing...
> > > > Exception in thread "main" java.lang.NoSuchMethodError:
> > > >
> > >
> org.apache.xml.security.signature.XMLSignature.sign(Ljava/security/PrivateKe
> > > y;)V
> > > > at
> > > samples.security.SignedSOAPEnvelope.init(SignedSOAPEnvelope.java:150)
> > > > at
> > > samples.security.SignedSOAPEnvelope.<init>(SignedSOAPEnvelope.java:104)
> > > > at
> > >
> samples.security.ClientSigningHandler.invoke(ClientSigningHandler.java:89)
> > > > etc....
> > > >
> > > > Is this an error within the SignedSOAPEnvelope class, or a config
> issue?
> > > > When I attempt to undeploy the handler with "java
> > > org.apache.axis.utils.Admin client
> > > > samples/security/clientsecurityundeploy.wsdd", I get no feedback once
> > > again, but it doesn't appear to
> > > > undeploy, as when I run the AdminClient afterwards I get the same
> > > Exception.
> > > >
> > > > 3) When I run my own custom clients that are based off of classes
> > > generated by wsdls, I do not get this
> > > > exception, but I don't get any type of Signing message ('Beginning
> Client
> > > signing...') either... Does
> > > > the Handler only work for certain types of calls???
> > > >
> > > > Any help would be appreciated,
> > > > -peter
> > > >
> >
Re: Questions Regarding Security example ClientSigningHandler
Posted by Mei Wu <me...@usc.edu>.
yeah, undeploy doesn't work for me either, I renamed the
clienthandlerdeploy(something like that).wsdd, and then, it no longer calls
that handler, but I still can't undeploy the global server side handler:
loghandler, anyone has any idea to undeploy that? -- I tried to undeploy, it
shows lots of printouts and no exception, but the handler is still there.
Perhaps it filters the messgae that's gone through the client side handler ,
which is the Axis binary code...
----- Original Message -----
From: "pacow" <pe...@justgive.org>
To: <ax...@ws.apache.org>
Sent: Thursday, March 25, 2004 10:56 PM
Subject: Re: Questions Regarding Security example ClientSigningHandler
> ah.. that may be it, as i'm using precompile class files from the
AxisBinary
> distribution.
>
> though now i have to figure out how to undeploy the Handler, since the
> undeploy.wsdd
> is not working.
>
> also, any ideas as to why it filters some clients but not others? it only
> filters examples that
> came with the Axis binary, not Clients i have created on my own... ???
>
> thanks,
> -peter
>
> Mei Wu wrote:
>
> > looks to me like you have an mismatched xml security library, have you
> > checked which version Axis supports?
> > I believe I am use 1.4...
> > ----- Original Message -----
> > From: "pacow" <pe...@justgive.org>
> > To: <ax...@ws.apache.org>
> > Sent: Thursday, March 25, 2004 10:06 PM
> > Subject: Questions Regarding Security example ClientSigningHandler
> >
> > > 1) Can I verify that the handler has actually been deployed? When I
run
> > the command "java
> > > org.apache.axis.utils.Admin client
> > samples/security/clientsecuritydeploy.wsdd", I get no feedback,
> > > though no Exceptions either.
> > >
> > > 2) When I run "java org.apache.axis.client.AdminClient list" to see
what
> > has been deployed, I get a
> > > message that seems to affirm that the ClientHandler has been deployed,
but
> > I also get this Exception
> > >
> > > Beginning Client signing...
> > > Exception in thread "main" java.lang.NoSuchMethodError:
> > >
> >
org.apache.xml.security.signature.XMLSignature.sign(Ljava/security/PrivateKe
> > y;)V
> > > at
> > samples.security.SignedSOAPEnvelope.init(SignedSOAPEnvelope.java:150)
> > > at
> > samples.security.SignedSOAPEnvelope.<init>(SignedSOAPEnvelope.java:104)
> > > at
> >
samples.security.ClientSigningHandler.invoke(ClientSigningHandler.java:89)
> > > etc....
> > >
> > > Is this an error within the SignedSOAPEnvelope class, or a config
issue?
> > > When I attempt to undeploy the handler with "java
> > org.apache.axis.utils.Admin client
> > > samples/security/clientsecurityundeploy.wsdd", I get no feedback once
> > again, but it doesn't appear to
> > > undeploy, as when I run the AdminClient afterwards I get the same
> > Exception.
> > >
> > > 3) When I run my own custom clients that are based off of classes
> > generated by wsdls, I do not get this
> > > exception, but I don't get any type of Signing message ('Beginning
Client
> > signing...') either... Does
> > > the Handler only work for certain types of calls???
> > >
> > > Any help would be appreciated,
> > > -peter
> > >
>
Re: Questions Regarding Security example ClientSigningHandler
Posted by pacow <pe...@justgive.org>.
ah.. that may be it, as i'm using precompile class files from the AxisBinary
distribution.
though now i have to figure out how to undeploy the Handler, since the
undeploy.wsdd
is not working.
also, any ideas as to why it filters some clients but not others? it only
filters examples that
came with the Axis binary, not Clients i have created on my own... ???
thanks,
-peter
Mei Wu wrote:
> looks to me like you have an mismatched xml security library, have you
> checked which version Axis supports?
> I believe I am use 1.4...
> ----- Original Message -----
> From: "pacow" <pe...@justgive.org>
> To: <ax...@ws.apache.org>
> Sent: Thursday, March 25, 2004 10:06 PM
> Subject: Questions Regarding Security example ClientSigningHandler
>
> > 1) Can I verify that the handler has actually been deployed? When I run
> the command "java
> > org.apache.axis.utils.Admin client
> samples/security/clientsecuritydeploy.wsdd", I get no feedback,
> > though no Exceptions either.
> >
> > 2) When I run "java org.apache.axis.client.AdminClient list" to see what
> has been deployed, I get a
> > message that seems to affirm that the ClientHandler has been deployed, but
> I also get this Exception
> >
> > Beginning Client signing...
> > Exception in thread "main" java.lang.NoSuchMethodError:
> >
> org.apache.xml.security.signature.XMLSignature.sign(Ljava/security/PrivateKe
> y;)V
> > at
> samples.security.SignedSOAPEnvelope.init(SignedSOAPEnvelope.java:150)
> > at
> samples.security.SignedSOAPEnvelope.<init>(SignedSOAPEnvelope.java:104)
> > at
> samples.security.ClientSigningHandler.invoke(ClientSigningHandler.java:89)
> > etc....
> >
> > Is this an error within the SignedSOAPEnvelope class, or a config issue?
> > When I attempt to undeploy the handler with "java
> org.apache.axis.utils.Admin client
> > samples/security/clientsecurityundeploy.wsdd", I get no feedback once
> again, but it doesn't appear to
> > undeploy, as when I run the AdminClient afterwards I get the same
> Exception.
> >
> > 3) When I run my own custom clients that are based off of classes
> generated by wsdls, I do not get this
> > exception, but I don't get any type of Signing message ('Beginning Client
> signing...') either... Does
> > the Handler only work for certain types of calls???
> >
> > Any help would be appreciated,
> > -peter
> >
Re: Questions Regarding Security example ClientSigningHandler
Posted by Mei Wu <me...@usc.edu>.
looks to me like you have an mismatched xml security library, have you
checked which version Axis supports?
I believe I am use 1.4...
----- Original Message -----
From: "pacow" <pe...@justgive.org>
To: <ax...@ws.apache.org>
Sent: Thursday, March 25, 2004 10:06 PM
Subject: Questions Regarding Security example ClientSigningHandler
> 1) Can I verify that the handler has actually been deployed? When I run
the command "java
> org.apache.axis.utils.Admin client
samples/security/clientsecuritydeploy.wsdd", I get no feedback,
> though no Exceptions either.
>
> 2) When I run "java org.apache.axis.client.AdminClient list" to see what
has been deployed, I get a
> message that seems to affirm that the ClientHandler has been deployed, but
I also get this Exception
>
> Beginning Client signing...
> Exception in thread "main" java.lang.NoSuchMethodError:
>
org.apache.xml.security.signature.XMLSignature.sign(Ljava/security/PrivateKe
y;)V
> at
samples.security.SignedSOAPEnvelope.init(SignedSOAPEnvelope.java:150)
> at
samples.security.SignedSOAPEnvelope.<init>(SignedSOAPEnvelope.java:104)
> at
samples.security.ClientSigningHandler.invoke(ClientSigningHandler.java:89)
> etc....
>
> Is this an error within the SignedSOAPEnvelope class, or a config issue?
> When I attempt to undeploy the handler with "java
org.apache.axis.utils.Admin client
> samples/security/clientsecurityundeploy.wsdd", I get no feedback once
again, but it doesn't appear to
> undeploy, as when I run the AdminClient afterwards I get the same
Exception.
>
> 3) When I run my own custom clients that are based off of classes
generated by wsdls, I do not get this
> exception, but I don't get any type of Signing message ('Beginning Client
signing...') either... Does
> the Handler only work for certain types of calls???
>
> Any help would be appreciated,
> -peter
>
"WebappClassLoader: Lifecycle error : CL stopped" -- LogManager issue?
Posted by pacow <pe...@justgive.org>.
every once in a while when i run my axis client (which i use in conjunction
with xmlsec)
in the context of my web app, i get the following error as the client attempts
to add the
digital signature:
> WebappClassLoader: Lifecycle error : CL stopped
> org.apache.xml.security.signature.XMLSignatureException:
> The requested algorithm SHA1WithRSAEncryption does not exist.
> Original Message was: class configured for Signature(provider: BC)cannot be found.
>
So something is destroying the ClassLoader? How do I deal with this? There is
some evidence that it
may be related to the LogManager or something. Any advice would be greatly
appreciated. Also,
it is worth noting that when I run a client from the command line I never
experience this error.
-peter
"WebappClassLoader: Lifecycle error : CL stopped" -- LogManager issue?
Posted by pacow <pe...@justgive.org>.
every once in a while when i run my axis client (which i use in conjunction
with xmlsec)
in the context of my web app, i get the following error as the client attempts
to add the
digital signature:
> WebappClassLoader: Lifecycle error : CL stopped
> org.apache.xml.security.signature.XMLSignatureException:
> The requested algorithm SHA1WithRSAEncryption does not exist.
> Original Message was: class configured for Signature(provider: BC)cannot be found.
>
So something is destroying the ClassLoader? How do I deal with this? There is
some evidence that it
may be related to the LogManager or something. Any advice would be greatly
appreciated. Also,
it is worth noting that when I run a client from the command line I never
experience this error.
-peter
Re: Questions Regarding Security example ClientSigningHandler
Posted by "Dimuthu Leelarathne." <mu...@opensource.lk>.
Hi Peter,
> 1) Can I verify that the handler has actually been deployed? When I run
the command "java
> org.apache.axis.utils.Admin client
samples/security/clientsecuritydeploy.wsdd", I get no feedback,
> though no Exceptions either.
You can check wheather Client-Config.wsdd has been created, if it has been
created already, then just open it and check whether your service has been
deployed in it, i.e. there should be a <service ....> ....... <service>
entry for the service.
> 3) When I run my own custom clients that are based off of classes
generated by wsdls, I do not get this
> exception, but I don't get any type of Signing message ('Beginning Client
signing...') either... Does
> the Handler only work for certain types of calls??
Is your Client-Config.wsdd is at the begining of your classpath of your
custom client as well? I don't think handler only works for certain type of
calls.
Regards,
Dimuthu.
Questions Regarding Security example ClientSigningHandler
Posted by pacow <pe...@justgive.org>.
1) Can I verify that the handler has actually been deployed? When I run the command "java
org.apache.axis.utils.Admin client samples/security/clientsecuritydeploy.wsdd", I get no feedback,
though no Exceptions either.
2) When I run "java org.apache.axis.client.AdminClient list" to see what has been deployed, I get a
message that seems to affirm that the ClientHandler has been deployed, but I also get this Exception
Beginning Client signing...
Exception in thread "main" java.lang.NoSuchMethodError:
org.apache.xml.security.signature.XMLSignature.sign(Ljava/security/PrivateKey;)V
at samples.security.SignedSOAPEnvelope.init(SignedSOAPEnvelope.java:150)
at samples.security.SignedSOAPEnvelope.<init>(SignedSOAPEnvelope.java:104)
at samples.security.ClientSigningHandler.invoke(ClientSigningHandler.java:89)
etc....
Is this an error within the SignedSOAPEnvelope class, or a config issue?
When I attempt to undeploy the handler with "java org.apache.axis.utils.Admin client
samples/security/clientsecurityundeploy.wsdd", I get no feedback once again, but it doesn't appear to
undeploy, as when I run the AdminClient afterwards I get the same Exception.
3) When I run my own custom clients that are based off of classes generated by wsdls, I do not get this
exception, but I don't get any type of Signing message ('Beginning Client signing...') either... Does
the Handler only work for certain types of calls???
Any help would be appreciated,
-peter
Re: Ws-Security ds:keyInfo for secrete key
Posted by Davanum Srinivas <di...@yahoo.com>.
http://ws.apache.org/ws-fx/wss4j/
--- Mei Wu <me...@usc.edu> wrote:
> Hi,
>
> I am developing a message level security framework in which secrete key is
> included. I am a bit confused about how to create a ds:KeyInfo for such a
> secrete key, since if I follow WS-Security to create:
>
> <ds:KeyInfo>
>
> <wsse:SecurityTokenReference>
> <wsse:Reference URI="#00001"/>
> </wsse:SecurityTokenReference>
>
> </ds:KeyInfo>
>
> only, it will give me an AxisFault : "Didn't get a key"
>
> org.apache.xml.security.signature.XMLSignatureException: Didn't get a key
> at
> org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:260)
> at
> org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:169)
> at
>
org.apache.axis.encoding.DeserializationContextImpl.endElement(DeserializationContextImpl.java:1015)
> at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown
> Source)
> at
> org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown
> Source)
> at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
>
> Source)
> at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
> Source)
> at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
> at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
> at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
> at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
> at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
> at
> org.apache.axis.encoding.DeserializationContextImpl.parse(DeserializationContextImpl.java:242)
> at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:538)
> at org.apache.axis.Message.getSOAPEnvelope(Message.java:376)
> at org.apache.axis.client.Call.invokeEngine(Call.java:2583)
> at org.apache.axis.client.Call.invoke(Call.java:2553)
> at org.apache.axis.client.Call.invoke(Call.java:1753)
> at samples.security.Client.doService(Client.java:69)
> at samples.security.Client.main(Client.java:95)
>
>
> However, I am not able to create a <ds:KeyValue> which is not a DSA or RSA
> key, I tried to create a KeyValue and pass a non-standard element (with a
> wsse namespace) to it, such as :
> KeyValue kv = new KeyValue(doc, securityTokenReference)
>
> It does not seem to work, it creates an empty <ds:KeyValue> within
> <ds:KeyInfo>, which again gets the same AxisFault.
>
> I create my secrete key as:
>
> char[] passwordchars = new char[password.length()];
>
> SignatureAlgorithm sa = new SignatureAlgorithm(doc,
>
> "http://www.w3.org/2000/09/xmldsig#hmac-sha1",
> 33);
>
> SecretKey sk = new SecretKeySpec(password.getBytes(),
> sa.getJCEAlgorithmString());
>
> I have no idea what KeyInfo can be constructed for HMAC key.
>
> Thanks very much.
>
> Mei
=====
Davanum Srinivas - http://webservices.apache.org/~dims/