summaryrefslogtreecommitdiff
path: root/localcsr
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2010-10-15 10:49:37 +0200
committerJonas Smedegaard <dr@jones.dk>2010-10-15 10:49:37 +0200
commitf7bf137e51e94343661427d4828b1d8d9a879d6b (patch)
tree80672f9552c8de5e1a8ed379253b08d72005708e /localcsr
parent70c2ee2497dd94a4895da15bdfb5164c4a1e6b1c (diff)
Support non-DNS URN (e.g. for WebID).
Diffstat (limited to 'localcsr')
-rwxr-xr-xlocalcsr12
1 files changed, 9 insertions, 3 deletions
diff --git a/localcsr b/localcsr
index 9c13741..c50dd5d 100755
--- a/localcsr
+++ b/localcsr
@@ -1,6 +1,7 @@
#!/bin/sh
# csr.sh: Certificate Signing Request Generator
# Copyright(c) 2005 Evaldo Gardenali <evaldo@gardenali.biz>
+# Copyright(c) 2006, 2010 Jonas Smedegaard <dr@jones.dk>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -26,6 +27,7 @@
# ChangeLog:
# Mon May 23 00:14:37 BRT 2005 - evaldo - Initial Release
# Wed May 3 12:09:24 UTC 2006 - jonas - Drop $HOME, use current workdir
+# Fri Oct 15 10:44:10 CEST 2010 - jonas - Support non-DNS URN (e.g. for WebID)
#
# Original source: http://evaldo.gardenali.biz/cacert/csr
@@ -53,17 +55,21 @@ read HOST
printf "FQDN/CommonName (ie. www.example.com) : "
read COMMONNAME
-echo "Type SubjectAltNames for the certificate, one per line. Enter a blank line to finish"
+echo "Type SubjectAltNames for the certificate, one per line."
+echo "For normal dns URN type only hostname e.g. www.example.org"
+echo "Else type full URN e.g. uri:http://example.com/foaf.rdf#me"
+echo "Enter a blank line to finish"
SAN=1 # bogus value to begin the loop
SANAMES="" # sanitize
while [ ! "$SAN" = "" ]; do
printf "SubjectAltName: DNS:"
read SAN
if [ "$SAN" = "" ]; then break; fi # end of input
+ SAN=$(echo "$SAN" | perl -pe 's/^\s*([^:]+)$/DNS:$1/') #'
if [ "$SANAMES" = "" ]; then
- SANAMES="DNS:$SAN"
+ SANAMES="$SAN"
else
- SANAMES="$SANAMES,DNS:$SAN"
+ SANAMES="$SANAMES,$SAN"
fi
done