public static function validateSSL(string $data, XMLSecurityKey $key) : void
    {
        $container = ContainerSingleton::getInstance();
        $keyInfo = openssl_pkey_get_details($key->key);
        if ($keyInfo === false) {
            throw new \Exception('Unable to get key details from XMLSecurityKey.');
        }

        if (!isset($keyInfo['key'])) {
            throw new \Exception('Missing key in public key details.');
        }

        if ($keyInfo['key'] !== $data) {
            $container->getLogger()->debug('Key on SSL connection did not match key we validated against.');

            return;
        }

        $container->getLogger()->debug('Message validated based on SSL certificate.');
    }