티스토리 뷰

openssl 유틸리티를 여러번 쓰는 것이 귀찮아서 만든 간단한 스크립트.

내용은 아래와 같고 다운로드할 수 있습니다.

make-self-signed-cert.sh


#!/bin/sh # Made by Hojin Choi

2014.08.05 # You can use or modify freely except the above author's name if which openssl >/dev/null 2>&1; then : else echo "Error: You need 'openssl' in PATH somewhere" exit 1 fi C="KR" ST="Seoul" O="Self-signed Cert" CN="$1" if test "$CN" = ""; then echo "Usage: $0 " exit 0 fi openssl genrsa -out cert.temp -aes256 1024 || exit 1 openssl rsa -out cert.key -in cert.temp || exit 1 openssl req -out cert.csr -new -key cert.key -subj "/C=$C/ST=$ST/O=$O/CN=$CN" || exit 1 openssl x509 -out cert.pem -req -signkey cert.key -in cert.csr -days 3650 || exit 1 rm -f cert.temp cert.csr

반응형
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
글 보관함