aboutsummaryrefslogtreecommitdiff
path: root/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/EncryptedBPKAttributeBuilder.java
diff options
context:
space:
mode:
authorThomas Lenz <tlenz@iaik.tugraz.at>2019-02-19 11:28:24 +0100
committerThomas Lenz <tlenz@iaik.tugraz.at>2019-02-19 11:28:24 +0100
commitc7cd9327bbc4d7e180bab9b6bff2a17028c166dc (patch)
treedcba0ab9b9c2f8e5b0a1fc471bc371711e3cfbb1 /id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/EncryptedBPKAttributeBuilder.java
parent1a392b6e0ba5c89e065cc6ad09d494e948a0daea (diff)
downloadmoa-id-spss-c7cd9327bbc4d7e180bab9b6bff2a17028c166dc.tar.gz
moa-id-spss-c7cd9327bbc4d7e180bab9b6bff2a17028c166dc.tar.bz2
moa-id-spss-c7cd9327bbc4d7e180bab9b6bff2a17028c166dc.zip
add some more attribute functionality for 'Austrian eID' demo-mode
Diffstat (limited to 'id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/EncryptedBPKAttributeBuilder.java')
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/EncryptedBPKAttributeBuilder.java31
1 files changed, 17 insertions, 14 deletions
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/EncryptedBPKAttributeBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/EncryptedBPKAttributeBuilder.java
index 44043ec40..bf7187e51 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/EncryptedBPKAttributeBuilder.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/EncryptedBPKAttributeBuilder.java
@@ -28,6 +28,7 @@ import at.gv.egiz.eaaf.core.api.idp.IPVPAttributeBuilder;
import at.gv.egiz.eaaf.core.api.idp.ISPConfiguration;
import at.gv.egiz.eaaf.core.exceptions.AttributeBuilderException;
import at.gv.egiz.eaaf.core.exceptions.UnavailableAttributeException;
+import at.gv.egiz.eaaf.core.impl.data.Pair;
import at.gv.egiz.eaaf.core.impl.idp.builder.attributes.PVPMETADATA;
import at.gv.egovernment.moa.id.data.IMOAAuthData;
import at.gv.egovernment.moa.logging.Logger;
@@ -35,6 +36,8 @@ import at.gv.egovernment.moa.logging.Logger;
@PVPMETADATA
public class EncryptedBPKAttributeBuilder implements IPVPAttributeBuilder {
+ public static final String DELIMITER_ENCBPK_TARGET = "|";
+
public String getName() {
return ENC_BPK_LIST_NAME;
}
@@ -45,12 +48,22 @@ public class EncryptedBPKAttributeBuilder implements IPVPAttributeBuilder {
if (authData instanceof IMOAAuthData) {
if (((IMOAAuthData)authData).getEncbPKList() != null &&
((IMOAAuthData)authData).getEncbPKList().size() > 0) {
- String value = ((IMOAAuthData)authData).getEncbPKList().get(0);
- for (int i=1; i<((IMOAAuthData)authData).getEncbPKList().size(); i++)
- value += ";"+((IMOAAuthData)authData).getEncbPKList().get(i);
+ Pair<String, String> value = ((IMOAAuthData)authData).getEncbPKList().get(0);
+ String result = BPKListAttributeBuilder.LIST_ELEMENT_START
+ + value.getSecond() + DELIMITER_ENCBPK_TARGET + value.getFirst()
+ + BPKListAttributeBuilder.LIST_ELEMENT_END;
+
+ for (int i=1; i<((IMOAAuthData)authData).getEncbPKList().size(); i++) {
+ Pair<String, String> el = ((IMOAAuthData)authData).getEncbPKList().get(i);
+ result += BPKListAttributeBuilder.DELIMITER_BPK_LIST
+ + BPKListAttributeBuilder.LIST_ELEMENT_START
+ + el.getSecond() + DELIMITER_ENCBPK_TARGET + el.getFirst()
+ + BPKListAttributeBuilder.LIST_ELEMENT_END;
+
+ }
return g.buildStringAttribute(ENC_BPK_LIST_FRIENDLY_NAME, ENC_BPK_LIST_NAME,
- value);
+ result);
}
@@ -59,16 +72,6 @@ public class EncryptedBPKAttributeBuilder implements IPVPAttributeBuilder {
throw new UnavailableAttributeException(ENC_BPK_LIST_NAME);
-// String encbpk = "XXX01234567890XXX";
-// String type = "Bereich";
-// String vkz = "Verfahrenskennzeichen";
-//
-// //TODO: implement encrypted bPK support
-//
-// Logger.trace("Authenticate user with encrypted bPK " + vkz + "+" + type + "|" + encbpk);
-//
-// return g.buildStringAttribute(ENC_BPK_LIST_FRIENDLY_NAME, ENC_BPK_LIST_NAME,
-// vkz + "+" + type + "|" + encbpk);
}
public <ATT> ATT buildEmpty(IAttributeGenerator<ATT> g) {