robrichards / wse-php

Libraries for adding WS-* support to ext/soap in PHP
129 stars 92 forks source link

feature: encrypt element content #35

Open appfeel opened 6 years ago

appfeel commented 6 years ago

Previously wee-php was designed to encrypt 'Body' element. I've added the option to encrypt an element inside body instead, and also what type of encryption: content or element.

Usage:

$options = array(
    'KeyInfo' => array("X509SubjectKeyIdentifier" => true),
    'ElementToEncrypt' => array(
        'name' => 'MyElement',
        'Content' => true,
    ),
);
$objWSSE->encryptSoapDoc($siteKey, $objKey, $options, false);

Hope it helps!