|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.systinet.wasp.security.ws.SecurityTokenHandlerSPI
Abstract base class for implementation of WS-Security security token handlers.
Implementations of this class handle custom binary security tokens only. Custom binary
security token are distinguished by valueType
, that indicates token's "value space".
Implementation of security token handler handles corresponding implementation of security token
.
Security token handler and Security token processing:
SecurityTokenConf
configuration interface. The valueType
returned by SecurityTokenConf.getType()
identifies handler (handler's valueType
is given by getLocalValueType()
.
When handler is choosen, its method createFromConf(SecurityTokenConf,SecurityContext,boolean)
is called. Handler
has to return instance of corresponding security token from given configuration. From this moment the security token instance is asked for keys
. When SecurityTokenSPI.doFinal(int)
on the security token instance is called the security token's element is added to the message's security header. After this call the security
token is destroyed (no one can further reference it).
external security tokens
on the sender side
createFromConf(SecurityTokenConf,SecurityContext,boolean)
. In next processing there is one exception for external security tokens processing -
method SecurityTokenSPI.doFinal(int)
is not called - thus security token's element is not added to the message's security header
and it is not destroyed (it can be referenced till the end of processing).
wsse:BinarySecurityToken
element, then element's ValueType
attribute
identifies handler. The handler's method createFromXML(Element,SecurityContext)
is called. Handler
has to return instance of corresponding security token created from given DOM Element. Then methods SecurityTokenSPI.doFinal(int)
and
SecurityTokenSPI.getReceivedConf()
are called on the security token instance - since this point the security token can
be asked for keys
. The instance of security token exists till the end of the message's security header processing.
external security tokens
on the receiver side
SecurityTokenSPI.doFinal(int)
is called and
in contrast to processing of external security token on the sender side, they remain till the end of the message's
security header processing.
addSecurityTokenHandler(org.systinet.wasp.security.ws.SecurityTokenHandlerSPI)
method to add security token handler in runtime.
WSSEGlobalConf
for details.
Constructor Summary | |
SecurityTokenHandlerSPI()
|
Method Summary | |
static void |
addSecurityTokenHandler(SecurityTokenHandlerSPI securityTokenHandler)
This method adds security token handler to the list of security token handlers in the runtime. |
abstract SecurityTokenSPI |
createFromConf(SecurityTokenConf tokenConf,
SecurityContext securityContext,
boolean isExternal)
Creates a security token from given configuration. |
abstract SecurityTokenSPI |
createFromXML(org.w3c.dom.Element tokenElement,
SecurityContext securityContext)
Creates the security token from the given element on the receiver side. |
java.lang.String |
getLocalElementName()
This method is used on the receiver's side to map received element to corresponding security token handler. |
abstract java.lang.String |
getLocalValueType()
Returns local part of the security token valueType handled by the handler. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SecurityTokenHandlerSPI()
Method Detail |
public abstract java.lang.String getLocalValueType()
valueType
handled by the handler.
Used on both sender's and receiver's sides.
public abstract SecurityTokenSPI createFromConf(SecurityTokenConf tokenConf, SecurityContext securityContext, boolean isExternal) throws WSSecurityException
ExternalSecurityTokensConf
.
If it is not possible to create security token from given configuration WSSecurityException
must be thrown.
tokenConf
- the configurationisExternal
- external token flag
WSSecurityException
- thrown if security token instance cannot be created from the configuration or created security token is invalidpublic java.lang.String getLocalElementName()
BinarySecurityToken
by defaultpublic abstract SecurityTokenSPI createFromXML(org.w3c.dom.Element tokenElement, SecurityContext securityContext) throws WSSecurityException
WSSecurityException
must be thrown.
tokenElement
- element, which represents the security token in the XML
WSSecurityException
- thrown if security token instance cannot be created from the element or created security token is invalidpublic static void addSecurityTokenHandler(SecurityTokenHandlerSPI securityTokenHandler)
WSSEGlobalConf.setSecurityTokenHandlers
.
securityTokenHandler
- instance of security token handler
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |