From d6637f8e82b41936b962f2197dee8cf89d0fe0b9 Mon Sep 17 00:00:00 2001 From: Bojan Suzic Date: Thu, 4 Dec 2014 15:10:37 +0100 Subject: health attributes update and bouncycastle bug workaround --- .../names/tc/stork/_1_0/assertion/IsHCPType.java | 145 --------------------- .../tc/stork/_1_0/assertion/ObjectFactory.java | 6 +- .../stork/peps/auth/engine/core/impl/SignSW.java | 18 ++- 3 files changed, 14 insertions(+), 155 deletions(-) delete mode 100644 id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/eu/stork/names/tc/stork/_1_0/assertion/IsHCPType.java (limited to 'id') diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/eu/stork/names/tc/stork/_1_0/assertion/IsHCPType.java b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/eu/stork/names/tc/stork/_1_0/assertion/IsHCPType.java deleted file mode 100644 index 6a2d5fd2e..000000000 --- a/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/eu/stork/names/tc/stork/_1_0/assertion/IsHCPType.java +++ /dev/null @@ -1,145 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2014.04.12 at 12:22:50 PM GMT -// - - -package eu.stork.peps.complex.attributes.eu.stork.names.tc.stork._1_0.assertion; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; - - -/** - *

Java class for isHCPType complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="isHCPType">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="nameOfOrganisation" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *         <element name="HCPType" type="{urn:eu:stork:names:tc:STORK:1.0:assertion}HCPType"/>
- *         <element name="specialisation" type="{urn:eu:stork:names:tc:STORK:1.0:assertion}specialisationType"/>
- *         <element name="AQAA" type="{urn:eu:stork:names:tc:STORK:1.0:assertion}QualityAuthenticationAssuranceLevelType"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "isHCPType", propOrder = { - "nameOfOrganisation", - "hcpType", - "specialisation", - "aqaa" -}) -public class IsHCPType { - - @XmlElement(required = true) - protected String nameOfOrganisation; - @XmlElement(name = "HCPType", required = true) - protected String hcpType; - @XmlElement(required = true) - protected String specialisation; - @XmlElement(name = "AQAA") - protected int aqaa; - - /** - * Gets the value of the nameOfOrganisation property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getNameOfOrganisation() { - return nameOfOrganisation; - } - - /** - * Sets the value of the nameOfOrganisation property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setNameOfOrganisation(String value) { - this.nameOfOrganisation = value; - } - - /** - * Gets the value of the hcpType property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getHCPType() { - return hcpType; - } - - /** - * Sets the value of the hcpType property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setHCPType(String value) { - this.hcpType = value; - } - - /** - * Gets the value of the specialisation property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getSpecialisation() { - return specialisation; - } - - /** - * Sets the value of the specialisation property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setSpecialisation(String value) { - this.specialisation = value; - } - - /** - * Gets the value of the aqaa property. - * - */ - public int getAQAA() { - return aqaa; - } - - /** - * Sets the value of the aqaa property. - * - */ - public void setAQAA(int value) { - this.aqaa = value; - } - -} diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/eu/stork/names/tc/stork/_1_0/assertion/ObjectFactory.java b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/eu/stork/names/tc/stork/_1_0/assertion/ObjectFactory.java index 217ca4ec4..f1ea05d65 100644 --- a/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/eu/stork/names/tc/stork/_1_0/assertion/ObjectFactory.java +++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/eu/stork/names/tc/stork/_1_0/assertion/ObjectFactory.java @@ -243,9 +243,9 @@ public class ObjectFactory { * Create an instance of {@link IsHCPType } * */ - public IsHCPType createIsHCPType() { - return new IsHCPType(); - } + //public IsHCPType createIsHCPType() { + // return new IsHCPType(); + //} /** * Create an instance of {@link JAXBElement }{@code <}{@link HabilitationType }{@code >}} diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SignSW.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SignSW.java index d415375e7..0984bb9ca 100644 --- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SignSW.java +++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SignSW.java @@ -220,13 +220,17 @@ public class SignSW implements SAMLEngineSignI { final String serialNum = certificate.getSerialNumber() .toString(16); - X509Principal issuerDN = new X509Principal(certificate.getIssuerDN().getName()); - X509Principal issuerDNConf = new X509Principal(issuer); - - if (serialNum.equalsIgnoreCase(serialNumber) - && X509PrincipalUtil.equals(issuerDN, issuerDNConf)) { - alias = aliasCert; - find = true; + try { + X509Principal issuerDN = new X509Principal(certificate.getIssuerDN().getName()); + X509Principal issuerDNConf = new X509Principal(issuer); + + if (serialNum.equalsIgnoreCase(serialNumber) + && X509PrincipalUtil.equals(issuerDN, issuerDNConf)) { + alias = aliasCert; + find = true; + } + } catch (Exception ex) { + LOG.error("Exception during signing: " + ex.getMessage()); // Added as a workaround for Bouncycastle email error } } if (!find) { -- cgit v1.2.3