1

I'm trying to install lexikJwtauthbundle, when I try to generate key :

$ openssl genrsa -out app/config/jwt/private.pem -aes256 4096

Generating RSA private key, 4096 bit long modulus

..........................................................++

........++

The command seems to never finish, I must do a CTRL-C to exit. The file is created but empty. The next command to generate the public key return:

unable to load Private Key
12568:error:0906D06C:PEM routines:PEM_read_bio:no start line:pem_lib.c:707:Expecting: ANY PRIVATE KEY

What is the problem ?

I want use it for an Api rest i'm building on symfony 3.4, with FosRestBundle. Windows10.

2 Answers2

0

The problem is that the .pem file is "just" a text file which has a specific structure like

-----BEGIN RSA PRIVATE KEY-----//Mandatory

Proc-Type: 4,ENCRYPTED
DEK-Info: AES-256-CBC,Some charsSome charsSome chars

Some chars Some chars Some chars Some chars
Some chars Some chars Some chars Some chars
-----END RSA PRIVATE KEY-----//Mandatory

So the command is specting to find the above structure and fails if doesn't. Read this post. Also the file is blank because the command didn't finish so it couldn't write anything.

If you could, let the command finish or crash and post the results or try to reinstall the packages(I don't know which OS you are working on)

Try to check you are root or have the proper permissions on folder and your packages are installed correctly.

Hope it helps! and provide feedback

Juan I. Morales Pestana
  • 1,057
  • 1
  • 10
  • 34
0

Try :

$ openssl genrsa -out config/jwt/private.pem 4096

without using the option -aes256

Neji Soltani
  • 1,522
  • 4
  • 22
  • 41
zouhair
  • 1
  • 1