Help with SOAP, x509 encoding


(Miha) #1

Hello

i need somehow to encode body like this. I have private and public key but I do not know exactly how to do that.
Thank you!

 <soap:Body xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="id-11055">
        <xenc:EncryptedData xmlns:xenc="http://www.w3.org/2001/04/xmlenc#" Id="EncDataId-11056" Type="http://www.w3.org/2001/04/xmlenc#Content">
            <xenc:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes128-cbc" />
            <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
                <wsse:SecurityTokenReference xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
                    <wsse:Reference xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" URI="#EncKeyId-9E76CD1FC968BE065E155231051099013820" />
                </wsse:SecurityTokenReference>
            </ds:KeyInfo>
            <xenc:CipherData>
                <xenc:CipherValue>7Z+sDZXhoUkeLZTCpKNe34Ee0FzPWII4SOvZkCa5QgnJXZakGWnb9+/8nvhn4bZXIALAaM0sELYe
TG4c2l1sOM8HF5mdn4hVCfY9/fS2zZabHuO8LQtJgt5Ce0igmv8aDlji17vr855VGObzvSS4ZBOp
bHjOiZ5AoEGZToIFORxTyqfmNgWosc1kfVze5v9n9DkYVgmtDnRp4IEZtTIVliAU8FRXKCeaJw+1
l9ebqS5PhlPJDpIsb+94nYLpb1O7Xi4XDwI5tVGysf4QtsZQ3bwE1qLCwEqqJXp7gtz0y02eKs/a
rRHZQIuP7gSBLwMvpgAgzsTAJbX0TSP7oVGKvNS6QtLRwYHz4Nwz3vAvgvdO8TlYLg/7QMc4u9T4
1zDuKaouLPdxMzu3qIWKuCdplLwCpXjyKbACz0C3O1aMdyHtto6SKO3L3GaRplo61b1eHv0aZIUi
trtJMqO4osaLmFF3oI8DdSV4DpR+lLuFyLs86jHpadS+SyHF5wgA/x9wos7zTyZHkVuhptabhqBL
eJX9gyP5X2wEKIJV4mgBxtRSfSDqfkhV/uPiCqcNshFBRM-qZq79W1r9gVOCZx+2b3ZQPYjNcSxh
BXVzam1BsVjlVzlunxXvYY06pwPMyQgSQth3ItRRl9rTr/N+LCZpzucv305KIsD4Y2rRJiCBdDVB
uhRWh4GxLbF7AZQkvbBzzOhzmRICu92Bb8so1LSMgWkU/XG7zVgVLD+fKkJ1zCENdHS+kbn9sHsI
MwJrLlKO</xenc:CipherValue>
            </xenc:CipherData>
        </xenc:EncryptedData>
    </soap:Body>

(BillCzermak) #2

I would suggest saving your keys in separate files and reading them to []byte. Then you can add them to your message write them out as required.

I hope this helps. I dont use SOAP myself, only TLS


(system) closed #3

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.