Skip to content

RS256 segmentation fault #27

Open
Open
@riquebrenner

Description

@riquebrenner

Greetings! I am trying to use RSA but SF (segmentation fault) is occurring.

I am creating a private key with this command:
"openssl genpkey -algorithm RSA -out private_key.pem -pkeyopt rsa_keygen_bits: 1024"

and a public key with this command:
"openssl rsa -pubout -in private_key.pem -out public_key.pem"

and I'm using these functions:

$privateKey = file_get_contents ('private_key.pem');
$publicKey = file_get_contents ('public_key');
$retVal['Bearer'] = jwt_encode($payload, $privateKey, 'RS256');
$open_token = jwt_decode ($token, $publicKey, ['algorithm' => 'RS256']);

I walked step-by-step in the code, the values are generated, but further ahead in the code happens the segmentation failure. Am I doing something wrong?
I'm using CentOS 7, PHP 7.3 and mariaDB through the mysqli module.
When I use HS256 it runs ok.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions