aboutsummaryrefslogtreecommitdiff
path: root/eidas_modules/authmodule-eIDAS-v2/src/main
diff options
context:
space:
mode:
authorlalber <lukas.alber@iaik.tugraz.at>2020-11-04 18:47:51 +0100
committerlalber <lukas.alber@iaik.tugraz.at>2020-11-04 18:47:51 +0100
commit3e422c60952d5892a0e568de8c28ce878610eb2f (patch)
tree86fa9fea94f3990ad68863435fb0bf629f3b57b9 /eidas_modules/authmodule-eIDAS-v2/src/main
parenta9009a6f89c41dc19b85331dda676993c8a273b9 (diff)
downloadNational_eIDAS_Gateway-3e422c60952d5892a0e568de8c28ce878610eb2f.tar.gz
National_eIDAS_Gateway-3e422c60952d5892a0e568de8c28ce878610eb2f.tar.bz2
National_eIDAS_Gateway-3e422c60952d5892a0e568de8c28ce878610eb2f.zip
Attribute builder tests EidasBindAttributeBuilderTest and AuthBlockAttributeBuilderTest
Diffstat (limited to 'eidas_modules/authmodule-eIDAS-v2/src/main')
-rw-r--r--eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/CreateIdentityLinkTask.java17
1 files changed, 7 insertions, 10 deletions
diff --git a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/CreateIdentityLinkTask.java b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/CreateIdentityLinkTask.java
index af260528..f060a4cf 100644
--- a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/CreateIdentityLinkTask.java
+++ b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/CreateIdentityLinkTask.java
@@ -101,6 +101,7 @@ public class CreateIdentityLinkTask extends AbstractAuthServletTask {
@Autowired
EaafKeyStoreFactory keyStoreFactory;
+ private static final String EID_STATUS = "urn:eidgvat:eid.status.eidas";
Pair<KeyStore, Provider> ks;
/*
@@ -230,27 +231,24 @@ public class CreateIdentityLinkTask extends AbstractAuthServletTask {
}
if (eidMode.equals("new")) {
-
String keyAlias = pendingReq.getServiceProviderConfiguration().getConfigurationValue(
MsEidasNodeConstants.PROP_CONFIG_SP_AUTHBLOCK_FRIENDLYNAME, "");
-
String keyPw = pendingReq.getServiceProviderConfiguration()
.getConfigurationValue(MsEidasNodeConstants.PROP_CONFIG_SP_AUTHBLOCK_PW, "");
+ // get verschlüsselte Stammzahl
String vsz = szrClient.getEncryptedStammzahl(personInfo);
// build Keystore
String pk64 = getPkFromKeystore(keyAlias, keyPw);
+ // get eIDAS bind
+ String signedEidasBind = szrClient.getBcBind(vsz, pk64, EID_STATUS);
- String signedEidasBind = szrClient.getBcBind(vsz, pk64, "urn:eidgvat:eid.status.eidas");
- //TODO eidStatus as config?
-
- //build AuthBlock JWS
+ // build AuthBlock (JWS)
ObjectMapper mapper = new ObjectMapper();
String jwsPayload = mapper.writeValueAsString(pendingReq.getUniqueTransactionIdentifier());
-
String jwsSignature = JoseUtils
.createSignature(ks, keyAlias, keyPw.toCharArray(), jwsPayload, false, keyAlias);
@@ -277,9 +275,8 @@ public class CreateIdentityLinkTask extends AbstractAuthServletTask {
.getBasicConfigurationBoolean(Constants.CONIG_PROPS_EIDAS_SZRCLIENT_DEBUG_USESRZFORBPKGENERATION, true)) {
bpk = szrClient
.getBpk(personInfo, pendingReq.getServiceProviderConfiguration().getAreaSpecificTargetIdentifier(),
- basicConfig
- .getBasicConfiguration(Constants.CONIG_PROPS_EIDAS_SZRCLIENT_PARAMS_VKZ, "no VKZ defined"))
- .get(0);
+ basicConfig.getBasicConfiguration(Constants.CONIG_PROPS_EIDAS_SZRCLIENT_PARAMS_VKZ,
+ "no VKZ defined")).get(0);
} else {
log.debug("Calculating bPK from baseId ... ");