From 3be8b5c3c139ab75db4ae9ac927800505194d987 Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Wed, 29 May 2019 13:57:17 +0200 Subject: add new attribute builder fix some injection and dependency problems --- .../core/api/data/PVPAttributeDefinitions.java | 24 ++++++++++++++++ .../gv/egiz/eaaf/core/api/idp/IConfiguration.java | 32 ++++++++++++++-------- .../at/gv/egiz/eaaf/core/api/idp/IEidAuthData.java | 29 ++++++++++++++++++++ 3 files changed, 73 insertions(+), 12 deletions(-) create mode 100644 eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/idp/IEidAuthData.java (limited to 'eaaf_core_api/src') diff --git a/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/data/PVPAttributeDefinitions.java b/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/data/PVPAttributeDefinitions.java index 2a92e5f3..e4ebe433 100644 --- a/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/data/PVPAttributeDefinitions.java +++ b/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/data/PVPAttributeDefinitions.java @@ -133,6 +133,30 @@ public interface PVPAttributeDefinitions { public static final String EID_CITIZEN_EIDAS_QAA_LEVEL_OID = "1.2.40.0.10.2.1.1.261.108"; public static final String EID_CITIZEN_EIDAS_QAA_LEVEL_NAME = URN_OID_PREFIX + EID_CITIZEN_EIDAS_QAA_LEVEL_OID; public static final String EID_CITIZEN_EIDAS_QAA_LEVEL_FRIENDLY_NAME = "EID-CITIZEN-QAA-EIDAS-LEVEL"; + + public static final String EID_IDENTITY_STATUS_LEVEL_OID = "1.2.40.0.10.2.1.1.261.109"; + public static final String EID_IDENTITY_STATUS_LEVEL_NAME = URN_OID_PREFIX + EID_IDENTITY_STATUS_LEVEL_OID; + public static final String EID_IDENTITY_STATUS_LEVEL_FRIENDLY_NAME = "EID-IDENTITY-STATUS-LEVEL"; + public enum EID_IDENTITY_STATUS_LEVEL_VALUES { + IDENTITY("http://eid.gv.at/eID/status/identity"), + TESTIDENTITY("http://eid.gv.at/eID/status/testidentity"), + SYSTEM("http://eid.gv.at/eID/status/system"); + + private final String uri; + + private EID_IDENTITY_STATUS_LEVEL_VALUES(String uri) { + this.uri = uri; + } + + /** + * Get the URI based status identifier of an E-ID + * + * @return + */ + public String getURI() { + return this.uri; + } + }; public static final String EID_ISSUING_NATION_OID = "1.2.40.0.10.2.1.1.261.32"; public static final String EID_ISSUING_NATION_NAME = URN_OID_PREFIX + EID_ISSUING_NATION_OID; diff --git a/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/idp/IConfiguration.java b/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/idp/IConfiguration.java index eceec2a6..7d564b58 100644 --- a/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/idp/IConfiguration.java +++ b/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/idp/IConfiguration.java @@ -57,26 +57,34 @@ public interface IConfiguration { */ public String getBasicConfiguration(final String key, final String defaultValue); + /** - * Get a set of configuration values from file based configuration that starts with this prefix - *

- * Important: The configuration values must be of type String! + * Get a configuration value from file based configuration * - * @param prefix Prefix of the configuration key - * @return Map without prefix, but never null + * @param key configuration key + * @return configuration value as {@link Boolean.parseBoolean(value)} or null if key does not exist */ - public Map getBasicMOAIDConfigurationWithPrefix(final String prefix); - + public Boolean getBasicConfigurationBoolean(final String key); /** - * Get a boolean value from basic MOA-ID configuration file + * Get a configuration value from file based configuration * - * @param key Configuration key - * @param defaultValue Default result - * @return returns the value of the configuration key, or the default value if the key is not set + * @param key configuration key + * @param defaultValue Default value if no value with this key is found + * @return configuration value as {@link Boolean.parseBoolean(value)} or defaultValue if key does not exist */ - public boolean getBasicMOAIDConfigurationBoolean(String key, boolean defaultValue); + public boolean getBasicConfigurationBoolean(final String key, final boolean defaultValue); + /** + * Get a set of configuration values from file based configuration that starts with this prefix + *

+ * Important: The configuration values must be of type String! + * + * @param prefix Prefix of the configuration key + * @return Map without prefix, but never null + */ + public Map getBasicConfigurationWithPrefix(final String prefix); + /** * Get a configuration entry for a specific Service Provider * diff --git a/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/idp/IEidAuthData.java b/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/idp/IEidAuthData.java new file mode 100644 index 00000000..44ece8fe --- /dev/null +++ b/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/idp/IEidAuthData.java @@ -0,0 +1,29 @@ +package at.gv.egiz.eaaf.core.api.idp; + +import at.gv.egiz.eaaf.core.api.data.PVPAttributeDefinitions; + +public interface IEidAuthData extends IAuthData { + + /** + * Get the serialized signing certificate that was used to sign the consent + * + * @return + */ + byte[] getSignerCertificate(); + + + /** + * Get the serialized E-ID token that can be used to validate the Identity-Link + * + * @return + */ + byte[] getEIDToken(); + + + /** + * Get the status of the E-ID + * + * @return {@link PVPAttributeDefinitions.EID_IDENTITY_STATUS_LEVEL_VALUES} + */ + PVPAttributeDefinitions.EID_IDENTITY_STATUS_LEVEL_VALUES getEIDStatus(); +} -- cgit v1.2.3 From 4ce9dae4c77ed6f2f37a2e65bc8198f7cf3f5c5b Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Wed, 5 Jun 2019 13:11:54 +0200 Subject: add useMandate flag --- .../src/main/java/at/gv/egiz/eaaf/core/api/idp/IEidAuthData.java | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'eaaf_core_api/src') diff --git a/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/idp/IEidAuthData.java b/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/idp/IEidAuthData.java index 44ece8fe..a9d6a51e 100644 --- a/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/idp/IEidAuthData.java +++ b/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/idp/IEidAuthData.java @@ -26,4 +26,12 @@ public interface IEidAuthData extends IAuthData { * @return {@link PVPAttributeDefinitions.EID_IDENTITY_STATUS_LEVEL_VALUES} */ PVPAttributeDefinitions.EID_IDENTITY_STATUS_LEVEL_VALUES getEIDStatus(); + + + /** + * Flag that mandates are used + * + * @return true if mandates are used, otherwise false + */ + boolean isUseMandate(); } -- cgit v1.2.3 From 4e61a42420b6e9e91e5bb7bfa2cff9a79e1f964f Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Thu, 6 Jun 2019 13:30:53 +0200 Subject: update authenticationData and attribute builder --- .../src/main/java/at/gv/egiz/eaaf/core/api/idp/IEidAuthData.java | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'eaaf_core_api/src') diff --git a/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/idp/IEidAuthData.java b/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/idp/IEidAuthData.java index a9d6a51e..74c84468 100644 --- a/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/idp/IEidAuthData.java +++ b/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/idp/IEidAuthData.java @@ -28,6 +28,14 @@ public interface IEidAuthData extends IAuthData { PVPAttributeDefinitions.EID_IDENTITY_STATUS_LEVEL_VALUES getEIDStatus(); + /** + * Get the URL of the VDA EndPoint, that was used for authentication + * + * @return + */ + String getVdaEndPointUrl(); + + /** * Flag that mandates are used * -- cgit v1.2.3 From 506c35217a28958f65c427a5ca56288eca5c12a0 Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Thu, 6 Jun 2019 13:31:52 +0200 Subject: update UnavailableAttributeException --- .../at/gv/egiz/eaaf/core/exceptions/AttributeBuilderException.java | 4 ++-- .../main/java/at/gv/egiz/eaaf/core/exceptions/EAAFIDPException.java | 5 +++++ .../gv/egiz/eaaf/core/exceptions/UnavailableAttributeException.java | 4 ++-- 3 files changed, 9 insertions(+), 4 deletions(-) (limited to 'eaaf_core_api/src') diff --git a/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/exceptions/AttributeBuilderException.java b/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/exceptions/AttributeBuilderException.java index efeecbe5..f02b3bf6 100644 --- a/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/exceptions/AttributeBuilderException.java +++ b/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/exceptions/AttributeBuilderException.java @@ -30,8 +30,8 @@ public class AttributeBuilderException extends EAAFIDPException { private static final long serialVersionUID = 1L; - public AttributeBuilderException(String msg) { - super(msg); + public AttributeBuilderException(String attrName) { + super("builder.12", new Object[] {attrName}); } } diff --git a/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/exceptions/EAAFIDPException.java b/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/exceptions/EAAFIDPException.java index 8af806d0..7f504a5a 100644 --- a/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/exceptions/EAAFIDPException.java +++ b/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/exceptions/EAAFIDPException.java @@ -38,4 +38,9 @@ public class EAAFIDPException extends EAAFException { } + public EAAFIDPException(String msg, Object[] params) { + super(msg, params); + + } + } diff --git a/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/exceptions/UnavailableAttributeException.java b/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/exceptions/UnavailableAttributeException.java index d87af4d1..626cbea7 100644 --- a/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/exceptions/UnavailableAttributeException.java +++ b/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/exceptions/UnavailableAttributeException.java @@ -33,10 +33,10 @@ public class UnavailableAttributeException extends AttributeBuilderException { */ private static final long serialVersionUID = -1114323185905118432L; - private String attributeName; + private final String attributeName; public UnavailableAttributeException(String attributeName) { - super("Attribute " + attributeName + " is not available."); + super(attributeName); this.attributeName = attributeName; } -- cgit v1.2.3