Object header = context.getSecurityHeader().getChildElement(target.getValue());
if(header != null){
if(header instanceof SecurityTokenReference){
SecurityTokenReference str = (SecurityTokenReference)header;
Reference reference = str.getReference();
String refValue = null;
if(MessageConstants.KEY_INDETIFIER_TYPE.equals(reference.getType())){
refValue = ((KeyIdentifier)reference).getReferenceValue();
} else if(MessageConstants.DIRECT_REFERENCE_TYPE.equals(reference.getType())){
refValue = ((DirectReference)reference).getURI();
}
if(refValue != null){
if(refValue.startsWith("#")){
refValue = refValue.substring(1);