public function validateResponse(Response $response, $relayState)
    {
        $this->validateIssuer($response);
        $this->validateDestination($response);

        if ($relayState) {
            $this->validateRelayState($response, $relayState);
        }

        $public = KeyHelper::createPublicKey(
            $this->getMetadata()->getFirstIdpSsoDescriptor()
                ->getFirstKeyDescriptor(KeyDescriptor::USE_SIGNING)
                ->getCertificate()
        );

        if ($this->hasSignature($response)) {
            $this->validateSignature($response, $public);
        }

        if ($response->getAllEncryptedAssertions()) {
            $private = KeyHelper::createPrivateKey($this->getPrivateKey(), null);
            /** @var EncryptedAssertionReader $encryptedAssertion */
            foreach ($response->getAllEncryptedAssertions() as $encryptedAssertion) {
                $assertion = $encryptedAssertion->decryptAssertion($private, new DeserializationContext());

                if ($this->hasSignature($assertion)) {
                    $this->validateSignature($assertion, $public);
                }

                $response->addAssertion($assertion);
            }
        }
    }