canonWriter.writeEndElement();
}
reader.next();
//resolve Key.
URIResolver resolver = new URIResolver(pc);
JAXBValidateContext validateContext = new JAXBValidateContext();
validateContext.setURIDereferencer(resolver);
validateContext.put(MessageConstants.WSS_PROCESSING_CONTEXT, pc);
return KeySelectorImpl.resolveKeyIdentifier(validateContext,valueType,keyIdentifier,id,purpose);
}catch(KeySelectorException kse){
logger.log(Level.SEVERE, LogStringsMessages.WSS_1816_ERROR_REFERENCE_MECHANISM("KeyIdentifier"),kse);
throw new XWSSecurityException(LogStringsMessages.WSS_1816_ERROR_REFERENCE_MECHANISM("KeyIdentifier"), kse);
}catch(XMLStreamException xe){