Forum Discussion

choongjoey's avatar
choongjoey
Occasional Visitor
13 years ago

Signature Algorithm Causing Exceptions?

Hi all,

I'm facing an issue with using SOAPUI to generate a SOAP request with SAMLv2 and message signing and encryption.

I've created my keystores and is able to generate requests properly, however once i change my signature algorithm to http://www.w3.org/2000/09/xmldsig#hmac-sha1

I am getting the following exception
Fri Aug 24 18:21:05 SGT 2012:ERROR:org.apache.ws.security.WSSecurityException: Signature creation failed
org.apache.ws.security.WSSecurityException: Signature creation failed
at org.apache.ws.security.message.WSSecSignature.computeSignature(WSSecSignature.java:558)
at org.apache.ws.security.message.WSSecSignature.computeSignature(WSSecSignature.java:478)
at org.apache.ws.security.message.WSSecSignature.build(WSSecSignature.java:384)
at com.eviware.soapui.impl.wsdl.support.wss.entries.SignatureEntry.process(SignatureEntry.java:194)
at com.eviware.soapui.impl.wsdl.support.wss.OutgoingWss.processOutgoing(OutgoingWss.java:192)
at com.eviware.soapui.impl.wsdl.submit.filters.WssRequestFilter.filterWsdlRequest(WssRequestFilter.java:58)
at com.eviware.soapui.impl.wsdl.submit.filters.AbstractRequestFilter.filterAbstractHttpRequest(AbstractRequestFilter.java:37)
at com.eviware.soapui.impl.wsdl.submit.filters.AbstractRequestFilter.filterRequest(AbstractRequestFilter.java:31)
at com.eviware.soapui.impl.wsdl.submit.transports.http.HttpClientRequestTransport.sendRequest(HttpClientRequestTransport.java:184)
at com.eviware.soapui.impl.wsdl.WsdlSubmit.run(WsdlSubmit.java:123)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
Caused by: javax.xml.crypto.dsig.XMLSignatureException: java.security.InvalidKeyException: key must be SecretKey
at org.apache.jcp.xml.dsig.internal.dom.DOMXMLSignature.sign(DOMXMLSignature.java:401)
at org.apache.ws.security.message.WSSecSignature.computeSignature(WSSecSignature.java:553)
... 15 more
Caused by: java.security.InvalidKeyException: key must be SecretKey
at org.apache.jcp.xml.dsig.internal.dom.DOMHMACSignatureMethod.sign(DOMHMACSignatureMethod.java:177)
at org.apache.jcp.xml.dsig.internal.dom.DOMXMLSignature.sign(DOMXMLSignature.java:397)
... 16 more

Any ideas?
  • I am having the same issue. I created a self signed pair using the java keytool.
  • gabcar's avatar
    gabcar
    Occasional Contributor
    Hi,

    I have the same error when try to use #hmac-sha1 in Signature Algorithm.
    I have a pair (private/public) key in my keystore.
    I use soapUI 4.5.0.

    Caused by: java.security.InvalidKeyException: key must be SecretKey.

    Best Regards
  • Hi,

    Has there been any solutions for this. I am experience a similar problem but no sure if its on the signature or on the encryption. I have a simple custom client working with my Webservice with "Timestamp Signature Encrypt" methods. When I send a message using SOAPUI I receive the following error on my server side (JBoss 5.1.0). The webservice is ibased on Spring-ws using Wss4j.

    16:22:12,738 ERROR [KeyStoreCallbackHandler] Key [null] is not a javax.crypto.SecretKey
    16:22:12,739 WARN [Wss4jSecurityInterceptor] Could not validate request: Referenced security token could not be retriev
    ed (Reference "#null"); nested exception is org.apache.ws.security.WSSecurityException: Referenced security token could
    not be retrieved (Reference "#null")
    16:22:12,740 DEBUG [Wss4jSecurityInterceptor] No exception resolver present, creating basic soap fault

    In SOAPUI, I get the following Soap Fault message:

    "Reference security token could not be retrieved (Reference "#null")

    I would really like to get SoapUI working otherwise I'm going to have to find another client.

    Mike
  • IanWatson92's avatar
    IanWatson92
    Occasional Contributor
    Are we any closer to having this issue resolved?

    This is very basic functionality that is SOAPUI should deliver.