You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ws.apache.org by Apache Wiki <wi...@apache.org> on 2005/10/04 12:43:30 UTC
[Ws Wiki] Update of "FrontPage/WsFx/wss4jFAQ" by UlfDittmer
Dear Wiki user,
You have subscribed to a wiki page or wiki category on "Ws Wiki" for change notification.
The following page has been changed by UlfDittmer:
http://wiki.apache.org/ws/FrontPage/WsFx/wss4jFAQ
The comment on the change is:
fleshed out WSSecurityEngineResult handling
------------------------------------------------------------------------------
Vector hResults = hResult.getResults();
for (int j = 0; j < hResults.size(); j++) {
WSSecurityEngineResult eResult = (WSSecurityEngineResult) hResults.get(j);
- // An encryption or timestamp action does not have an associated principal
+ // An encryption or timestamp action does not have an associated principal,
// only Signature and UsernameToken actions return a principal
- if (eResult.getAction() != WSConstants.ENCR &&
+ if ((eResult.getAction() == WSConstants.SIGN)
- eResult.getAction() != WSConstants.TS) {
+ || (eResult.getAction() == WSConstants.UT)) {
+ // Signature and UsernameToken actions return a principal
System.out.println("Principal's name: " + eResult.getPrincipal().getName());
- }
+ } else if (eResult.getAction() == WSConstants.ENCR) {
+ // Encryption action returns what ?
+ } else if (eResult.getAction() == WSConstants.TS) {
+ // Timestamp action returns a Timestamp
+ System.out.println("Timestamp created: " + eResult.getTimestamp().getCreated());
+ System.out.println("Timestamp expires: " + eResult.getTimestamp().getExpires());
+ }
}
}
}}}