Note that there are some explanatory texts on larger screens.

plurals
  1. POJava client to WCF service interop with mutual certificate - Cannot resolve KeyInfo for verifying signature
    primarykey
    data
    text
    <p><strong>Exception: MessageSecurityException: Cannot resolve KeyInfo for verifying signature: KeyInfo 'SecurityKeyIdentifier</strong></p> <p>I have to set up a WCF service to receive SOAP calls from a Java client that is sending signed content with the following header:</p> <pre><code>&lt;soap:Header&gt; &lt;wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" soap:mustUnderstand="1"&gt; &lt;ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#" Id="Signature-2"&gt; &lt;ds:SignedInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#"&gt; &lt;ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" xmlns:ds="http://www.w3.org/2000/09/xmldsig#"/&gt; &lt;ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" xmlns:ds="http://www.w3.org/2000/09/xmldsig#"/&gt; &lt;ds:Reference URI="#id-3" xmlns:ds="http://www.w3.org/2000/09/xmldsig#"&gt; &lt;ds:Transforms xmlns:ds="http://www.w3.org/2000/09/xmldsig#"&gt; &lt;ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" xmlns:ds="http://www.w3.org/2000/09/xmldsig#"/&gt; &lt;/ds:Transforms&gt; &lt;ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" xmlns:ds="http://www.w3.org/2000/09/xmldsig#"/&gt; &lt;ds:DigestValue xmlns:ds="http://www.w3.org/2000/09/xmldsig#"&gt;…&lt;/ds:DigestValue&gt; &lt;/ds:Reference&gt; &lt;ds:Reference URI="#Timestamp-1" xmlns:ds="http://www.w3.org/2000/09/xmldsig#"&gt; &lt;ds:Transforms xmlns:ds="http://www.w3.org/2000/09/xmldsig#"&gt; &lt;ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" xmlns:ds="http://www.w3.org/2000/09/xmldsig#"/&gt; &lt;/ds:Transforms&gt; &lt;ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" xmlns:ds="http://www.w3.org/2000/09/xmldsig#"/&gt; &lt;ds:DigestValue xmlns:ds="http://www.w3.org/2000/09/xmldsig#"&gt;…&lt;/ds:DigestValue&gt; &lt;/ds:Reference&gt; &lt;/ds:SignedInfo&gt; &lt;ds:SignatureValue xmlns:ds="http://www.w3.org/2000/09/xmldsig#"&gt; … &lt;/ds:SignatureValue&gt; &lt;ds:KeyInfo Id="KeyId-66FC0491F2BB65AFF813274134607712" xmlns:ds="http://www.w3.org/2000/09/xmldsig#"&gt; &lt;wsse:SecurityTokenReference xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="...." xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"&gt; &lt;ds:X509Data xmlns:ds="http://www.w3.org/2000/09/xmldsig#"&gt; &lt;ds:X509IssuerSerial xmlns:ds="http://www.w3.org/2000/09/xmldsig#"&gt; &lt;ds:X509IssuerName xmlns:ds="http://www.w3.org/2000/09/xmldsig#"&gt;CN=XXXXXXXX&lt;/ds:X509IssuerName&gt; &lt;ds:X509SerialNumber xmlns:ds="http://www.w3.org/2000/09/xmldsig#"&gt;111122222&lt;/ds:X509SerialNumber&gt; &lt;/ds:X509IssuerSerial&gt; &lt;/ds:X509Data&gt; &lt;/wsse:SecurityTokenReference&gt; &lt;/ds:KeyInfo&gt; &lt;/ds:Signature&gt; &lt;wsu:Timestamp xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="Timestamp-1"&gt; &lt;wsu:Created&gt;xxxxx&lt;/wsu:Created&gt; &lt;wsu:Expires&gt;xxxx&lt;/wsu:Expires&gt; &lt;/wsu:Timestamp&gt;&lt;/wsse:Security&gt;&lt;/soap:Header&gt; </code></pre> <p><strong>I have tried setting up the following binding and behavior:</strong></p> <pre><code> &lt;customBinding&gt; &lt;binding name="javaclientBinding"&gt; &lt;security defaultAlgorithmSuite="Basic256Rsa15" messageSecurityVersion="WSSecurity10WSTrust13WSSecureConversation13WSSecurityPolicy12BasicSecurityProfile10" allowSerializedSigningTokenOnReply="true" authenticationMode="MutualCertificateDuplex" requireDerivedKeys="false" securityHeaderLayout="LaxTimestampLast" allowInsecureTransport="true" requireSignatureConfirmation="false" requireSecurityContextCancellation="false"&gt; &lt;/security&gt; &lt;textMessageEncoding messageVersion="Soap11" /&gt; &lt;httpTransport /&gt; &lt;/binding&gt; &lt;/customBinding&gt; &lt;behavior name="javaclientBehavior"&gt; &lt;serviceMetadata httpGetEnabled="True"/&gt; &lt;serviceDebug includeExceptionDetailInFaults="False"/&gt; &lt;serviceCredentials&gt; &lt;clientCertificate&gt; &lt;authentication certificateValidationMode="PeerTrust"/&gt; &lt;/clientCertificate&gt; &lt;serviceCertificate findValue="applicationServer" storeLocation="CurrentUser" storeName="My" x509FindType="FindBySubjectName" /&gt; &lt;/serviceCredentials&gt; &lt;/behavior&gt; </code></pre> <p><strong>But I get the following exception in the servers event log:</strong></p> <pre><code>ClientIdentity: ActivityId: &lt;null&gt; MessageSecurityException: Cannot resolve KeyInfo for verifying signature: KeyInfo 'SecurityKeyIdentifier ( IsReadOnly = False, Count = 1, Clause[0] = X509IssuerSerialKeyIdentifierClause(Issuer = 'CN=XXXXXX) ) ', available tokens 'SecurityTokenResolver ( TokenCount = 0, ) </code></pre> <p>'.</p> <p>We have to get signature validation working, and we have no possibility to change what the java client is sending.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload