summaryrefslogtreecommitdiff
path: root/testing/hosts/winnetou/etc/openssl/generate-hash-and-url
blob: 08208ed6544b7dbbc31b95678fdcc923531cb8e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#! /bin/bash
#
# generates the SHA-1 hash required by the RFC 4306 
# HASH_AND_URL certificate fetching scheme
#

for cert in $@
do
  openssl x509 -in $cert -outform der -out cert.der
  hash=`sha1sum cert.der | awk '{ print $1 }'`
  cp cert.der "$hash"
done
rm cert.der