/** {@inheritDoc} */ protected void processChildElement(XMLObject parentXMLObject, XMLObject childXMLObject) throws UnmarshallingException { ReferenceList rl = (ReferenceList) parentXMLObject; if (childXMLObject instanceof DataReference) { rl.getReferences().add((DataReference) childXMLObject); } else if (childXMLObject instanceof KeyReference) { rl.getReferences().add((KeyReference) childXMLObject); } else { super.processChildElement(parentXMLObject, childXMLObject); } }
|| encryptedKey.getReferenceList().getDataReferences().isEmpty() ) { return true; List<DataReference> drlist = encryptedKey.getReferenceList().getDataReferences(); for (DataReference dr : drlist) { if (DatatypeHelper.isEmpty(dr.getURI()) || ! dr.getURI().startsWith("#") ) {
|| encryptedKey.getReferenceList().getDataReferences().isEmpty() ) { return true; List<DataReference> drlist = encryptedKey.getReferenceList().getDataReferences(); for (DataReference dr : drlist) { if (DatatypeHelper.isEmpty(dr.getURI()) || ! dr.getURI().startsWith("#") ) {
/** * Link a single EncryptedKey to the EncryptedData according to guidelines in SAML Errata E43. * * @param encData the EncryptedData * @param encKey the EncryptedKey */ protected void linkSinglePeerKey(EncryptedData encData, EncryptedKey encKey) { log.debug("Linking single peer EncryptedKey with RetrievalMethod and DataReference"); // Forward reference from EncryptedData to the EncryptedKey RetrievalMethod rm = retrievalMethodBuilder.buildObject(); rm.setURI("#" + encKey.getID()); rm.setType(EncryptionConstants.TYPE_ENCRYPTED_KEY); encData.getKeyInfo().getRetrievalMethods().add(rm); // Back reference from the EncryptedKey to the EncryptedData DataReference dr = dataReferenceBuilder.buildObject(); dr.setURI("#" + encData.getID()); encKey.getReferenceList().getDataReferences().add(dr); }
/** {@inheritDoc} */ protected void processChildElement(XMLObject parentXMLObject, XMLObject childXMLObject) throws UnmarshallingException { ReferenceList rl = (ReferenceList) parentXMLObject; if (childXMLObject instanceof DataReference) { rl.getReferences().add((DataReference) childXMLObject); } else if (childXMLObject instanceof KeyReference) { rl.getReferences().add((KeyReference) childXMLObject); } else { super.processChildElement(parentXMLObject, childXMLObject); } }
encKey.getReferenceList().getDataReferences().add(dr);
/** * Validate the list of references. * * @param xmlObject the object to validate * @throws ValidationException thrown if the object is invalid */ protected void validateReferences(ReferenceList xmlObject) throws ValidationException { if (xmlObject.getReferences().isEmpty()) { throw new ValidationException("No DataReference or KeyReference children were present in the ReferenceList object"); } }
/** * Validate the list of references. * * @param xmlObject the object to validate * @throws ValidationException thrown if the object is invalid */ protected void validateReferences(ReferenceList xmlObject) throws ValidationException { if (xmlObject.getReferences().isEmpty()) { throw new ValidationException("No DataReference or KeyReference children were present in the ReferenceList object"); } }