}
public Collection<String> process(Document message, SecurityProcess process) throws WSSecurityException
{
Collection<String> ids = new HashSet<String>();
EncryptedKey key = (EncryptedKey) process;
ReferenceList list = key.getReferenceList();
for (String uri : list.getAllReferences())
{
Element element = Util.findElementByWsuId(message.getDocumentElement(), uri);
if (element == null)
throw new WSSecurityException("A reference list refered to an element that was not found: " + uri);
if (!isEncryptedData(element))
throw new WSSecurityException("Malformed reference list, a non encrypted data element was referenced: " + uri);
ids.add(decryptElement(element, key.getSecretKey()));
}
return ids;
}