"not an RSA key" - Encryption Failed in SoapUI

This section provides a tutorial example of SOAP message encryption failed with 'not an RSA key' with SoapUI, if a certificate entry with a DSA public key is specified in the WS-Security configuration.

With the "Encryption" configuration created, we can continue to try to generate a SOAP request message that is encrypted with SoapUI.

1. Right-click on "Hello" and select "New Request". The request screen is displayed with a new SOAP test request message.

2. Click on "Auth" below the request message area on the request screen, The authorization area is displayed.

3. Select "Add a New Authorization". Then select "Basic" as the "Type". Basic authorization fields are displayed.

4. Set "Outgoing WSS" to "Encryption", which represents the "Encryption" WS-Security configuration created in the previous tutorial.

5. Click on "Submit request ..." icon in the icon bar on the request screen. The response message will be displayed.

6. Click on the "Raw" vertical tab. Unfortunately, the SOAP message is not encrypted.

7. Click on the "Error Log" in the bottom bar. You will see the following error message:

...:ERROR:java.lang.IllegalArgumentException: not an RSA key!
   java.lang.IllegalArgumentException: not an RSA key!
   at org.bouncycastle.jce.provider.JCERSACipher.engineGetKeySize(U...
   at javax.crypto.Cipher.passCryptoPermCheck(Cipher.java:1052)
   at javax.crypto.Cipher.checkCryptoPerm(Cipher.java:1023)
   at javax.crypto.Cipher.implInit(Cipher.java:790)
   at javax.crypto.Cipher.chooseProvider(Cipher.java:849)
   at javax.crypto.Cipher.init(Cipher.java:1348)
   at javax.crypto.Cipher.init(Cipher.java:1282)
   at org.apache.ws.security.message.WSSecEncryptedKey.prepareInter...
   at org.apache.ws.security.message.WSSecEncrypt.prepare(WSSecEncr...
   at org.apache.ws.security.message.WSSecEncrypt.build(WSSecEncryp...
   at com.eviware.soapui.impl.wsdl.support.wss.entries.EncryptionEn...
   at com.eviware.soapui.impl.wsdl.support.wss.OutgoingWss.processO...
   at com.eviware.soapui.impl.wsdl.submit.filters.WssRequestFilter....
   at com.eviware.soapui.impl.wsdl.submit.filters.AbstractRequestFi...
   at com.eviware.soapui.impl.wsdl.submit.filters.AbstractRequestFi...
   at com.eviware.soapui.impl.wsdl.submit.transports.http.HttpClien...
   at com.eviware.soapui.impl.wsdl.WsdlSubmit.run(WsdlSubmit.java:1...
   at java.util.concurrent.Executors$RunnableAdapter.call(Executors...
   at java.util.concurrent.FutureTask.run(FutureTask.java:262)
   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolE...
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPool...
   at java.lang.Thread.run(Thread.java:744)

The error message tells us that SoapUI only supports RSA public key on SOAP message encryption. My public key in "mycertificate" was generated with the DSA algorithm. We need to get a RSA public key certificate to continue our test.

Last update: 2014.

Table of Contents

 About This Book

 Introduction to Web Service

 Introduction to SOAP (Simple Object Access Protocol)

 SOAP Message Structure

 SOAP Message Transmission and Processing

 SOAP Data Model

 SOAP Encoding

 SOAP RPC Presentation

 SOAP Properties Model

 SOAP Message Exchange Patterns

 SOAP HTTP Binding

 SOAP Perl Implementations

 SOAP PHP Implementations

 SOAP Java Implementations

 Perl SOAP::Lite - SOAP Server-Client Communication Module

 Perl Socket Test Program for HTTP and SOAP

 Perl SOAP::Lite for GetSpeech SOAP 1.1 Web Service

 Perl SOAP::Lite 0.710 for SOAP 1.2 Web Services

 Perl SOAP::Lite 0.710 for WSDL

 PHP SOAP Extension Client Programs

 PHP SOAP Extension Server Programs

 Java Socket and HttpURLConnection for SOAP

 SAAJ - SOAP with Attachments API for Java

 SoapUI - SOAP Web Service Testing Tool

 WS-Security - SOAP Message Security Extension

WS-Security X.509 Certificate Token

 What Is WS-Security X.509 Certificate Token Profile?

 What Is XML Signature Syntax and Processing?

 Generating a Self-Signed Certificate with "keytool"

 SoapUI Configuration for Messaging Signing

 Generating Digital Signature with SoapUI

 Validating ds:Signature with X.509 Certificate

 Digital Signature Options Supported in SoapUI

 What Is XML Encryption Syntax and Processing?

 SoapUI Configuration for Messaging Encryption

"not an RSA key" - Encryption Failed in SoapUI

 Encryption using RSA Public Key with SoapUI

 2-Step Message Encryption - Symmetric and RSA

 Decrypting Encrypted SOAP Message

 Message Encryption Options Supported in SoapUI

 Web Services and SOAP Terminology

 References

 PDF Printing Version