<?php

namespace Buckhill\U2F\Enroll;

use Illuminate\Http\Request as HTTPRequest;

final class Enrollment
{
    /**
     * @param $app_id
     *
     * @return array
     */
    public function challenge($app_id)
    {
        $request = new Request($app_id);

        return $request->toArray();
    }


    /**
     * @param Request $request
     *
     * @return Response
     */
    public function fromResponse(HTTPRequest $request)
    {
        return $this->response($request->all());
    }

    /**
     * @param array $data
     *
     * @return Response
     */
    public function response(array $data)
    {
        return Response::fromArray($data);
    }
}