The WSS4JInInterceptor attaches the X509 certificate that was used for
signature to the message with:

WSSecurityEngineResult actionResult = 
    WSSecurityUtil.fetchActionResult(wsResult, WSConstants.SIGN);
msg.put(SIGNATURE_RESULT, actionResult);

You can access this downstream by doing something like:

WSSecurityEngineResult result = 
 (WSSecurityEngineResult)
inmsg.get(WSS4JInInterceptor.SIGNATURE_RESULT);

X509Certificate certificate = 
    (X509Certificate)result
            .get(WSSecurityEngineResult.TAG_X509_CERTIFICATE);

You can manipulate this X509Certificate object to get what you want I
think.

Colm.

-----Original Message-----
From: marcelo melo [mailto:[EMAIL PROTECTED] 
Sent: 01 May 2008 01:40
To: [email protected]
Subject: Retrieve the user using WS-Security and Signature

Hi all,

I am developing a service using signatures only, with no user-password
authentication. However, when developing a Client, I am forced to set
a user in order to invoke the service. Is there a way of retrieving
the user on the server side (for auditing purposes)?
I tried to use a password callback handler, which succesfully
retrieved me the user, but required me to correctly inform a password,
which I don't (at least won't if the key is not generated by me) know.
Also, if someone could give me an insight of how, if possible, to use
this user on my service class, I would be very grateful.

Thanks

----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland

Reply via email to