@Test public void testUnmarshalling() throws Exception { ConstraintsParameters constraintsParameters = unmarshal(new File("src/test/resources/constraint.xml")); Algo algo = constraintsParameters.getSignatureConstraints().getBasicSignatureConstraints().getCryptographic().getMiniPublicKeySize().getAlgo().get(0); assertNotNull(algo); String algoName = algo.getValue(); assertEquals("DSA", algoName); assertEquals("128", algo.getSize()); JAXBContext jc = JAXBContext.newInstance("eu.europa.esig.jaxb.policy"); Marshaller marshaller = jc.createMarshaller(); marshaller.marshal(constraintsParameters, new FileOutputStream("target/constraint.xml")); }
ListAlgo miniPublicKeySize = constraint.getMiniPublicKeySize(); if ((miniPublicKeySize != null) && Utils.isCollectionNotEmpty(miniPublicKeySize.getAlgo())) { String keySize = token.getKeyLengthUsedToSignThisToken();