diff options
author | lalber <lukas.alber@iaik.tugraz.at> | 2020-11-04 18:47:51 +0100 |
---|---|---|
committer | lalber <lukas.alber@iaik.tugraz.at> | 2020-11-04 18:47:51 +0100 |
commit | 3e422c60952d5892a0e568de8c28ce878610eb2f (patch) | |
tree | 86fa9fea94f3990ad68863435fb0bf629f3b57b9 /eidas_modules/authmodule-eIDAS-v2/src | |
parent | a9009a6f89c41dc19b85331dda676993c8a273b9 (diff) | |
download | National_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')
2 files changed, 9 insertions, 11 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 ... "); diff --git a/eidas_modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/SzrClientTest.java b/eidas_modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/SzrClientTest.java index c957e20c..d6bce8eb 100644 --- a/eidas_modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/SzrClientTest.java +++ b/eidas_modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/SzrClientTest.java @@ -143,7 +143,8 @@ public class SzrClientTest { when(szrMock.getBPKFromStammzahlEncrypted(anyList())) .thenReturn(Arrays.asList(result1)); -// szrMock.getStammzahlEncrypted() TODO ??? + String stammzahlEncrypted = szrMock.getStammzahlEncrypted(new PersonInfoType(), false); + } @Test |