3 # $NetBSD: pkgsrc.sh,v 1.1.1.1 2009/02/02 20:44:09 joerg Exp $
6 CA
="openssl ca -config pkgsrc.cnf"
7 REQ
="openssl req -config pkgsrc.cnf"
12 if [ -f $1/serial
]; then
13 echo "CA already exists, exiting" >& 2
17 mkdir
-p $1/certs
$1/crl
$1/newcerts
$1/private
21 echo "Making CA certificate ..."
22 $REQ -new -keyout $1/private
/cakey.pem \
24 $CA -out $1/cacert.pem
-batch \
25 -keyfile $1/private
/cakey.pem
-selfsign \
30 $REQ -new -keyout pkgkey_key.pem
-out pkgkey_req.pem
31 $CA -extensions pkgkey
-policy policy_match
-out pkgkey_cert.pem
-infiles pkgkey_req.pem
33 echo "Signed certificate is in pkgkey_cert.pem, key in pkgkey_key.pem"
37 $REQ -new -keyout pkgsec_key.pem
-out pkgsec_req.pem
38 $CA -extensions pkgsec
-policy policy_match
-out pkgsec_cert.pem
-infiles pkgsec_req.pem
40 echo "Signed certificate is in pkgsec_cert.pem, key in pkgsec_key.pem"
45 echo "setup - create new CA in ./pkgsrc for use by pkg_install"
46 echo "pkgkey - create and sign a certificate for binary packages"
47 echo "pkgsec - create and sign a certificate for pkg-vulnerabilities"