Initial commit

This commit is contained in:
2021-02-11 13:22:51 +01:00
commit 3899d191a4
21 changed files with 712 additions and 0 deletions

19
src/Key/JwtDerivedKey.php Normal file
View File

@ -0,0 +1,19 @@
<?php
namespace NoccyLabs\SimpleJwt\Key;
class JwtDerivedKey implements KeyInterface
{
private $key;
public function __construct(string $password, string $salt, int $iter=100)
{
$this->key = hash_pbkdf2("sha256", $password, $salt, $iter, 0, true);
}
public function getBinaryKey(): string
{
return $this->key;
}
}