Hello
my sign of request is working perfectly. But when I add to encrypt also request i get this error:
2019-10-16 10:52:59.296 ERROR 6912 --- [nio-8080-exec-1] j.e.resource.xml.webservices.security : WSS0221: Unable to locate matching certificate for Key Encryption using Callback Handler.
2019-10-16 10:52:59.304 ERROR 6912 --- [nio-8080-exec-1] com.sun.xml.wss.logging.impl.filter : WSS1413: Error extracting certificate
My code part:
from what i see the main issue is that alias for encry cert is not set. How to set it i do not know as the same handler is called for sign and encry. Sign is working.
Link:
https://docs.spring.io/spring-ws/site/reference/html/security.html
7.2.4.2. Encryption
To encrypt outgoing SOAP messages, the security policy file should contain a Encrypt element. This element can further carry a EncryptionTarget element which indicates which part of the message should be encrypted, and a SymmetricKey to indicate that a shared secret instead of the regular public key should be used to encrypt the message. You can read a description of the other elements here .
<xwss:SecurityConfiguration xmlns:xwss="http://java.sun.com/xml/ns/xwss/config">
<xwss:Encrypt />
</xwss:SecurityConfiguration>
The XwsSecurityInterceptor will fire a EncryptionKeyCallback to the registered handlers in order to retrieve the encryption information. Within Spring-WS, there is one class which handled this particular callback: the KeyStoreCallbackHandler.
Picture of object:
https://drive.google.com/file/d/1VF4St9EzcJZZo8wrhIRpbTXN2i8WpBhS/view?usp=sharing
And part of class that executes this:
https://pastebin.com/mbxuAgy7
Tnx
miha