Skip to content

Gsoap is not encrypting the body of the soap message #3

@rohitkesarvani55

Description

@rohitkesarvani55

I am trying to encrypt the soap message using the function soap_wsse_add_EncryptedKey() but it is not encrypting the soap body.

Here is the snapshot of the code.

soap_wsse_set_wsu_id((*proxy)->soap, "wsse:BinarySecurityToken SOAP-ENV:Body");

if ( soap_wsse_add_BinarySecurityTokenX509((*proxy)->soap, "X509Token", *cert1 )
|| soap_wsse_add_KeyInfo_SecurityTokenReferenceX509((*proxy)->soap, "#X509Token")
|| soap_wsse_sign_body((*proxy)->soap, SOAP_SMD_SIGN_RSA_SHA256, *pkey1, 0)
|| soap_wsse_sign_only((*proxy)->soap, "SOAP-ENV:Body") ) {
	return ( 3 );
}
    soap_wsse_add_EncryptedKey((*proxy)->soap, SOAP_MEC_AES256_CBC, "Cert", <X509> public key cert, NULL, NULL, NULL)

Document says to follow this way to encrypt. but it is failing to encrypt the data, I am using gsoap-2.8.116, same was happening with lower version of gsoap. Any help will be highly appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions