Files
hyperf-saml/bin/generate-cert
李东云 74a70b410e build(composer): 添加了生成签名的 bin 脚本
忘了解除注释了。。

Signed-off-by: 李东云 <dongyun.li@luxcreo.ai>
2022-06-15 18:26:37 +08:00

24 lines
909 B
Bash
Executable File

#!/bin/sh
# shellcheck disable=SC2039
echo -e '\033[44;34;5m=============================\033[0m'
mkdir -p "$(pwd)"/cert && cd "$(pwd)"/cert || exit
echo 'Credentials directory created'
echo -e '\033[44;34;5m=============================\033[0m'
echo ''
openssl req -new -x509 -nodes -sha256 -out saml.crt -keyout saml.pem && cd - || exit
echo ''
echo -e '\033[44;34;5m=============================\033[0m'
echo -e '\033[;31;1m🎉Congratulations!\033[0m'
echo 'Now you can found credentials in the following directory:'
echo -e "\033[;36;4m$(pwd)/cert/\033[0m"
echo ''
echo -e "Public key: \033[;35;4mcert/saml.crt\033[0m"
echo -e "Private key: \033[;35;4mcert/saml.pem\033[0m"
echo ''
echo -e '\033[34;1mNotice: If you cannot read saml.pem in IDE,\033[0m'
echo -e '\033[34;1myou can print it in commander directly with following command:\033[0m'
echo ''
echo -e '\033[5mcat ./cert/saml.pem\033[0m'
echo ''