From f7bf137e51e94343661427d4828b1d8d9a879d6b Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Fri, 15 Oct 2010 10:49:37 +0200 Subject: Support non-DNS URN (e.g. for WebID). --- localcsr | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'localcsr') 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 +# Copyright(c) 2006, 2010 Jonas Smedegaard # 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 -- cgit v1.2.3