EncryptedKeyElement extends AbstractEncryptionElement { public List<AbstractRefElement> getReferenceElementList() { return m_ReferenceElementList; } EncryptedKeyElement( Element encKeyElement ); int getWrappingEncDataIndex(); void setWrappingEncDataIndex( int wrappingEncDataIndex ); List<AbstractRefElement> getReferenceElementList(); void setEnwrapEncData( EncryptedDataElement encData ); EncryptedDataElement getEnwrapEncData(); boolean hasEnwrapEncData();  }
@Test public void testSomeMethod() throws FileNotFoundException, XPathExpressionException, SAXException { EncryptedKeyElement encKey; EncryptedDataElement encDat; encKey = null; List<Element> encKeya = new ArrayList<Element>(); try { Document doc = DomUtilities.readDocument( "src/test/resources/case_encKey_encData_signed.xml" ); encKeya = (List<Element>) DomUtilities.evaluateXPath( doc, " + URI_NS_ENC + "']" ); for ( Element enc : encKeya ) { encKey = new EncryptedKeyElement( enc ); } assertEquals( "http: assertEquals( "EncKeyId-urn:uuid:64DB4A7E53F67EF3F112142272504712", encKey.getIdValue() ); CipherValueElement ciph = (CipherValueElement) encKey.getCipherDataChild(); String test = ciph.getEncryptedData(); assertEquals( "Y1G4IvsVfHLHWEW89D7wC7wVYfks1/Q5JHru0NaZlDE89rRTIITZrjjS6ajcXcjNiRcQMbElYoG4tnfX" + "OyqOYYPAWaBGXbQIQo+jFZq+hHfYt+j8YrOP8hg9uELzwtmPT7GAv1bFn+dEwEU6Ez5ZdCVH0cImWcf" + "1fdezMkxvXcY=", ciph.getEncryptedData() ); assertEquals( 1, encKey.getReferenceElementList().size() ); DataReferenceElement dataRef = (DataReferenceElement) encKey.getReferenceElementList().get( 0 ); encDat = dataRef.getRefEncData(); assertEquals( "http: assertEquals( "EncDataId-3808966", encDat.getIdValue() ); assertEquals( "http: assertEquals( "", encDat.getMimeType() ); ciph = (CipherValueElement) encDat.getCipherDataChild(); assertEquals( "lSDNH2zpu/R0039i85GoB93Sp2hg3rl20exTPccmN26YCt9rX54cbXFDwbZuIATYl52YPYHkHLK1WZP0JW+o7G8mjPAxiwBU" + "K5hWwoOO1/I35wV7wJIvARS6CxS+IhHK3fnXsee8nLZulYaH1LDv7R+if2S1/v6YdhNodtZh2UqEZq0iHkr+GChEDwWpaiOUnyQ8m" + "JS3hRq4GYnJEk4apQBIeuF8t64mNmY+ISlqNvQes2w5YVOsTUptmH4HPyVnfRuO/5tr7VNbh00myh0/309W8qgLCUlMJqN9nRa1v5+M" + "X9t68pUgg92V1bV/46wE4xGDxyGgxk9asrJDvt+vNreMl5o3dOnvIaI8W5Dwpp/o7IkMtlFlT3aP7cETJ/Kb7VXLasQju2qPnSceXLJOW" + "jLmMlqf9HraAmjaM/IbyEo=", ciph.getEncryptedData() ); } catch ( IOException ex ) { LOG.error( ex ); } }