use of uk.gov.ida.integrationtest.hub.samlengine.support.AssertionDecrypter in project verify-hub by alphagov.
the class CountryAuthnResponseTranslatorResourceTest method assertThatDecryptedAssertionsAreTheSame.
private void assertThatDecryptedAssertionsAreTheSame(InboundResponseFromCountry response, org.opensaml.saml.saml2.core.Response originalResponse) {
AssertionDecrypter hubDecrypter = new AssertionDecrypter(TestCertificateStrings.HUB_TEST_PRIVATE_ENCRYPTION_KEY, TestCertificateStrings.HUB_TEST_PUBLIC_ENCRYPTION_CERT);
List<Assertion> originalAssertions = hubDecrypter.decryptAssertions(originalResponse);
AssertionDecrypter rpDecrypter = new AssertionDecrypter(TestCertificateStrings.TEST_RP_MS_PRIVATE_ENCRYPTION_KEY, TestCertificateStrings.TEST_RP_PUBLIC_ENCRYPTION_CERT);
Assertion returnedAssertion = rpDecrypter.decryptAssertion(response.getEncryptedIdentityAssertionBlob().get());
assertThat(originalAssertions).hasSize(1);
Assertion originalAssertion = originalAssertions.get(0);
assertEquals(returnedAssertion, originalAssertion);
}
Aggregations