Closed rustyconover closed 2 years ago
@rustyconover try:
const encoderKey = new Paseto.SymmetricKey(new Paseto.V2());
await encoderKey.base64(encryptionKey);
const encoder = encoderKey.protocol();
That last line doesn't work because you're generating a new protocol object, not loading the one attached to the key. If that doesn't work (especially because the error is on the await
line) then I would guess your encryptionKey
is not of the right type/format.
Going to close this for now, feel free to reopen if the issue isn't resolved and you can provide more information.
I'm trying to load in a base64 encoded symmetric key using this code:
Returns in an error:
But if I call
encoderKey.generate()
before attempting to load the key everything works.