<?php

/*
 * This file is part of the AuthStack project.
 *
 * (c) Buckhill Ltd <development@buckhill.co.uk>
 *
 * This source file is subject to the Buckhill license that is bundled
 * with this source code in the file LICENSE.
 */

namespace AuthStack\TwoFactor\Model;

interface KeyInterface
{
    const MODE_RFC4226 = 1;
    const MODE_RFC6238 = 2;
    const MODE_YUBIKEY = 3;
    const MODE_YUBIKEY_OATH = 4;
    const MODE_U2F = 5;


    /**
     * PK value in security_keys table
     *
     * @return int
     */
    public function getID();


    /**
     * PK in mfa_key table
     *
     * @return int
     */
    public function getKeyID();


    /**
     * @param $id
     * @return MFAKey
     * @throws \Exception
     */
    public function getMFAKey($id);


    /**
     * @return bool
     */
    public function isU2F();


    /**
     * @return mixed
     */
    public function getType();


    /**
     * @return string
     */
    public function getTitle();


    /**
     * @return string
     */
    public function getCreatedAt();


    /**
     * @return string
     */
    public function getUsedAt();


    /**
     * Returns an array of information specific to key type, depends on the key algorithm
     *
     * @return array
     */
    public function getMetadata();


    /**
     * @param bool|false $show_secret_fields
     *
     * @return mixed
     */
    public function toArray($show_secret_fields = false);
}