com.sun.xml.wss.core.SecurityTokenReference stRef = null;
if(strElem instanceof com.sun.xml.ws.security.opt.impl.reference.KeyIdentifier){
com.sun.xml.ws.security.opt.impl.reference.KeyIdentifier keyIdStrElem = (com.sun.xml.ws.security.opt.impl.reference.KeyIdentifier)strElem;
if(MessageConstants.WSSE_SAML_KEY_IDENTIFIER_VALUE_TYPE.equals(keyIdStrElem.getValueType())){
stRef= new com.sun.xml.wss.core.SecurityTokenReference(doc);
SamlKeyIdentifier keyId = new SamlKeyIdentifier(doc);
keyId.setReferenceValue(keyIdStrElem.getReferenceValue());
keyId.setValueType(keyIdStrElem.getValueType());
stRef.setReference(keyId);
} else {
throw new XWSSecurityException("Unsupported reference type encountered");
}
}