diff options
Diffstat (limited to 'common/src/at')
-rw-r--r-- | common/src/at/gv/egovernment/moa/util/Constants.java | 35 | ||||
-rw-r--r-- | common/src/at/gv/egovernment/moa/util/DOMUtils.java | 22 | ||||
-rw-r--r-- | common/src/at/gv/egovernment/moa/util/XPathUtils.java | 1 |
3 files changed, 56 insertions, 2 deletions
diff --git a/common/src/at/gv/egovernment/moa/util/Constants.java b/common/src/at/gv/egovernment/moa/util/Constants.java index 48b633b94..99fe81065 100644 --- a/common/src/at/gv/egovernment/moa/util/Constants.java +++ b/common/src/at/gv/egovernment/moa/util/Constants.java @@ -43,7 +43,7 @@ public interface Constants { /** Local location of the MOA ID configuration XML schema definition. */ public static final String MOA_ID_CONFIG_SCHEMA_LOCATION = - SCHEMA_ROOT + "MOA-ID-Configuration-1.2.xsd"; + SCHEMA_ROOT + "MOA-ID-Configuration-1.3.xsd"; /** URI of the Security Layer 1.0 namespace. */ public static final String SL10_NS_URI = @@ -66,7 +66,18 @@ public interface Constants { /** Local location of the Security Layer 1.1 XML schema definition */ public static final String SL11_SCHEMA_LOCATION = SCHEMA_ROOT + "Core.20020831.xsd"; + + /** URI of the Security Layer 1.2 XML namespace */ + public static final String SL12_NS_URI = + "http://www.buergerkarte.at/namespaces/securitylayer/1.2#"; + + /** Prefix used for the Security Layer 1.2 XML namespace */ + public static final String SL12_PREFIX = "sl"; + /** Local location of the Security Layer 1.2 XML schema definition */ + public static final String SL12_SCHEMA_LOCATION = + SCHEMA_ROOT + "Core-1.2.xsd"; + /** URI of the ECDSA XML namespace */ public static final String ECDSA_NS_URI = "http://www.w3.org/2001/04/xmldsig-more#"; @@ -101,9 +112,13 @@ public interface Constants { /** Prefix used for the PersonData XML namespace */ public static final String PD_PREFIX = "pr"; +// /** Local location of the PersonData XML schema definition */ +// public static final String PD_SCHEMA_LOCATION = +// SCHEMA_ROOT + "PersonData.xsd"; + /** Local location of the PersonData XML schema definition */ public static final String PD_SCHEMA_LOCATION = - SCHEMA_ROOT + "PersonData.xsd"; + SCHEMA_ROOT + "PersonData_20_en.xsd"; /** URI of the SAML namespace. */ public static final String SAML_NS_URI = @@ -208,6 +223,7 @@ public interface Constants { + (MOA_ID_CONFIG_NS_URI + " " + MOA_ID_CONFIG_SCHEMA_LOCATION + " ") + (SL10_NS_URI + " " + SL10_SCHEMA_LOCATION + " ") + (SL11_NS_URI + " " + SL11_SCHEMA_LOCATION + " ") + + (SL12_NS_URI + " " + SL12_SCHEMA_LOCATION + " ") + (ECDSA_NS_URI + " " + ECDSA_SCHEMA_LOCATION + " ") + (ECDSA_NS_URI_ANCIENT + " " + ECDSA_SCHEMA_LOCATION_ANCIENT + " ") + (ECDSA_NS_URI_WRONG + " " + ECDSA_SCHEMA_LOCATION_WRONG + " ") // TODO Entfernen, sobald ZMR umgestellt hat @@ -221,6 +237,21 @@ public interface Constants { + (DSIG_EC_NS_URI + " " + DSIG_EC_SCHEMA_LOCATION + " ") + (XMLLPR_NS_URI + " " + XMLLPR_SCHEMA_LOCATION); + /** URN prefix for bPK and wbPK. */ + public static final String URN_PREFIX = "urn:publicid:gv.at"; + + /** URN prefix for context dependent id. */ + public static final String URN_PREFIX_CDID = URN_PREFIX + ":cdid"; + + /** URN prefix for context dependent id (bPK). */ + public static final String URN_PREFIX_BPK = URN_PREFIX_CDID + "+bpk"; + + /** URN prefix for context dependent id (wbPK). */ + public static final String URN_PREFIX_WBPK = URN_PREFIX + ":wbpk"; + + /** URN prefix for context dependent id. */ + public static final String URN_PREFIX_BASEID = URN_PREFIX + ":baseid"; + /** Security Layer manifest type URI. */ public static final String SL_MANIFEST_TYPE_URI = "http://www.buergerkarte.at/specifications/Security-Layer/20020225#SignatureManifest"; diff --git a/common/src/at/gv/egovernment/moa/util/DOMUtils.java b/common/src/at/gv/egovernment/moa/util/DOMUtils.java index 53b1a0e48..52f6554d5 100644 --- a/common/src/at/gv/egovernment/moa/util/DOMUtils.java +++ b/common/src/at/gv/egovernment/moa/util/DOMUtils.java @@ -41,6 +41,7 @@ import org.xml.sax.ErrorHandler; import org.xml.sax.InputSource; import org.xml.sax.SAXException; + import at.gv.egovernment.moa.logging.Logger; /** @@ -832,5 +833,26 @@ public class DOMUtils { } return false; } + + /** + * Selects the (first) element from a node list and returns it. + * + * @param nl The NodeList to get the element from. + * @return The (first) element included in the node list or <code>null</code> + * if the node list is <code>null</code> or empty or no element is + * included in the list. + */ + public static Element getElementFromNodeList (NodeList nl) { + if ((nl == null) || (nl.getLength() == 0)) { + return null; + } + for (int i=0; i<nl.getLength(); i++) { + Node node = nl.item(i); + if (node.getNodeType() == Node.ELEMENT_NODE) { + return (Element)node; + } + } + return null; + } } diff --git a/common/src/at/gv/egovernment/moa/util/XPathUtils.java b/common/src/at/gv/egovernment/moa/util/XPathUtils.java index 0ed4fcda3..4ee160476 100644 --- a/common/src/at/gv/egovernment/moa/util/XPathUtils.java +++ b/common/src/at/gv/egovernment/moa/util/XPathUtils.java @@ -45,6 +45,7 @@ public class XPathUtils { Constants.MOA_ID_CONFIG_NS_URI); ctx.addNamespace(Constants.SL10_PREFIX, Constants.SL10_NS_URI); ctx.addNamespace(Constants.SL11_PREFIX, Constants.SL11_NS_URI); + ctx.addNamespace(Constants.SL12_PREFIX, Constants.SL12_NS_URI); ctx.addNamespace(Constants.ECDSA_PREFIX, Constants.ECDSA_NS_URI); ctx.addNamespace(Constants.PD_PREFIX, Constants.PD_NS_URI); ctx.addNamespace(Constants.SAML_PREFIX, Constants.SAML_NS_URI); |