public static function isPEM(string $keyContents): bool
    {
        if ('' === $keyContents) {
            return false;
        }

        $openSSL = new OpenSSL();
        return $openSSL->readPemContents($keyContents)->hasPrivateKey();
    }