final RequestedSecurityToken securityToken = rstr.getRequestedSecurityToken();
// Requested References
final RequestedAttachedReference attachedRef = rstr.getRequestedAttachedReference();
final RequestedUnattachedReference unattachedRef = rstr.getRequestedUnattachedReference();
// RequestedProofToken
final RequestedProofToken proofToken = rstr.getRequestedProofToken();
// Obtain the secret key for the context
final byte[] key = getKey(wstVer, rstr, proofToken, rst, appliesTo);
if(key != null){
context.setProofKey(key);
}
//get the creation time and expires time and set it in the context
setLifetime(rstr, context);
// if securityToken == null and proofToken == null
// throw exception
if(securityToken == null && proofToken == null){
log.log(Level.SEVERE,
LogStringsMessages.WST_0018_TOKENS_NULL(appliesTo));
throw new WSTrustException(
LogStringsMessages.WST_0018_TOKENS_NULL(appliesTo));
}
if (securityToken != null){
context.setSecurityToken(securityToken.getToken());
}
if(attachedRef != null){
context.setAttachedSecurityTokenReference(attachedRef.getSTR());
}
if (unattachedRef != null){
context.setUnAttachedSecurityTokenReference(unattachedRef.getSTR());
}
}else if (rst.getRequestType().toString().equals(wstVer.getValidateRequestTypeURI())){
Status status = rstr.getStatus();
context.getOtherProperties().put(IssuedTokenContext.STATUS, status);
final RequestedSecurityToken securityToken = rstr.getRequestedSecurityToken();