0

我们在 HP Nonstop 上有一个 openssl 端口,并且需要发送一个与 SoapUI 生成的安全标头相同的 SOAP 请求。到目前为止,我们已经能够得到一个匹配的摘要值(3 天)。现在我完全被困在试图在我们在 SoapUI 中看到的 openssl 中生成相同的签名。

我有两个输入:一个包含二进制摘要值的文件和另一个包含 base64 摘要值的文件。

我有相同的 .pfx 密钥库,它在 HP NSK 的 SoapUI 中加载,但我必须将其转换为 .pem 文件(openssl pkcs12 -in pfx -out pem -nodes)。

我发现了三个单独的 openssl 命令,它们将生成一个签名,但它们都不匹配来自相同摘要值的 SoapUI 签名:

openssl dgst -sha1 -rand randfile -sign pem dgst.txt | openssl enc -base64 > sig

openssl rsautl -sign -inkey pem -in dgst.txt | openssl enc -base64 > sig

openssl pkeyutl -inkey pem -in dgst.txt | openssl enc -base64 > sig

几个 openssl 命令将允许您指定“-sha”、“-sha1”等。其中有 11 个,我试过每个人。签名不匹配。

对此有什么帮助吗?在这里进行第 3 天,我认为这是最容易的部分。

这是 SoapUI 生成的安全标头。为简洁起见,我删除了签名和任何客户身份信息。我主要展示它以指示正在指定哪些算法等。

    <wsse:Security xmlns:wsse="redacted" xmlns:wsu="redacted">
<ds:Signature Id="SIG-7175F72748C072A4761529013840614108" xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
    <ds:SignedInfo>
        <ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#">
            <ec:InclusiveNamespaces PrefixList="soapenv v1 v11 v2" xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#"/>
        </ds:CanonicalizationMethod>
        <ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
        <ds:Reference URI="#id-CE0A4571D7DB69D8CE152339585717529">
            <ds:Transforms>
                <ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#">
                    <ec:InclusiveNamespaces PrefixList="v1 v11 v2" xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#"/>
                </ds:Transform>
            </ds:Transforms>
            <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
            <ds:DigestValue>redacted</ds:DigestValue>
        </ds:Reference>
    </ds:SignedInfo>
    <ds:SignatureValue>removed for brevity</ds:SignatureValue>
    <ds:KeyInfo Id="redacted">
        <wsse:SecurityTokenReference wsu:Id="redacted">
            <ds:X509Data>
                <ds:X509IssuerSerial>
                    <ds:X509IssuerName>CN=Symantec Class 3 Secure Server CA - G4,OU=Symantec Trust Network,O=Symantec Corporation,C=US</ds:X509IssuerName>
                    <ds:X509SerialNumber>redacted</ds:X509SerialNumber>
                </ds:X509IssuerSerial>
            </ds:X509Data>
        </wsse:SecurityTokenReference>
    </ds:KeyInfo>
</ds:Signature>

4

0 回答 0