private function getKeyContent(Key $key, $header)
    {
        $match = null;

        preg_match(
            '/^[\-]{5}BEGIN ' . $header . '[\-]{5}(.*)[\-]{5}END ' . $header . '[\-]{5}$/',
            str_replace([PHP_EOL, "\n", "\r"], '', $key->getContent()),
            $match
        );

        if (isset($match[1])) {
            return $match[1];
        }

        throw new \InvalidArgumentException('This is not a valid ECDSA key.');
    }