Unable to generate a new identity from a PEM file

I want to generate a PEM file according to this document and create a new identity using the dex command, but I’m getting an error.
The process is as follows.

dfx identity import proposals private.pem

The error is:

Error: Failed to validate pem file
Caused by: Failed to validate PEM content
Caused by: An error occurred while reading the file: missing data
Caused by: missing data

This time, the PEM file was created using the quill generate command, and it is requesting the creation of a password for encryption. However, I think this is due to the fact that the password for decrypting the PEM file was not requested in the process of importing the identity.
How can I fix the error?

Incidentally, it is possible to re-import an existing PEM file with the force option. Also, based on the seed.txt generated by quill generate, it is possible to generate a new identity with the following command

dfx identity import --seed-file seed.txt proposals

Reference
dfx: 0.24.0
quill: 0.5.0

Those docs are unfortunately a little outdated - they were written before quill generated encrypted identities by default, and dfx identity import expects an unencrypted file. You can use the quill decrypt-pem command to generate an unencrypted pem file for importing into other tools, or you can import the identity via seed phrase with dfx identity import --seed-file.

1 Like