Initial commit
This commit is contained in:
19
src/Key/JwtDerivedKey.php
Normal file
19
src/Key/JwtDerivedKey.php
Normal 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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user