Files
symfony-flex-recipes/lexik/jwt-authentication-bundle/2.3/Makefile
T

10 lines
441 B
Makefile

OPENSSL_BIN := $(shell which openssl)
generate-jwt-keys: ## Generates JWT auth keys
ifndef OPENSSL_BIN
$(error "Unable to generate keys (needs OpenSSL)")
endif
mkdir -p config/jwt
openssl genrsa -passout pass:${JWT_PASSPHRASE} -out ${JWT_PRIVATE_KEY_PATH} -aes256 4096
openssl rsa -passin pass:${JWT_PASSPHRASE} -pubout -in ${JWT_PRIVATE_KEY_PATH} -out ${JWT_PUBLIC_KEY_PATH}
@echo "\033[32mRSA key pair successfully generated\033[39m"