From dde5479553eb954e41fc8fe85abf45cf579d3034 Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Fri, 19 Jun 2020 15:53:47 +0200 Subject: add first simple jUnit tests for JOSE-Utils --- .../src/test/resources/data/config1.properties | 19 ++++++++++++++++ .../src/test/resources/data/config2.properties | 19 ++++++++++++++++ .../test/resources/data/hsm_facade_trust_root.crt | 10 +++++++++ .../src/test/resources/data/junit.jks | Bin 0 -> 3980 bytes .../resources/data/junit_without_trustcerts.jks | Bin 0 -> 2733 bytes .../resources/data/junit_without_trustcerts.p12 | Bin 0 -> 3204 bytes .../src/test/resources/data/test.crt | 3 +++ .../test/resources/spring/test_eaaf_sl20.beans.xml | 24 +++++++++++++++++++++ .../resources/spring/test_eaaf_sl20_hsm.beans.xml | 24 +++++++++++++++++++++ 9 files changed, 99 insertions(+) create mode 100644 eaaf_modules/eaaf_module_auth_sl20/src/test/resources/data/config1.properties create mode 100644 eaaf_modules/eaaf_module_auth_sl20/src/test/resources/data/config2.properties create mode 100644 eaaf_modules/eaaf_module_auth_sl20/src/test/resources/data/hsm_facade_trust_root.crt create mode 100644 eaaf_modules/eaaf_module_auth_sl20/src/test/resources/data/junit.jks create mode 100644 eaaf_modules/eaaf_module_auth_sl20/src/test/resources/data/junit_without_trustcerts.jks create mode 100644 eaaf_modules/eaaf_module_auth_sl20/src/test/resources/data/junit_without_trustcerts.p12 create mode 100644 eaaf_modules/eaaf_module_auth_sl20/src/test/resources/data/test.crt create mode 100644 eaaf_modules/eaaf_module_auth_sl20/src/test/resources/spring/test_eaaf_sl20.beans.xml create mode 100644 eaaf_modules/eaaf_module_auth_sl20/src/test/resources/spring/test_eaaf_sl20_hsm.beans.xml (limited to 'eaaf_modules/eaaf_module_auth_sl20/src/test/resources') diff --git a/eaaf_modules/eaaf_module_auth_sl20/src/test/resources/data/config1.properties b/eaaf_modules/eaaf_module_auth_sl20/src/test/resources/data/config1.properties new file mode 100644 index 00000000..f58e3da9 --- /dev/null +++ b/eaaf_modules/eaaf_module_auth_sl20/src/test/resources/data/config1.properties @@ -0,0 +1,19 @@ +security.hsmfacade.host=eid.a-sit.at +security.hsmfacade.port=9050 +security.hsmfacade.trustedsslcert=src/test/resources/data/hsm_facade_trust_root.crt +security.hsmfacade.username=authhandler-junit +security.hsmfacade.password=supersecret123 + +modules.sl20.security.keystore.type=jks +modules.sl20.security.keystore.path=src/test/resources/data/junit.jks +modules.sl20.security.keystore.password=password +modules.sl20.security.keystore.name= +modules.sl20.security.sign.alias=sig +modules.sl20.security.sign.password=password +modules.sl20.security.encryption.alias=meta +modules.sl20.security.encryption.password=password + +modules.sl20.security.truststore.type=jks +modules.sl20.security.truststore.path=src/test/resources/data/junit.jks +modules.sl20.security.truststore.password=password +modules.sl20.security.truststore.name= \ No newline at end of file diff --git a/eaaf_modules/eaaf_module_auth_sl20/src/test/resources/data/config2.properties b/eaaf_modules/eaaf_module_auth_sl20/src/test/resources/data/config2.properties new file mode 100644 index 00000000..ff99dcef --- /dev/null +++ b/eaaf_modules/eaaf_module_auth_sl20/src/test/resources/data/config2.properties @@ -0,0 +1,19 @@ +security.hsmfacade.host=eid.a-sit.at +security.hsmfacade.port=9050 +security.hsmfacade.trustedsslcert=src/test/resources/data/hsm_facade_trust_root.crt +security.hsmfacade.username=authhandler-junit +security.hsmfacade.password=supersecret123 + +modules.sl20.security.keystore.type=hsmfacade +modules.sl20.security.keystore.path= +modules.sl20.security.keystore.password= +modules.sl20.security.keystore.name=eid-junit +modules.sl20.security.sign.alias=rsa-key-1 +modules.sl20.security.sign.password= +modules.sl20.security.encryption.alias=ec-key-1 +modules.sl20.security.encryption.password= + +modules.sl20.security.truststore.type=hsmfacade +modules.sl20.security.truststore.path=src/test/resources/data/junit.jks +modules.sl20.security.truststore.password= +modules.sl20.security.truststore.name=eid-junit \ No newline at end of file diff --git a/eaaf_modules/eaaf_module_auth_sl20/src/test/resources/data/hsm_facade_trust_root.crt b/eaaf_modules/eaaf_module_auth_sl20/src/test/resources/data/hsm_facade_trust_root.crt new file mode 100644 index 00000000..01be3821 --- /dev/null +++ b/eaaf_modules/eaaf_module_auth_sl20/src/test/resources/data/hsm_facade_trust_root.crt @@ -0,0 +1,10 @@ +-----BEGIN CERTIFICATE----- +MIIBdDCCARqgAwIBAgIEXkz1yjAKBggqhkjOPQQDAjARMQ8wDQYDVQQDDAZlY3Jv +b3QwHhcNMjAwMjE5MDg0NjAyWhcNMjEwMjE4MDg0NjAyWjARMQ8wDQYDVQQDDAZl +Y3Jvb3QwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAAS8yvpVIWbPj4E7Lr87hwQR +T9DZf9WY5LMV7gF6NKpnJ5JkEql/s7fqBVbrh8aSNo6gmfmSk4VYGhPJ+DCMzzQj +o2AwXjAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFOXafzYpIOlu6BgNU+Ee +JWuJobgWMB0GA1UdDgQWBBTl2n82KSDpbugYDVPhHiVriaG4FjALBgNVHQ8EBAMC +AQYwCgYIKoZIzj0EAwIDSAAwRQIgRt/51PKL/bATuLCdib95Ika+h845Jo0G+Sbn +bzNwJAcCIQCVD1cxEBuUkKaiaLbTiNVsEjvQb6ti0TFbbQUH66jCGA== +-----END CERTIFICATE----- diff --git a/eaaf_modules/eaaf_module_auth_sl20/src/test/resources/data/junit.jks b/eaaf_modules/eaaf_module_auth_sl20/src/test/resources/data/junit.jks new file mode 100644 index 00000000..59e6ad13 Binary files /dev/null and b/eaaf_modules/eaaf_module_auth_sl20/src/test/resources/data/junit.jks differ diff --git a/eaaf_modules/eaaf_module_auth_sl20/src/test/resources/data/junit_without_trustcerts.jks b/eaaf_modules/eaaf_module_auth_sl20/src/test/resources/data/junit_without_trustcerts.jks new file mode 100644 index 00000000..b5262cb8 Binary files /dev/null and b/eaaf_modules/eaaf_module_auth_sl20/src/test/resources/data/junit_without_trustcerts.jks differ diff --git a/eaaf_modules/eaaf_module_auth_sl20/src/test/resources/data/junit_without_trustcerts.p12 b/eaaf_modules/eaaf_module_auth_sl20/src/test/resources/data/junit_without_trustcerts.p12 new file mode 100644 index 00000000..c3fe2681 Binary files /dev/null and b/eaaf_modules/eaaf_module_auth_sl20/src/test/resources/data/junit_without_trustcerts.p12 differ diff --git a/eaaf_modules/eaaf_module_auth_sl20/src/test/resources/data/test.crt b/eaaf_modules/eaaf_module_auth_sl20/src/test/resources/data/test.crt new file mode 100644 index 00000000..76c18361 --- /dev/null +++ b/eaaf_modules/eaaf_module_auth_sl20/src/test/resources/data/test.crt @@ -0,0 +1,3 @@ +-----BEGIN CERTIFICATE----- +MIIEXDCCA0SgAwIBAgIEY4Qn3zANBgkqhkiG9w0BAQsFADCBpzELMAkGA1UEBhMCQVQxSDBGBgNVBAoMP0EtVHJ1c3QgR2VzLiBmLiBTaWNoZXJoZWl0c3N5c3RlbWUgaW0gZWxla3RyLiBEYXRlbnZlcmtlaHIgR21iSDEmMCQGA1UECwwdYS1zaWduLVRlc3QtUHJlbWl1bS1Nb2JpbGUtMDUxJjAkBgNVBAMMHWEtc2lnbi1UZXN0LVByZW1pdW0tTW9iaWxlLTA1MB4XDTE5MTIxMzEzNDg0N1oXDTI0MTIxMzEzNDg0N1owYDELMAkGA1UEBhMCQVQxFzAVBgNVBAMMDk1heCBNdXN0ZXJtYW5uMRMwEQYDVQQEDApNdXN0ZXJtYW5uMQwwCgYDVQQqDANNYXgxFTATBgNVBAUTDDgxNjkyMjY1ODM0ODBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABAUAVvbow4O/DMA5ZZoPHQXe0rtf86lvH8GLM/Crz1vvRYyQ5D4ESYRFy+s3zHdLqhE4l8I95i9jz2qTvof46mqjggGfMIIBmzCBggYIKwYBBQUHAQEEdjB0MEkGCCsGAQUFBzAChj1odHRwOi8vd3d3LmEtdHJ1c3QuYXQvY2VydHMvYS1zaWduLXRlc3QtcHJlbWl1bS1tb2JpbGUtMDUuY3J0MCcGCCsGAQUFBzABhhtodHRwOi8vb2NzcC5hLXRydXN0LmF0L29jc3AwEwYDVR0jBAwwCoAITuhoD/7N29AwEQYDVR0OBAoECEyqhgBwLul2MA4GA1UdDwEB/wQEAwIGwDAJBgNVHRMEAjAAMIGGBgNVHSAEfzB9MHsGBiooABEBBDBxMDgGCCsGAQUFBwICMCwaKkRpZXNlcyBaZXJ0aWZpa2F0IGRpZW50IG51ciB6dSBUZXN0endlY2tlbjA1BggrBgEFBQcCARYpaHR0cDovL3d3dy5hLXRydXN0LmF0L2RvY3MvY3AvYS1zaWduLVRFU1QwSAYDVR0fBEEwPzA9oDugOYY3aHR0cDovL2NybC5hLXRydXN0LmF0L2NybC9hLXNpZ24tdGVzdC1wcmVtaXVtLW1vYmlsZS0wNTANBgkqhkiG9w0BAQsFAAOCAQEATD4ZnrEV+xeT7PFI/idqHdElLZ1BVUO9G9qfQQn4oKNCWWHxMo/ZXSlvsOtTjFezCQFkcFO1eJtXNHCyqfr69jorzhZcicscNRMrDlJoB/sJr0l/Ekjlt/dgRaTuZ7NzWE/oTefI3M3xkkLd0ydAMrhrZx+9f82VE3k63I1fmT90kQ8PfDzAMMRmlwbZDA+2TB8iF7SQkOOL6H1j2L9qrhjlG2ekU4cyx6KMkRjLLbr1JVgS07qOzUkeQPR2KTJcWWR+/NQZWDKdOz97eVOulxeI+Y3y96arraGM7lIbV9ZrpkbUn/IxQ9TQTE5X02EipgnZdR7bZrwJ7hJ27vwnfQ== +-----END CERTIFICATE----- diff --git a/eaaf_modules/eaaf_module_auth_sl20/src/test/resources/spring/test_eaaf_sl20.beans.xml b/eaaf_modules/eaaf_module_auth_sl20/src/test/resources/spring/test_eaaf_sl20.beans.xml new file mode 100644 index 00000000..e4002a8f --- /dev/null +++ b/eaaf_modules/eaaf_module_auth_sl20/src/test/resources/spring/test_eaaf_sl20.beans.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/eaaf_modules/eaaf_module_auth_sl20/src/test/resources/spring/test_eaaf_sl20_hsm.beans.xml b/eaaf_modules/eaaf_module_auth_sl20/src/test/resources/spring/test_eaaf_sl20_hsm.beans.xml new file mode 100644 index 00000000..a9f5dc80 --- /dev/null +++ b/eaaf_modules/eaaf_module_auth_sl20/src/test/resources/spring/test_eaaf_sl20_hsm.beans.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + \ No newline at end of file -- cgit v1.2.3