paragonie / paseto

Platform-Agnostic Security Tokens
https://paseto.io
Other
3.24k stars 108 forks source link

Maybe wrong documentation ? #110

Closed BruceGitHub closed 3 years ago

BruceGitHub commented 4 years ago

I decided to use paseto and I starting to read the docs but this seems to have an error

https://github.com/paragonie/paseto/tree/master/docs

php

/**
 * @var SymmetricKey $sharedKey
 */
$token = Builder::getLocal($sharedKey, new Version2());

$token = (new Builder())
    ->setKey($sharedKey)
....

in fact is missing the variable

$sharedKey = new SymmetricKey(random_bytes(32));

in both example

paragonie-security commented 4 years ago

The documentation does not have key management in scope. You could generate it randomly, but doing so will make tokens un-decryptable after the page has loaded. That's not very useful.

BruceGitHub commented 4 years ago

Right, but I was referring only in the case of copy and paste to try something with the lib