PHP Classes

File: src/PaserkTypeInterface.php

Recommend this page to a friend!
  Classes of Scott Arciszewski   PASERK PHP   src/PaserkTypeInterface.php   Download  
File: src/PaserkTypeInterface.php
Role: Class source
Content type: text/plain
Description: Class source
Class: PASERK PHP
Extend PASETO to wrap and serialize keys
Author: By
Last change:
Date: 2 years ago
Size: 909 bytes
 

Contents

Class file image Download
<?php
declare(strict_types=1);
namespace
ParagonIE\Paserk;

use
ParagonIE\Paseto\KeyInterface;

/**
 * Interface PaserkTypeInterface
 * @package ParagonIE\Paserk
 */
interface PaserkTypeInterface
{
   
/**
     * Decode a PASERK string into a PASETO key.
     *
     * @param string $paserk
     * @return KeyInterface
     */
   
public function decode(string $paserk): KeyInterface;

   
/**
     * Encode a PASETO key into a PASERK string.
     *
     * @param KeyInterface $key
     * @return string
     */
   
public function encode(KeyInterface $key): string;

   
/**
     * Get the label for this PASERK Type.
     *
     * @return string
     */
   
public static function getTypeLabel(): string;

   
/**
     * Get the appropriate ID string.
     *
     * @see Lid, Pid, Sid
     *
     * @param KeyInterface $key
     * @return string
     */
   
public function id(KeyInterface $key): string;
}