public function validateSignature($message, XMLSecurityKey $key)
    {
        $reader = $message->getSignature();
        if ($reader instanceof AbstractSignatureReader) {
            try {
                return $reader->validate($key);
            } catch (\Exception $e) {
                throw new SamlException('urn:oasis:names:tc:SAML:2.0:status:RequestDenied', $e);
            }
        } else {
            throw new SecurityException('Saml message signature is not specified');
        }
    }