有人可以告诉我如何签署传出的SOAP信封。我必须使用密钥库别名和密码来设置签名。添加签名后,标题必须包含这样的内容,
<wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"><ds:Signature Id="Signature-5" xmlns:ds="http://www.w3.org/2000/09/xmldsig#"> <ds:SignedInfo> <ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/> <ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/> <ds:Reference URI="#id-6">
<ds:Transforms> <ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/> </ds:Transforms>
<ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/> <ds:DigestValue>NLM0t9Zru2n7IAC79XAhK6tGGF8=</ds:DigestValue> </ds:Reference> </ds:SignedInfo> <ds:SignatureValue> WoUIB4sLW4mlz58UtcLoT4sIF4O3TYIsw7T680KeDskCqQ5itB7ij8ugefPxcWGnWkfPofmkMcI+ EjsYvu/cXDmPI3OkQPNZv7cI2yfuk1hdFFUFsyI2aTF9I4qtnRw87Lo7v8vLI5dmkWwkT7umLEQf 5Zc6Oo8MDjBXOmzzjdQ= </ds:SignatureValue> <ds:KeyInfo Id="KeyId-FFC7EEF6679E25D50113239314975548"> <wsse:SecurityTokenReference wsu:Id="STRId-FFC7EEF6679E25D50113239314975549" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"><ds:X509Data> <ds:X509IssuerSerial> <ds:X509IssuerName>O=Sprint,C=US</ds:X509IssuerName> <ds:X509SerialNumber>1192913964</ds:X509SerialNumber> </ds:X509IssuerSerial> </ds:X509Data></wsse:SecurityTokenReference> </ds:KeyInfo> </ds:Signature></wsse:Security>
我需要使用Java代码生成它。有人可以帮助我或指导我如何使用Java代码从密钥库生成这个东西?