throw new PolicyException(ex);
}
key.setUUID(token.getTokenId());
key.isOptional(((PolicyAssertion) token).isOptional());
setTokenInclusion(key,token);
UserNameToken ut = (UserNameToken)token;
key.setUseCreated(ut.useCreated());
key.setUseNonce(ut.useNonce());
if(!ut.hasPassword()){
key.setNoPassword(true);
} else if(ut.useHashPassword()){
key.setDigestOn(true);
key.setUseNonce(true);
}
if(ut.getIssuer() != null){
Address addr = ut.getIssuer().getAddress();
if(addr != null)
key.setIssuer(addr.getURI().toString());
} else if(ut.getIssuerName() != null){
key.setIssuer(ut.getIssuerName().getIssuerName());
}
if(ut.getClaims() != null){
key.setClaims(ut.getClaims().getClaimsAsBytes());
}
//key.setPolicyToken(token);
return key;
}else if(PolicyUtil.isSamlToken((PolicyAssertion) token, spVersion)){