if(dpTokenID.length() == 0){
dk = elementFactory.createDerivedKey(dtk.getUUID(),algorithm,dkt.getNonce(),dkt.getOffset(),dkt.getLength(),dkt.getLabel(),str, context.getSecurityPolicyVersion());
}else{
dk = elementFactory.createDerivedKey(dtk.getUUID(),algorithm,dkt.getNonce(),dkt.getOffset(),dkt.getLength(),dkt.getLabel(),str,dpTokenID, context.getSecurityPolicyVersion());
}
DirectReference dr = elementFactory.createDirectReference();
dr.setURI("#"+dk.getId());
SecurityTokenReference str2 = buildSTR(context.generateID(),dr);
context.getSecurityHeader().add(dk);
//Construct the STR for Encryption or Signature
buildKeyInfo(str2);
dktResult.setKeyInfo(super.keyInfo);