|
IBM WebSphere Application ServerTM Release 7 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface SecurityContextToken13
This interface is responsible for the security context token, <wsu:SecurityContextToken> element.
It is defined in the specifications of
WS-SecureConvesation
Following is the sample code to get the security context token.
String path = "service/uri"; // path of security token service WSSFactory factory = WSSFactory.getInstance(); // generate the WSSGenerationContext and WSSConsumingContext objects // for request the security context token to the security token services. // configuration for a construction the message to request the security context token WSSGenerationContext gencontBootstrap = configureWSSGenerationContextForBootstrap(); // configuration for a validation the message containing the security context token WSSConsumingContext concontBootstrap = configureWSSConsumingContextForBootstrap(); // configuration for a construction the message to send to the application WSSGenerationContext gencontApp = configureWSSGenerationContextForApplication(); // configuration for a validation the message to be received from the application WSSConsumingContext concontApp = configureWSSConsumingContextForApplication(); // create the security context tokens SCTGenerateCallbackHandler sctgch = new SCTGenerateCallbackHandler(gencontBootstrap, concontBootstrap, path, WSSEncryption.AES128); SecurityToken[] scts = factory.newSecurityTokens(new Class[] {SecurityContextToken13.class}, sctgch); SecurityContextToken13 sct = null; if(scts != null ){ if(scts.length != 0) { sct = (SecurityContextToken13)scts[0]; // renew the security context token sct.renew(gencontBootstrap, concontBootstrap); // validate the security context token boolean isvalidate = sct.validate(gencontapp, concontapp); //cancel the security context token sct.cancel(gencontapp, concontapp); } }Notes: The specification describes the security token service provides some security context tokens. The current version provides the one security context token in a array of security token.
DerivedKeyToken
,
SCTGenerateCallbackHandler
,
SCTConsumeCallbackHandler
Field Summary | |
---|---|
static int |
STATUS_CANCELLED
Represents that the security context token is canceled. |
static int |
STATUS_ISSUED
Represents that the security context token is issued. |
static int |
STATUS_RENEWED
Represents that the security context token is renewed. |
static javax.xml.namespace.QName |
TokenQname
Represents the QName of this class, <wsu:SecurityContextToken>. |
static javax.xml.namespace.QName |
ValueType
Represents the value type. |
Fields inherited from interface com.ibm.websphere.wssecurity.wssapi.token.SecurityToken |
---|
DECRYPTING_KEY, ENCRYPTING_KEY, REF_EMBEDDED, REF_KEYID, REF_STR, REF_THUMBPRINT, SIGNING_KEY, VERIFING_KEY |
Method Summary | |
---|---|
void |
cancel()
Cancels this security context token, terminating its use. |
void |
cancel(WSSGenerationContext gencont,
WSSConsumingContext concont)
Cancels this security context token, terminating its use. |
java.util.Date |
getCreation(java.lang.String instance)
Returns the creation date of the instance. |
DerivedKeyToken |
getDerivedKeyToken(java.lang.String algorithm,
java.lang.String clientLabel,
java.lang.String serviceLabel)
Retreives the derived key token related with this security context token. |
java.util.Date |
getExpiration(java.lang.String instance)
Returns the expiration date of the instance. |
java.lang.String |
getIdentifier()
Returns the value of <wsu:Identifier>. |
java.lang.String[] |
getInstances()
Returns values of the <wsu:Instance>. |
int |
getStatus(java.lang.String instance)
Returns the status of the instance. |
void |
renew()
Renews this security context token with new expiration semantics. |
void |
renew(WSSGenerationContext gencont,
WSSConsumingContext concont)
Renews this security context token with new expiration semantics. |
boolean |
validate()
Evaluates the validity of current this security context token. |
boolean |
validate(WSSGenerationContext gencont,
WSSConsumingContext concont)
Evaluates the validity of current security context token. |
Methods inherited from interface com.ibm.websphere.wssecurity.wssapi.token.SecurityToken |
---|
getId, getKey, getKeyIdentifier, getKeyIdentifierEncodingType, getKeyIdentifierValueType, getKeyName, getPrincipal, getReferenceURI, getThumbprint, getThumbprintEncodingType, getThumbprintValueType, getTokenQname, getValueType, getXML |
Field Detail |
---|
static final int STATUS_ISSUED
static final int STATUS_RENEWED
static final int STATUS_CANCELLED
static final javax.xml.namespace.QName TokenQname
static final javax.xml.namespace.QName ValueType
Method Detail |
---|
void cancel() throws WSSException
WSSException
- if the security context token is not canceledvoid cancel(WSSGenerationContext gencont, WSSConsumingContext concont) throws WSSException
gencont
- WS-Security configuration of canceling the security context token to the security token serviceconcont
- WS-Security configuration of canceling the security context token to the security token service
WSSException
- if the security context token is not canceled.boolean validate() throws WSSException
WSSException
- if the security context token is not validated.boolean validate(WSSGenerationContext gencont, WSSConsumingContext concont) throws WSSException
gencont
- WS-Security configuration of canceling the security context token to the security token serviceconcont
- WS-Security configuration of canceling the security context token to the security token service
WSSException
- if the security context token is not validated.void renew() throws WSSException
WSSException
- if the the security context token is not recreatedvoid renew(WSSGenerationContext gencont, WSSConsumingContext concont) throws WSSException
gencont
- WS-Security configuration of canceling the security context token to the security token serviceconcont
- WS-Security configuration of canceling the security context token to the security token service
WSSException
- if the security context token is not recreated.DerivedKeyToken getDerivedKeyToken(java.lang.String algorithm, java.lang.String clientLabel, java.lang.String serviceLabel) throws WSSException
algorithm
- to use for generating the derived keylabel
- to use for generating the derived key
WSSException
- if the derived key is not createdjava.lang.String getIdentifier()
java.lang.String[] getInstances()
java.util.Date getCreation(java.lang.String instance)
instance
- instance
java.util.Date getExpiration(java.lang.String instance)
instance
- instance
int getStatus(java.lang.String instance)
instance
- instance
|
IBM WebSphere Application ServerTM Release 7 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |