summaryrefslogtreecommitdiff
path: root/utils/src/main/java/at
diff options
context:
space:
mode:
authorclemenso <clemenso@8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4>2009-01-20 17:01:09 +0000
committerclemenso <clemenso@8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4>2009-01-20 17:01:09 +0000
commita7d404cd6db2724d36523e59c87c3007fa86a258 (patch)
treee938b10cccf606c062fdb4cf569b8245a83b8a37 /utils/src/main/java/at
parentc97c49eb4399829603816e4b3e47c74b67d0f27b (diff)
parentce598ba5142ff7673085dd90865f9323d69574be (diff)
downloadmocca-a7d404cd6db2724d36523e59c87c3007fa86a258.tar.gz
mocca-a7d404cd6db2724d36523e59c87c3007fa86a258.tar.bz2
mocca-a7d404cd6db2724d36523e59c87c3007fa86a258.zip
[maven-release-plugin] copy for tag mocca-1.0.2mocca-1.0.2
git-svn-id: https://joinup.ec.europa.eu/svn/mocca/tags/mocca-1.0.2@276 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4
Diffstat (limited to 'utils/src/main/java/at')
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/cardchannel/ATRType.java100
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/cardchannel/AttributeList.java71
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/cardchannel/AttributeType.java264
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/cardchannel/CommandAPDUType.java154
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/cardchannel/ObjectFactory.java170
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/cardchannel/ResetType.java64
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/cardchannel/ResponseAPDUType.java161
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/cardchannel/ResponseType.java78
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/cardchannel/ScriptType.java80
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/cardchannel/VerifyAPDUType.java266
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/cardchannel/package-info.java2
-rw-r--r--utils/src/main/java/at/gv/egiz/bku/utils/DebugOutputStream.java48
-rw-r--r--utils/src/main/java/at/gv/egiz/bku/utils/DebugReader.java58
-rw-r--r--utils/src/main/java/at/gv/egiz/bku/utils/DebugWriter.java55
-rw-r--r--utils/src/main/java/at/gv/egiz/bku/utils/NullOutputStream.java10
-rw-r--r--utils/src/main/java/at/gv/egiz/idlink/IdentityLinkFactory.java213
16 files changed, 1691 insertions, 103 deletions
diff --git a/utils/src/main/java/at/buergerkarte/namespaces/cardchannel/ATRType.java b/utils/src/main/java/at/buergerkarte/namespaces/cardchannel/ATRType.java
new file mode 100644
index 00000000..9620e66b
--- /dev/null
+++ b/utils/src/main/java/at/buergerkarte/namespaces/cardchannel/ATRType.java
@@ -0,0 +1,100 @@
+
+package at.buergerkarte.namespaces.cardchannel;
+
+import java.math.BigInteger;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlSchemaType;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlValue;
+import javax.xml.bind.annotation.adapters.HexBinaryAdapter;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
+
+/**
+ * Contains the ATR received as reponse to a Reset
+ * command
+ *
+ * <p>Java class for ATRType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * &lt;complexType name="ATRType">
+ * &lt;simpleContent>
+ * &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema>hexBinary">
+ * &lt;attribute name="rc" type="{http://www.w3.org/2001/XMLSchema}integer" default="0" />
+ * &lt;/extension>
+ * &lt;/simpleContent>
+ * &lt;/complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "ATRType", propOrder = {
+ "value"
+})
+public class ATRType {
+
+ @XmlValue
+ @XmlJavaTypeAdapter(HexBinaryAdapter.class)
+ @XmlSchemaType(name = "hexBinary")
+ protected byte[] value;
+ @XmlAttribute
+ protected BigInteger rc;
+
+ /**
+ * Gets the value of the value property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public byte[] getValue() {
+ return value;
+ }
+
+ /**
+ * Sets the value of the value property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setValue(byte[] value) {
+ this.value = ((byte[]) value);
+ }
+
+ /**
+ * Gets the value of the rc property.
+ *
+ * @return
+ * possible object is
+ * {@link BigInteger }
+ *
+ */
+ public BigInteger getRc() {
+ if (rc == null) {
+ return new BigInteger("0");
+ } else {
+ return rc;
+ }
+ }
+
+ /**
+ * Sets the value of the rc property.
+ *
+ * @param value
+ * allowed object is
+ * {@link BigInteger }
+ *
+ */
+ public void setRc(BigInteger value) {
+ this.rc = value;
+ }
+
+}
diff --git a/utils/src/main/java/at/buergerkarte/namespaces/cardchannel/AttributeList.java b/utils/src/main/java/at/buergerkarte/namespaces/cardchannel/AttributeList.java
new file mode 100644
index 00000000..70ad7b91
--- /dev/null
+++ b/utils/src/main/java/at/buergerkarte/namespaces/cardchannel/AttributeList.java
@@ -0,0 +1,71 @@
+
+package at.buergerkarte.namespaces.cardchannel;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * Contains a list of attributes
+ *
+ * <p>Java class for AttributeList complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * &lt;complexType name="AttributeList">
+ * &lt;complexContent>
+ * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * &lt;sequence>
+ * &lt;element name="Attribute" type="{}AttributeType" maxOccurs="unbounded" minOccurs="0"/>
+ * &lt;/sequence>
+ * &lt;/restriction>
+ * &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "AttributeList", propOrder = {
+ "attribute"
+})
+public class AttributeList {
+
+ @XmlElement(name = "Attribute")
+ protected List<AttributeType> attribute;
+
+ /**
+ * Gets the value of the attribute property.
+ *
+ * <p>
+ * This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
+ * This is why there is not a <CODE>set</CODE> method for the attribute property.
+ *
+ * <p>
+ * For example, to add a new item, do as follows:
+ * <pre>
+ * getAttribute().add(newItem);
+ * </pre>
+ *
+ *
+ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link AttributeType }
+ *
+ *
+ */
+ public List<AttributeType> getAttribute() {
+ if (attribute == null) {
+ attribute = new ArrayList<AttributeType>();
+ }
+ return this.attribute;
+ }
+
+}
diff --git a/utils/src/main/java/at/buergerkarte/namespaces/cardchannel/AttributeType.java b/utils/src/main/java/at/buergerkarte/namespaces/cardchannel/AttributeType.java
new file mode 100644
index 00000000..60d467e0
--- /dev/null
+++ b/utils/src/main/java/at/buergerkarte/namespaces/cardchannel/AttributeType.java
@@ -0,0 +1,264 @@
+
+package at.buergerkarte.namespaces.cardchannel;
+
+import java.math.BigInteger;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlSchemaType;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.datatype.XMLGregorianCalendar;
+
+
+/**
+ * Contains an attribute converted from ASN.1
+ *
+ * <p>Java class for AttributeType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * &lt;complexType name="AttributeType">
+ * &lt;complexContent>
+ * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * &lt;sequence>
+ * &lt;element name="Integer" type="{http://www.w3.org/2001/XMLSchema}integer" minOccurs="0"/>
+ * &lt;element name="Latin1String" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ * &lt;element name="UTF8String" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ * &lt;element name="NumericString" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ * &lt;element name="PrintableString" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ * &lt;element name="GeneralizedTime" type="{http://www.w3.org/2001/XMLSchema}dateTime" minOccurs="0"/>
+ * &lt;element name="Date" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ * &lt;/sequence>
+ * &lt;attribute name="oid" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * &lt;/restriction>
+ * &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "AttributeType", propOrder = {
+ "integer",
+ "latin1String",
+ "utf8String",
+ "numericString",
+ "printableString",
+ "generalizedTime",
+ "date"
+})
+public class AttributeType {
+
+ @XmlElement(name = "Integer")
+ protected BigInteger integer;
+ @XmlElement(name = "Latin1String")
+ protected String latin1String;
+ @XmlElement(name = "UTF8String")
+ protected String utf8String;
+ @XmlElement(name = "NumericString")
+ protected String numericString;
+ @XmlElement(name = "PrintableString")
+ protected String printableString;
+ @XmlElement(name = "GeneralizedTime")
+ @XmlSchemaType(name = "dateTime")
+ protected XMLGregorianCalendar generalizedTime;
+ @XmlElement(name = "Date")
+ protected String date;
+ @XmlAttribute(required = true)
+ protected String oid;
+
+ /**
+ * Gets the value of the integer property.
+ *
+ * @return
+ * possible object is
+ * {@link BigInteger }
+ *
+ */
+ public BigInteger getInteger() {
+ return integer;
+ }
+
+ /**
+ * Sets the value of the integer property.
+ *
+ * @param value
+ * allowed object is
+ * {@link BigInteger }
+ *
+ */
+ public void setInteger(BigInteger value) {
+ this.integer = value;
+ }
+
+ /**
+ * Gets the value of the latin1String property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getLatin1String() {
+ return latin1String;
+ }
+
+ /**
+ * Sets the value of the latin1String property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setLatin1String(String value) {
+ this.latin1String = value;
+ }
+
+ /**
+ * Gets the value of the utf8String property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getUTF8String() {
+ return utf8String;
+ }
+
+ /**
+ * Sets the value of the utf8String property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setUTF8String(String value) {
+ this.utf8String = value;
+ }
+
+ /**
+ * Gets the value of the numericString property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getNumericString() {
+ return numericString;
+ }
+
+ /**
+ * Sets the value of the numericString property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setNumericString(String value) {
+ this.numericString = value;
+ }
+
+ /**
+ * Gets the value of the printableString property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getPrintableString() {
+ return printableString;
+ }
+
+ /**
+ * Sets the value of the printableString property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setPrintableString(String value) {
+ this.printableString = value;
+ }
+
+ /**
+ * Gets the value of the generalizedTime property.
+ *
+ * @return
+ * possible object is
+ * {@link XMLGregorianCalendar }
+ *
+ */
+ public XMLGregorianCalendar getGeneralizedTime() {
+ return generalizedTime;
+ }
+
+ /**
+ * Sets the value of the generalizedTime property.
+ *
+ * @param value
+ * allowed object is
+ * {@link XMLGregorianCalendar }
+ *
+ */
+ public void setGeneralizedTime(XMLGregorianCalendar value) {
+ this.generalizedTime = value;
+ }
+
+ /**
+ * Gets the value of the date property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getDate() {
+ return date;
+ }
+
+ /**
+ * Sets the value of the date property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setDate(String value) {
+ this.date = value;
+ }
+
+ /**
+ * Gets the value of the oid property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getOid() {
+ return oid;
+ }
+
+ /**
+ * Sets the value of the oid property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setOid(String value) {
+ this.oid = value;
+ }
+
+}
diff --git a/utils/src/main/java/at/buergerkarte/namespaces/cardchannel/CommandAPDUType.java b/utils/src/main/java/at/buergerkarte/namespaces/cardchannel/CommandAPDUType.java
new file mode 100644
index 00000000..b47359b6
--- /dev/null
+++ b/utils/src/main/java/at/buergerkarte/namespaces/cardchannel/CommandAPDUType.java
@@ -0,0 +1,154 @@
+
+package at.buergerkarte.namespaces.cardchannel;
+
+import java.math.BigInteger;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlSchemaType;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlValue;
+import javax.xml.bind.annotation.adapters.HexBinaryAdapter;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
+
+/**
+ * Contains a sequence of bytes send as command APDU to the
+ * icc
+ *
+ * <p>Java class for CommandAPDUType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * &lt;complexType name="CommandAPDUType">
+ * &lt;simpleContent>
+ * &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema>hexBinary">
+ * &lt;attribute name="sequence" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
+ * &lt;attribute name="of" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
+ * &lt;attribute name="expectedSW" type="{http://www.w3.org/2001/XMLSchema}hexBinary" />
+ * &lt;/extension>
+ * &lt;/simpleContent>
+ * &lt;/complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "CommandAPDUType", propOrder = {
+ "value"
+})
+public class CommandAPDUType {
+
+ @XmlValue
+ @XmlJavaTypeAdapter(HexBinaryAdapter.class)
+ @XmlSchemaType(name = "hexBinary")
+ protected byte[] value;
+ @XmlAttribute(required = true)
+ @XmlSchemaType(name = "positiveInteger")
+ protected BigInteger sequence;
+ @XmlAttribute(required = true)
+ @XmlSchemaType(name = "positiveInteger")
+ protected BigInteger of;
+ @XmlAttribute
+ @XmlJavaTypeAdapter(HexBinaryAdapter.class)
+ @XmlSchemaType(name = "hexBinary")
+ protected byte[] expectedSW;
+
+ /**
+ * Gets the value of the value property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public byte[] getValue() {
+ return value;
+ }
+
+ /**
+ * Sets the value of the value property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setValue(byte[] value) {
+ this.value = ((byte[]) value);
+ }
+
+ /**
+ * Gets the value of the sequence property.
+ *
+ * @return
+ * possible object is
+ * {@link BigInteger }
+ *
+ */
+ public BigInteger getSequence() {
+ return sequence;
+ }
+
+ /**
+ * Sets the value of the sequence property.
+ *
+ * @param value
+ * allowed object is
+ * {@link BigInteger }
+ *
+ */
+ public void setSequence(BigInteger value) {
+ this.sequence = value;
+ }
+
+ /**
+ * Gets the value of the of property.
+ *
+ * @return
+ * possible object is
+ * {@link BigInteger }
+ *
+ */
+ public BigInteger getOf() {
+ return of;
+ }
+
+ /**
+ * Sets the value of the of property.
+ *
+ * @param value
+ * allowed object is
+ * {@link BigInteger }
+ *
+ */
+ public void setOf(BigInteger value) {
+ this.of = value;
+ }
+
+ /**
+ * Gets the value of the expectedSW property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public byte[] getExpectedSW() {
+ return expectedSW;
+ }
+
+ /**
+ * Sets the value of the expectedSW property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setExpectedSW(byte[] value) {
+ this.expectedSW = ((byte[]) value);
+ }
+
+}
diff --git a/utils/src/main/java/at/buergerkarte/namespaces/cardchannel/ObjectFactory.java b/utils/src/main/java/at/buergerkarte/namespaces/cardchannel/ObjectFactory.java
new file mode 100644
index 00000000..cb0a163c
--- /dev/null
+++ b/utils/src/main/java/at/buergerkarte/namespaces/cardchannel/ObjectFactory.java
@@ -0,0 +1,170 @@
+
+package at.buergerkarte.namespaces.cardchannel;
+
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.annotation.XmlElementDecl;
+import javax.xml.bind.annotation.XmlRegistry;
+import javax.xml.bind.annotation.adapters.HexBinaryAdapter;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+import javax.xml.namespace.QName;
+
+
+/**
+ * This object contains factory methods for each
+ * Java content interface and Java element interface
+ * generated in the at.buergerkarte.namespaces.cardchannel package.
+ * <p>An ObjectFactory allows you to programatically
+ * construct new instances of the Java representation
+ * for XML content. The Java representation of XML
+ * content can consist of schema derived interfaces
+ * and classes representing the binding of schema
+ * type definitions, element declarations and model
+ * groups. Factory methods for each of these are
+ * provided in this class.
+ *
+ */
+@XmlRegistry
+public class ObjectFactory {
+
+ private final static QName _Grunddaten_QNAME = new QName("", "Grunddaten");
+ private final static QName _Script_QNAME = new QName("", "Script");
+ private final static QName _Response_QNAME = new QName("", "Response");
+ private final static QName _SVPersonenbindung_QNAME = new QName("", "SV-Personenbindung");
+ private final static QName _Status_QNAME = new QName("", "Status");
+ private final static QName _EHIC_QNAME = new QName("", "EHIC");
+
+ /**
+ * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: at.buergerkarte.namespaces.cardchannel
+ *
+ */
+ public ObjectFactory() {
+ }
+
+ /**
+ * Create an instance of {@link AttributeList }
+ *
+ */
+ public AttributeList createAttributeList() {
+ return new AttributeList();
+ }
+
+ /**
+ * Create an instance of {@link AttributeType }
+ *
+ */
+ public AttributeType createAttributeType() {
+ return new AttributeType();
+ }
+
+ /**
+ * Create an instance of {@link ScriptType }
+ *
+ */
+ public ScriptType createScriptType() {
+ return new ScriptType();
+ }
+
+ /**
+ * Create an instance of {@link ATRType }
+ *
+ */
+ public ATRType createATRType() {
+ return new ATRType();
+ }
+
+ /**
+ * Create an instance of {@link CommandAPDUType }
+ *
+ */
+ public CommandAPDUType createCommandAPDUType() {
+ return new CommandAPDUType();
+ }
+
+ /**
+ * Create an instance of {@link ResetType }
+ *
+ */
+ public ResetType createResetType() {
+ return new ResetType();
+ }
+
+ /**
+ * Create an instance of {@link VerifyAPDUType }
+ *
+ */
+ public VerifyAPDUType createVerifyAPDUType() {
+ return new VerifyAPDUType();
+ }
+
+ /**
+ * Create an instance of {@link ResponseAPDUType }
+ *
+ */
+ public ResponseAPDUType createResponseAPDUType() {
+ return new ResponseAPDUType();
+ }
+
+ /**
+ * Create an instance of {@link ResponseType }
+ *
+ */
+ public ResponseType createResponseType() {
+ return new ResponseType();
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link AttributeList }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "", name = "Grunddaten")
+ public JAXBElement<AttributeList> createGrunddaten(AttributeList value) {
+ return new JAXBElement<AttributeList>(_Grunddaten_QNAME, AttributeList.class, null, value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link ScriptType }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "", name = "Script")
+ public JAXBElement<ScriptType> createScript(ScriptType value) {
+ return new JAXBElement<ScriptType>(_Script_QNAME, ScriptType.class, null, value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link ResponseType }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "", name = "Response")
+ public JAXBElement<ResponseType> createResponse(ResponseType value) {
+ return new JAXBElement<ResponseType>(_Response_QNAME, ResponseType.class, null, value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link byte[]}{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "", name = "SV-Personenbindung")
+ @XmlJavaTypeAdapter(HexBinaryAdapter.class)
+ public JAXBElement<byte[]> createSVPersonenbindung(byte[] value) {
+ return new JAXBElement<byte[]>(_SVPersonenbindung_QNAME, byte[].class, null, ((byte[]) value));
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link AttributeList }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "", name = "Status")
+ public JAXBElement<AttributeList> createStatus(AttributeList value) {
+ return new JAXBElement<AttributeList>(_Status_QNAME, AttributeList.class, null, value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link AttributeList }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "", name = "EHIC")
+ public JAXBElement<AttributeList> createEHIC(AttributeList value) {
+ return new JAXBElement<AttributeList>(_EHIC_QNAME, AttributeList.class, null, value);
+ }
+
+}
diff --git a/utils/src/main/java/at/buergerkarte/namespaces/cardchannel/ResetType.java b/utils/src/main/java/at/buergerkarte/namespaces/cardchannel/ResetType.java
new file mode 100644
index 00000000..815a3f76
--- /dev/null
+++ b/utils/src/main/java/at/buergerkarte/namespaces/cardchannel/ResetType.java
@@ -0,0 +1,64 @@
+
+package at.buergerkarte.namespaces.cardchannel;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * Reset the icc and sequence counter
+ *
+ * <p>Java class for ResetType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * &lt;complexType name="ResetType">
+ * &lt;complexContent>
+ * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * &lt;attribute name="cold" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
+ * &lt;/restriction>
+ * &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "ResetType")
+public class ResetType {
+
+ @XmlAttribute
+ protected Boolean cold;
+
+ /**
+ * Gets the value of the cold property.
+ *
+ * @return
+ * possible object is
+ * {@link Boolean }
+ *
+ */
+ public boolean isCold() {
+ if (cold == null) {
+ return true;
+ } else {
+ return cold;
+ }
+ }
+
+ /**
+ * Sets the value of the cold property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Boolean }
+ *
+ */
+ public void setCold(Boolean value) {
+ this.cold = value;
+ }
+
+}
diff --git a/utils/src/main/java/at/buergerkarte/namespaces/cardchannel/ResponseAPDUType.java b/utils/src/main/java/at/buergerkarte/namespaces/cardchannel/ResponseAPDUType.java
new file mode 100644
index 00000000..70f2948e
--- /dev/null
+++ b/utils/src/main/java/at/buergerkarte/namespaces/cardchannel/ResponseAPDUType.java
@@ -0,0 +1,161 @@
+
+package at.buergerkarte.namespaces.cardchannel;
+
+import java.math.BigInteger;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlSchemaType;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlValue;
+import javax.xml.bind.annotation.adapters.HexBinaryAdapter;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
+
+/**
+ * Contains a sequence of bytes received from the card as response
+ * APDU
+ *
+ * <p>Java class for ResponseAPDUType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * &lt;complexType name="ResponseAPDUType">
+ * &lt;simpleContent>
+ * &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema>hexBinary">
+ * &lt;attribute name="sequence" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
+ * &lt;attribute name="rc" type="{http://www.w3.org/2001/XMLSchema}integer" default="0" />
+ * &lt;attribute name="sw" type="{http://www.w3.org/2001/XMLSchema}hexBinary" default="9000" />
+ * &lt;/extension>
+ * &lt;/simpleContent>
+ * &lt;/complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "ResponseAPDUType", propOrder = {
+ "value"
+})
+public class ResponseAPDUType {
+
+ @XmlValue
+ @XmlJavaTypeAdapter(HexBinaryAdapter.class)
+ @XmlSchemaType(name = "hexBinary")
+ protected byte[] value;
+ @XmlAttribute(required = true)
+ @XmlSchemaType(name = "positiveInteger")
+ protected BigInteger sequence;
+ @XmlAttribute
+ protected BigInteger rc;
+ @XmlAttribute(name = "SW")
+ @XmlJavaTypeAdapter(HexBinaryAdapter.class)
+ @XmlSchemaType(name = "hexBinary")
+ protected byte[] sw;
+
+ /**
+ * Gets the value of the value property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public byte[] getValue() {
+ return value;
+ }
+
+ /**
+ * Sets the value of the value property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setValue(byte[] value) {
+ this.value = ((byte[]) value);
+ }
+
+ /**
+ * Gets the value of the sequence property.
+ *
+ * @return
+ * possible object is
+ * {@link BigInteger }
+ *
+ */
+ public BigInteger getSequence() {
+ return sequence;
+ }
+
+ /**
+ * Sets the value of the sequence property.
+ *
+ * @param value
+ * allowed object is
+ * {@link BigInteger }
+ *
+ */
+ public void setSequence(BigInteger value) {
+ this.sequence = value;
+ }
+
+ /**
+ * Gets the value of the rc property.
+ *
+ * @return
+ * possible object is
+ * {@link BigInteger }
+ *
+ */
+ public BigInteger getRc() {
+ if (rc == null) {
+ return new BigInteger("0");
+ } else {
+ return rc;
+ }
+ }
+
+ /**
+ * Sets the value of the rc property.
+ *
+ * @param value
+ * allowed object is
+ * {@link BigInteger }
+ *
+ */
+ public void setRc(BigInteger value) {
+ this.rc = value;
+ }
+
+ /**
+ * Gets the value of the sw property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public byte[] getSw() {
+ if (sw == null) {
+ return new HexBinaryAdapter().unmarshal("9000");
+ } else {
+ return sw;
+ }
+ }
+
+ /**
+ * Sets the value of the sw property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setSw(byte[] value) {
+ this.sw = ((byte[]) value);
+ }
+
+}
diff --git a/utils/src/main/java/at/buergerkarte/namespaces/cardchannel/ResponseType.java b/utils/src/main/java/at/buergerkarte/namespaces/cardchannel/ResponseType.java
new file mode 100644
index 00000000..b92015e3
--- /dev/null
+++ b/utils/src/main/java/at/buergerkarte/namespaces/cardchannel/ResponseType.java
@@ -0,0 +1,78 @@
+
+package at.buergerkarte.namespaces.cardchannel;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElements;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * Contains the result of the script executed by the
+ * BKU
+ *
+ * <p>Java class for ResponseType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * &lt;complexType name="ResponseType">
+ * &lt;complexContent>
+ * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * &lt;choice maxOccurs="unbounded">
+ * &lt;element name="ATR" type="{}ATRType"/>
+ * &lt;element name="ResponseAPDU" type="{}ResponseAPDUType"/>
+ * &lt;/choice>
+ * &lt;/restriction>
+ * &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "ResponseType", propOrder = {
+ "atrOrResponseAPDU"
+})
+public class ResponseType {
+
+ @XmlElements({
+ @XmlElement(name = "ATR", type = ATRType.class),
+ @XmlElement(name = "ResponseAPDU", type = ResponseAPDUType.class)
+ })
+ protected List<Object> atrOrResponseAPDU;
+
+ /**
+ * Gets the value of the atrOrResponseAPDU property.
+ *
+ * <p>
+ * This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
+ * This is why there is not a <CODE>set</CODE> method for the atrOrResponseAPDU property.
+ *
+ * <p>
+ * For example, to add a new item, do as follows:
+ * <pre>
+ * getATROrResponseAPDU().add(newItem);
+ * </pre>
+ *
+ *
+ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link ATRType }
+ * {@link ResponseAPDUType }
+ *
+ *
+ */
+ public List<Object> getATROrResponseAPDU() {
+ if (atrOrResponseAPDU == null) {
+ atrOrResponseAPDU = new ArrayList<Object>();
+ }
+ return this.atrOrResponseAPDU;
+ }
+
+}
diff --git a/utils/src/main/java/at/buergerkarte/namespaces/cardchannel/ScriptType.java b/utils/src/main/java/at/buergerkarte/namespaces/cardchannel/ScriptType.java
new file mode 100644
index 00000000..bff76f06
--- /dev/null
+++ b/utils/src/main/java/at/buergerkarte/namespaces/cardchannel/ScriptType.java
@@ -0,0 +1,80 @@
+
+package at.buergerkarte.namespaces.cardchannel;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElements;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * Contains the script to be executed by the BKU
+ *
+ * <p>Java class for ScriptType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * &lt;complexType name="ScriptType">
+ * &lt;complexContent>
+ * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * &lt;choice maxOccurs="unbounded">
+ * &lt;element name="Reset" type="{}ResetType"/>
+ * &lt;element name="CommandAPDU" type="{}CommandAPDUType"/>
+ * &lt;element name="VerifyAPDU" type="{}VerifyAPDUType"/>
+ * &lt;/choice>
+ * &lt;/restriction>
+ * &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "ScriptType", propOrder = {
+ "resetOrCommandAPDUOrVerifyAPDU"
+})
+public class ScriptType {
+
+ @XmlElements({
+ @XmlElement(name = "Reset", type = ResetType.class),
+ @XmlElement(name = "VerifyAPDU", type = VerifyAPDUType.class),
+ @XmlElement(name = "CommandAPDU", type = CommandAPDUType.class)
+ })
+ protected List<Object> resetOrCommandAPDUOrVerifyAPDU;
+
+ /**
+ * Gets the value of the resetOrCommandAPDUOrVerifyAPDU property.
+ *
+ * <p>
+ * This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
+ * This is why there is not a <CODE>set</CODE> method for the resetOrCommandAPDUOrVerifyAPDU property.
+ *
+ * <p>
+ * For example, to add a new item, do as follows:
+ * <pre>
+ * getResetOrCommandAPDUOrVerifyAPDU().add(newItem);
+ * </pre>
+ *
+ *
+ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link ResetType }
+ * {@link VerifyAPDUType }
+ * {@link CommandAPDUType }
+ *
+ *
+ */
+ public List<Object> getResetOrCommandAPDUOrVerifyAPDU() {
+ if (resetOrCommandAPDUOrVerifyAPDU == null) {
+ resetOrCommandAPDUOrVerifyAPDU = new ArrayList<Object>();
+ }
+ return this.resetOrCommandAPDUOrVerifyAPDU;
+ }
+
+}
diff --git a/utils/src/main/java/at/buergerkarte/namespaces/cardchannel/VerifyAPDUType.java b/utils/src/main/java/at/buergerkarte/namespaces/cardchannel/VerifyAPDUType.java
new file mode 100644
index 00000000..20d7f3e8
--- /dev/null
+++ b/utils/src/main/java/at/buergerkarte/namespaces/cardchannel/VerifyAPDUType.java
@@ -0,0 +1,266 @@
+
+package at.buergerkarte.namespaces.cardchannel;
+
+import java.math.BigInteger;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlSchemaType;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlValue;
+import javax.xml.bind.annotation.adapters.HexBinaryAdapter;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
+
+/**
+ * Contains a sequence of bytes send as command APDU to the icc after a
+ * PIN entered by the user has been incorporated into the APDU
+ *
+ * <p>Java class for VerifyAPDUType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * &lt;complexType name="VerifyAPDUType">
+ * &lt;simpleContent>
+ * &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema>hexBinary">
+ * &lt;attribute name="sequence" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
+ * &lt;attribute name="of" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
+ * &lt;attribute name="expectedSW" type="{http://www.w3.org/2001/XMLSchema}hexBinary" />
+ * &lt;attribute name="message" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * &lt;attribute name="format" use="required" type="{http://www.w3.org/2001/XMLSchema}hexBinary" />
+ * &lt;attribute name="offset" use="required" type="{http://www.w3.org/2001/XMLSchema}nonNegativeInteger" />
+ * &lt;attribute name="timeout" use="required" type="{http://www.w3.org/2001/XMLSchema}nonNegativeInteger" />
+ * &lt;/extension>
+ * &lt;/simpleContent>
+ * &lt;/complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "VerifyAPDUType", propOrder = {
+ "value"
+})
+public class VerifyAPDUType {
+
+ @XmlValue
+ @XmlJavaTypeAdapter(HexBinaryAdapter.class)
+ @XmlSchemaType(name = "hexBinary")
+ protected byte[] value;
+ @XmlAttribute(required = true)
+ @XmlSchemaType(name = "positiveInteger")
+ protected BigInteger sequence;
+ @XmlAttribute(required = true)
+ @XmlSchemaType(name = "positiveInteger")
+ protected BigInteger of;
+ @XmlAttribute
+ @XmlJavaTypeAdapter(HexBinaryAdapter.class)
+ @XmlSchemaType(name = "hexBinary")
+ protected byte[] expectedSW;
+ @XmlAttribute(required = true)
+ protected String message;
+ @XmlAttribute(required = true)
+ @XmlJavaTypeAdapter(HexBinaryAdapter.class)
+ @XmlSchemaType(name = "hexBinary")
+ protected byte[] format;
+ @XmlAttribute(required = true)
+ @XmlSchemaType(name = "nonNegativeInteger")
+ protected BigInteger offset;
+ @XmlAttribute(required = true)
+ @XmlSchemaType(name = "nonNegativeInteger")
+ protected BigInteger timeout;
+
+ /**
+ * Gets the value of the value property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public byte[] getValue() {
+ return value;
+ }
+
+ /**
+ * Sets the value of the value property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setValue(byte[] value) {
+ this.value = ((byte[]) value);
+ }
+
+ /**
+ * Gets the value of the sequence property.
+ *
+ * @return
+ * possible object is
+ * {@link BigInteger }
+ *
+ */
+ public BigInteger getSequence() {
+ return sequence;
+ }
+
+ /**
+ * Sets the value of the sequence property.
+ *
+ * @param value
+ * allowed object is
+ * {@link BigInteger }
+ *
+ */
+ public void setSequence(BigInteger value) {
+ this.sequence = value;
+ }
+
+ /**
+ * Gets the value of the of property.
+ *
+ * @return
+ * possible object is
+ * {@link BigInteger }
+ *
+ */
+ public BigInteger getOf() {
+ return of;
+ }
+
+ /**
+ * Sets the value of the of property.
+ *
+ * @param value
+ * allowed object is
+ * {@link BigInteger }
+ *
+ */
+ public void setOf(BigInteger value) {
+ this.of = value;
+ }
+
+ /**
+ * Gets the value of the expectedSW property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public byte[] getExpectedSW() {
+ return expectedSW;
+ }
+
+ /**
+ * Sets the value of the expectedSW property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setExpectedSW(byte[] value) {
+ this.expectedSW = ((byte[]) value);
+ }
+
+ /**
+ * Gets the value of the message property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getMessage() {
+ return message;
+ }
+
+ /**
+ * Sets the value of the message property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setMessage(String value) {
+ this.message = value;
+ }
+
+ /**
+ * Gets the value of the format property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public byte[] getFormat() {
+ return format;
+ }
+
+ /**
+ * Sets the value of the format property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setFormat(byte[] value) {
+ this.format = ((byte[]) value);
+ }
+
+ /**
+ * Gets the value of the offset property.
+ *
+ * @return
+ * possible object is
+ * {@link BigInteger }
+ *
+ */
+ public BigInteger getOffset() {
+ return offset;
+ }
+
+ /**
+ * Sets the value of the offset property.
+ *
+ * @param value
+ * allowed object is
+ * {@link BigInteger }
+ *
+ */
+ public void setOffset(BigInteger value) {
+ this.offset = value;
+ }
+
+ /**
+ * Gets the value of the timeout property.
+ *
+ * @return
+ * possible object is
+ * {@link BigInteger }
+ *
+ */
+ public BigInteger getTimeout() {
+ return timeout;
+ }
+
+ /**
+ * Sets the value of the timeout property.
+ *
+ * @param value
+ * allowed object is
+ * {@link BigInteger }
+ *
+ */
+ public void setTimeout(BigInteger value) {
+ this.timeout = value;
+ }
+
+}
diff --git a/utils/src/main/java/at/buergerkarte/namespaces/cardchannel/package-info.java b/utils/src/main/java/at/buergerkarte/namespaces/cardchannel/package-info.java
new file mode 100644
index 00000000..13f79000
--- /dev/null
+++ b/utils/src/main/java/at/buergerkarte/namespaces/cardchannel/package-info.java
@@ -0,0 +1,2 @@
+@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.buergerkarte.at/cardchannel", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
+package at.buergerkarte.namespaces.cardchannel;
diff --git a/utils/src/main/java/at/gv/egiz/bku/utils/DebugOutputStream.java b/utils/src/main/java/at/gv/egiz/bku/utils/DebugOutputStream.java
new file mode 100644
index 00000000..8516b76c
--- /dev/null
+++ b/utils/src/main/java/at/gv/egiz/bku/utils/DebugOutputStream.java
@@ -0,0 +1,48 @@
+/*
+* Copyright 2008 Federal Chancellery Austria and
+* Graz University of Technology
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package at.gv.egiz.bku.utils;
+
+import java.io.ByteArrayOutputStream;
+import java.io.FilterOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+
+public class DebugOutputStream extends FilterOutputStream {
+
+ private ByteArrayOutputStream buffer = new ByteArrayOutputStream();
+
+ public DebugOutputStream(OutputStream out) {
+ super(out);
+ }
+
+ @Override
+ public void write(byte[] b, int off, int len) throws IOException {
+ buffer.write(b, off, len);
+ super.write(b, off, len);
+ }
+
+ @Override
+ public void write(int b) throws IOException {
+ buffer.write(b);
+ super.write(b);
+ }
+
+ public byte[] getBufferedBytes() {
+ return buffer.toByteArray();
+ }
+
+}
diff --git a/utils/src/main/java/at/gv/egiz/bku/utils/DebugReader.java b/utils/src/main/java/at/gv/egiz/bku/utils/DebugReader.java
new file mode 100644
index 00000000..cafe4a72
--- /dev/null
+++ b/utils/src/main/java/at/gv/egiz/bku/utils/DebugReader.java
@@ -0,0 +1,58 @@
+/*
+* Copyright 2008 Federal Chancellery Austria and
+* Graz University of Technology
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package at.gv.egiz.bku.utils;
+
+import java.io.FilterReader;
+import java.io.IOException;
+import java.io.Reader;
+import java.io.StringWriter;
+
+public class DebugReader extends FilterReader {
+
+ private StringWriter buffer = new StringWriter();
+
+ public DebugReader(Reader in) {
+ super(in);
+ }
+
+ public DebugReader(Reader in, String start) {
+ super(in);
+ buffer.write(start);
+ }
+
+ @Override
+ public int read() throws IOException {
+ int c = super.read();
+ if (c != -1)
+ buffer.write(c);
+ return c;
+ }
+
+ @Override
+ public int read(char[] cbuf, int off, int len) throws IOException {
+ int l = super.read(cbuf, off, len);
+ if (l != -1 ) {
+ buffer.write(cbuf, off, l);
+ }
+ return l;
+ }
+
+ public String getCachedString() {
+ return buffer.toString();
+ }
+
+}
diff --git a/utils/src/main/java/at/gv/egiz/bku/utils/DebugWriter.java b/utils/src/main/java/at/gv/egiz/bku/utils/DebugWriter.java
new file mode 100644
index 00000000..5566f927
--- /dev/null
+++ b/utils/src/main/java/at/gv/egiz/bku/utils/DebugWriter.java
@@ -0,0 +1,55 @@
+/*
+* Copyright 2008 Federal Chancellery Austria and
+* Graz University of Technology
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package at.gv.egiz.bku.utils;
+
+import java.io.FilterWriter;
+import java.io.IOException;
+import java.io.StringWriter;
+import java.io.Writer;
+
+public class DebugWriter extends FilterWriter {
+
+ private Writer buffer = new StringWriter();
+
+ public DebugWriter(Writer out) {
+ super(out);
+ }
+
+ @Override
+ public void write(char[] cbuf, int off, int len) throws IOException {
+ buffer.write(cbuf, off, len);
+ super.write(cbuf, off, len);
+ }
+
+ @Override
+ public void write(String str, int off, int len) throws IOException {
+ buffer.write(str, off, len);
+ super.write(str, off, len);
+ }
+
+ @Override
+ public void write(int c) throws IOException {
+ buffer.write(c);
+ super.write(c);
+ }
+
+ public String getBufferedString() {
+ return buffer.toString();
+ }
+
+
+}
diff --git a/utils/src/main/java/at/gv/egiz/bku/utils/NullOutputStream.java b/utils/src/main/java/at/gv/egiz/bku/utils/NullOutputStream.java
new file mode 100644
index 00000000..edbd9c01
--- /dev/null
+++ b/utils/src/main/java/at/gv/egiz/bku/utils/NullOutputStream.java
@@ -0,0 +1,10 @@
+package at.gv.egiz.bku.utils;
+
+import java.io.IOException;
+import java.io.OutputStream;
+
+public class NullOutputStream extends OutputStream {
+ @Override
+ public void write(int b) throws IOException {
+ }
+}
diff --git a/utils/src/main/java/at/gv/egiz/idlink/IdentityLinkFactory.java b/utils/src/main/java/at/gv/egiz/idlink/IdentityLinkFactory.java
index a5ceeafc..fb7943dc 100644
--- a/utils/src/main/java/at/gv/egiz/idlink/IdentityLinkFactory.java
+++ b/utils/src/main/java/at/gv/egiz/idlink/IdentityLinkFactory.java
@@ -14,8 +14,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package at.gv.egiz.idlink;
-
+package at.gv.egiz.idlink;
+
import iaik.xml.crypto.XmldsigMore;
import java.io.InputStreamReader;
@@ -81,6 +81,7 @@ import org.apache.commons.logging.LogFactory;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
+import at.gv.e_government.reference.namespace.persondata._20020228_.AbstractPersonType;
import at.gv.e_government.reference.namespace.persondata._20020228_.IdentificationType;
import at.gv.e_government.reference.namespace.persondata._20020228_.PersonNameType;
import at.gv.e_government.reference.namespace.persondata._20020228_.PhysicalPersonType;
@@ -88,63 +89,64 @@ import at.gv.e_government.reference.namespace.persondata._20020228_.Identificati
import at.gv.e_government.reference.namespace.persondata._20020228_.PersonNameType.FamilyName;
import at.gv.egiz.xmldsig.KeyTypeNotSupportedException;
import at.gv.egiz.xmldsig.KeyValueFactory;
-
+import oasis.names.tc.saml._1_0.assertion.AnyType;
+
public class IdentityLinkFactory {
- private static Log log = LogFactory.getLog(IdentityLinkFactory.class);
-
- /**
- * The instance returned by {@link #getInstance()}.
- */
- private static IdentityLinkFactory instance;
-
- /**
- * The <code>JAXBContext</code>.
- */
- private static JAXBContext jaxbContext;
-
- /**
- * The <code>KeyValueFactory</code>.
- */
- private static KeyValueFactory keyValueFactory;
-
- /**
- * Get an instance of this <code>CompressedIdentityLinkFactory</code>.
- *
- * @return an instance of this <code>CompressedIdentityLinkFactory</code>
- */
- public synchronized static IdentityLinkFactory getInstance() {
- if (instance == null) {
- instance = new IdentityLinkFactory();
- }
- return instance;
- }
-
- /**
- * Private constructor.
- */
- private IdentityLinkFactory() {
-
- keyValueFactory = new KeyValueFactory();
-
- StringBuffer packageNames = new StringBuffer();
- packageNames.append(at.gv.e_government.reference.namespace.persondata._20020228_.ObjectFactory.class.getPackage().getName());
- packageNames.append(":");
- packageNames.append(org.w3._2000._09.xmldsig_.ObjectFactory.class.getPackage().getName());
- packageNames.append(":");
- packageNames.append(org.w3._2001._04.xmldsig_more_.ObjectFactory.class.getPackage().getName());
- packageNames.append(":");
- packageNames.append(at.buergerkarte.namespaces.personenbindung._20020506_.ObjectFactory.class.getPackage().getName());
+ private static Log log = LogFactory.getLog(IdentityLinkFactory.class);
+
+ /**
+ * The instance returned by {@link #getInstance()}.
+ */
+ private static IdentityLinkFactory instance;
+
+ /**
+ * The <code>JAXBContext</code>.
+ */
+ private static JAXBContext jaxbContext;
+
+ /**
+ * The <code>KeyValueFactory</code>.
+ */
+ private static KeyValueFactory keyValueFactory;
+
+ /**
+ * Get an instance of this <code>CompressedIdentityLinkFactory</code>.
+ *
+ * @return an instance of this <code>CompressedIdentityLinkFactory</code>
+ */
+ public synchronized static IdentityLinkFactory getInstance() {
+ if (instance == null) {
+ instance = new IdentityLinkFactory();
+ }
+ return instance;
+ }
+
+ /**
+ * Private constructor.
+ */
+ private IdentityLinkFactory() {
+
+ keyValueFactory = new KeyValueFactory();
+
+ StringBuffer packageNames = new StringBuffer();
+ packageNames.append(at.gv.e_government.reference.namespace.persondata._20020228_.ObjectFactory.class.getPackage().getName());
+ packageNames.append(":");
+ packageNames.append(org.w3._2000._09.xmldsig_.ObjectFactory.class.getPackage().getName());
+ packageNames.append(":");
+ packageNames.append(org.w3._2001._04.xmldsig_more_.ObjectFactory.class.getPackage().getName());
+ packageNames.append(":");
+ packageNames.append(at.buergerkarte.namespaces.personenbindung._20020506_.ObjectFactory.class.getPackage().getName());
packageNames.append(":");
packageNames.append(oasis.names.tc.saml._1_0.assertion.ObjectFactory.class.getPackage().getName());
-
- try {
- jaxbContext = JAXBContext.newInstance(packageNames.toString());
- } catch (JAXBException e) {
- // we should not get an JAXBException initializing the JAXBContext
- throw new RuntimeException(e);
- }
-
+
+ try {
+ jaxbContext = JAXBContext.newInstance(packageNames.toString());
+ } catch (JAXBException e) {
+ // we should not get an JAXBException initializing the JAXBContext
+ throw new RuntimeException(e);
+ }
+
}
public JAXBElement<AssertionType> createAssertion(String assertionId,
@@ -175,11 +177,11 @@ public class IdentityLinkFactory {
return asFactory.createAssertion(assertionType);
- }
-
+ }
+
public AttributeStatementType createAttributeStatement(String idValue, String idType,
String givenName, String familyName, String dateOfBirth,
- PublicKey[] publicKeys) throws KeyTypeNotSupportedException {
+ PublicKey[] publicKeys) throws KeyTypeNotSupportedException {
oasis.names.tc.saml._1_0.assertion.ObjectFactory asFactory =
new oasis.names.tc.saml._1_0.assertion.ObjectFactory();
@@ -215,8 +217,11 @@ public class IdentityLinkFactory {
physicalPersonType.getIdentification().add(identificationType);
physicalPersonType.setName(personNameType);
physicalPersonType.setDateOfBirth(dateOfBirth);
-
- subjectConfirmationType.setSubjectConfirmationData(physicalPersonType);
+ JAXBElement<AbstractPersonType> physicalPerson = prFactory.createPerson(physicalPersonType);
+
+ AnyType personType = asFactory.createAnyType();
+ personType.getContent().add(physicalPerson);
+ subjectConfirmationType.setSubjectConfirmationData(personType);
JAXBElement<SubjectConfirmationType> subjectConfirmation = asFactory.createSubjectConfirmation(subjectConfirmationType);
@@ -232,52 +237,54 @@ public class IdentityLinkFactory {
AttributeType attributeType = asFactory.createAttributeType();
attributeType.setAttributeName("CitizenPublicKey");
attributeType.setAttributeNamespace("urn:publicid:gv.at:namespaces:identitylink:1.2");
- attributeType.getAttributeValue().add(createKeyValue.getValue());
+ AnyType attributeValueType = asFactory.createAnyType();
+ attributeValueType.getContent().add(createKeyValue);
+ attributeType.getAttributeValue().add(attributeValueType);
attributeStatementType.getAttribute().add(attributeType);
}
return attributeStatementType;
- }
-
- /**
- * Marshall the given <code>compressedIdentityLink</code> into a DOM document
- * with the given Nodes as <code>parent</code> and <code>nextSibling</code>
- * nodes.
- *
- * @param identityLink
- * the <code>CompressedIdentityLink</code> element
- * @param parent
- * the parent node
- * @param nextSibling
- * the next sibling node (may be <code>null</code>)
- * @param applyWorkarounds
- * apply workarounds as spefiyed by
- * {@link #applyWorkarounds(Element, int)}
- *
- * @throws JAXBException
- * if an unexpected error occurs while marshalling
- * @throws NullPointerException
- * if <code>compressdIdentityLink</code> or <code>parent</code> is
- * <code>null</code>
- */
- public void marshallIdentityLink(
- JAXBElement<AssertionType> identityLink,
- Node parent, Node nextSibling) throws JAXBException {
-
- DOMResult result = new DOMResult(parent, nextSibling);
-
- try {
- Marshaller marshaller = jaxbContext.createMarshaller();
-
- marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
-
- marshaller.marshal(identityLink, result);
- } catch (PropertyException e) {
- throw new RuntimeException(e);
- }
-
+ }
+
+ /**
+ * Marshall the given <code>compressedIdentityLink</code> into a DOM document
+ * with the given Nodes as <code>parent</code> and <code>nextSibling</code>
+ * nodes.
+ *
+ * @param identityLink
+ * the <code>CompressedIdentityLink</code> element
+ * @param parent
+ * the parent node
+ * @param nextSibling
+ * the next sibling node (may be <code>null</code>)
+ * @param applyWorkarounds
+ * apply workarounds as spefiyed by
+ * {@link #applyWorkarounds(Element, int)}
+ *
+ * @throws JAXBException
+ * if an unexpected error occurs while marshalling
+ * @throws NullPointerException
+ * if <code>compressdIdentityLink</code> or <code>parent</code> is
+ * <code>null</code>
+ */
+ public void marshallIdentityLink(
+ JAXBElement<AssertionType> identityLink,
+ Node parent, Node nextSibling) throws JAXBException {
+
+ DOMResult result = new DOMResult(parent, nextSibling);
+
+ try {
+ Marshaller marshaller = jaxbContext.createMarshaller();
+
+ marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
+
+ marshaller.marshal(identityLink, result);
+ } catch (PropertyException e) {
+ throw new RuntimeException(e);
+ }
+
}
public void signIdentityLink(Element assertion, X509Certificate certificate,
@@ -416,6 +423,6 @@ public class IdentityLinkFactory {
log.trace(sb.toString());
}
- }
-
-}
+ }
+
+}