Top

Name

xenc_encrypt — Encrypt and optionally sign a SOAP message

Synopsis

varchar xenc_encrypt ( in message varchar ,
  in soap_ver int ,
  in template varchar ,
  in ns any ,
  in xp-n varchar ,
  in ki-n any ,
  in what-n varchar ,
  ... );
 

Description

Encrypt SOAP message and optionally attach an XML signature. The keys are retrieved from the key store of the calling user account.

Parameters

message

A string containing SOAP message

soap_ver

SOAP version (11 = 1.1, 10 = 1.0 etc.)

template

a string containing Digital signature template.

ns

an array of strings containing WS-Security extension and WS-Utility version information.

xp-n

XPath expression to locate n-th part of the message to be encrypted

ki-n

Key instance to encrypt the part

what-n

'Content' - the content under located element will be encrypted; 'Element' the located element and content will be encrypted.

Return Types

On success the function will return a string containing encrypted and optionally signed SOAP message.

Examples

Example 24.458. Encrypting and signing SOAP message

...
ns := vector ();
template := dsig_template_ext (...);
keyi := xenc_key_inst_create ('myAES', xenc_key_inst_create ('rsa-test'));
resp := xenc_encrypt (request, 11, template, ns, '/Envelope/Body', keyi, 'Content');
...