You are viewing a plain text version of this content. The canonical link for it is here.
Posted to rampart-dev@ws.apache.org by David Robertson <dw...@lbl.gov> on 2007/09/14 03:44:54 UTC

dynamically setting signer

Is there a mechanism to programmatically set (overriding an axis2.xml 
file) which user signs a message.

Thanks,

-David Robertson



Re: dynamically setting signer

Posted by Nandana Mihindukulasooriya <na...@gmail.com>.
Hi David,
        IFAIK, you can set the rampart configuration by setting Axis2 inflow
and
outflow configuration parameters programmatically.

Eg.

        ServiceClient client = new ServiceClient(ctx, null);

        Options options = new Options();
        OutflowConfiguration ofc = new OutflowConfiguration();
        ofc.setActionItems("Timestamp Signature Encrypt");
        ofc.setUser("client");
        ofc.setPasswordCallbackClass("
org.apache.rampart.samples.sample11.PWCBHandler");
        ofc.setSignaturePropFile("client.properties");
        ofc.setSignatureKeyIdentifier(
WSSHandlerConstants.BST_DIRECT_REFERENCE);
        ofc.setEncryptionKeyIdentifier(WSSHandlerConstants.ISSUER_SERIAL);
        ofc.setEncryptionUser("service");

        //Set the rampart parameters
        options.setProperty(WSSHandlerConstants.OUTFLOW_SECURITY,
ofc.getProperty();

        client.setOptions(options);

        //Engage rampart
        client.engageModule("rampart");

      This was taken from the example 11 of rampart-samples module under
basic and it shows
how to set rampart configuration programmatically. You may also find this
presentation
 http://wso2.org/files/rampart-tute.pdf very useful.

Regards,
Nandana



On 9/13/07, David Robertson <dw...@lbl.gov> wrote:
>
> Is there a mechanism to programmatically set (overriding an axis2.xml
> file) which user signs a message.
>
> Thanks,
>
> -David Robertson
>
>
>