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.');
    }
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.');
    }
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.' ) ; }
Validate a SOAP message against the certificate on the SSL connection.

@param string $data The public key that was used on the connection.
@param XMLSecurityKey $key The key we should validate the certificate against.
@throws \Exception
@return void
Validate a SOAP message against the certificate on the SSL connection .