use of javax.xml.crypto.dsig.spec.ExcC14NParameterSpec in project santuario-java by apache.
the class DOMExcC14NMethod method unmarshalParams.
private void unmarshalParams(Element paramsElem) {
String prefixListAttr = paramsElem.getAttributeNS(null, "PrefixList");
this.inclusiveNamespaces = prefixListAttr;
int begin = 0;
int end = prefixListAttr.indexOf(' ');
List<String> prefixList = new ArrayList<>();
while (end != -1) {
prefixList.add(prefixListAttr.substring(begin, end));
begin = end + 1;
end = prefixListAttr.indexOf(' ', begin);
}
if (begin <= prefixListAttr.length()) {
prefixList.add(prefixListAttr.substring(begin));
}
this.params = new ExcC14NParameterSpec(prefixList);
}
use of javax.xml.crypto.dsig.spec.ExcC14NParameterSpec in project santuario-java by apache.
the class CanonicalizationMethodTest method testIsFeatureSupported.
@org.junit.Test
public void testIsFeatureSupported() throws Exception {
CanonicalizationMethod cm;
for (int i = 0; i < C14N_ALGOS.length; i++) {
String algo = C14N_ALGOS[i];
ExcC14NParameterSpec params = null;
if (i >= 2) {
params = new ExcC14NParameterSpec();
}
cm = factory.newCanonicalizationMethod(algo, params);
try {
cm.isFeatureSupported(null);
fail("Should raise a NPE for null feature");
} catch (NullPointerException npe) {
}
assertTrue(!cm.isFeatureSupported("not supported"));
}
}
Aggregations