In a .env
at the root of the directory, set the following variables:
PRIV_KEY_LOC
: file path to the private keyPUBLIC_KEY_LOC
: file path to the public keyAUTH_KEY_TYPE
: type of the key
The following authentication keys are supported:
- RSA
- ES256
- ES512
The following shows basic/default settings to make these keys, preferably add passphrases and more bytes for security.
openssl genrsa -out priv_key.pem 2048
openssl rsa -in priv_key.pem -outform PEM -pubout -out pub_key.pem
openssl ecparam -name prime256v1 -genkey -noout -out priv_ecdsa.pem
openssl pkey -in priv_ecdsa.pem -pubout > pub_ecdsa.pem
openssl ecparam -name secp521r1 -genkey -noout -out priv_ecdsa.pem
openssl ec -in priv_ecdsa.pem -pubout -out pub_ecdsa.pem