php-jwt
php-jwt copied to clipboard
Pass key as string?
From what I can see in docs, it seems only possible to pass a file path in the constructor. It would be helpful if I could pass the key directly as a string without having to create a file first (in my case it's coming from a database). Is there maybe a trick using the resource method somehow?
i think you can directly set the resource as key.
$key = openssl_pkey_get_private('your rsa key as string from database');
$jwt = new JWT($key, 'RS256');
// ...
closing for now