encrypt.prepare(doc, CryptoFactory.getInstance("transmitter-crypto.properties"));
Element refs = encrypt.encryptForRef(null, parts);
encrypt.addAttachmentEncryptedDataElements(secHeader);
encrypt.addExternalRefElement(refs, secHeader);
encrypt.prependToHeader(secHeader);
NodeList references = doc.getElementsByTagNameNS(WSConstants.ENC_NS, "DataReference");
Assert.assertEquals(2, references.getLength());
NodeList cipherReferences = doc.getElementsByTagNameNS(WSConstants.ENC_NS, "CipherReference");
Assert.assertEquals(1, cipherReferences.getLength());