From: <ul...@us...> - 2012-08-17 16:37:09
|
Revision: 87 http://adc.svn.sourceforge.net/adc/?rev=87&view=rev Author: ullner Date: 2012-08-17 16:37:03 +0000 (Fri, 17 Aug 2012) Log Message: ----------- Added keyprint generation (for KEYP) based on OpenSSL and Python. Modified Paths: -------------- trunk/Source/Python/bloom.py Added Paths: ----------- trunk/Source/scripts/ trunk/Source/scripts/keyp_keyprint_generation.sh trunk/Source/scripts/keyp_keyprint_generation_readme.txt Modified: trunk/Source/Python/bloom.py =================================================================== --- trunk/Source/Python/bloom.py 2012-07-16 19:55:49 UTC (rev 86) +++ trunk/Source/Python/bloom.py 2012-08-17 16:37:03 UTC (rev 87) @@ -1,5 +1,5 @@ from math import log, ceil -import base64, sys +import sys import base32 try: from bitarray import bitarray Added: trunk/Source/scripts/keyp_keyprint_generation.sh =================================================================== --- trunk/Source/scripts/keyp_keyprint_generation.sh (rev 0) +++ trunk/Source/scripts/keyp_keyprint_generation.sh 2012-08-17 16:37:03 UTC (rev 87) @@ -0,0 +1,3 @@ +#!/bin/sh + +openssl x509 -noout -fingerprint -sha256 < "$1" | cut -d '=' -f 2 | tr -d ":" | python -c "import sys; import base64; print base64.b32encode(base64.b16decode(sys.stdin.readline()))" | tr -d "=" \ No newline at end of file Added: trunk/Source/scripts/keyp_keyprint_generation_readme.txt =================================================================== --- trunk/Source/scripts/keyp_keyprint_generation_readme.txt (rev 0) +++ trunk/Source/scripts/keyp_keyprint_generation_readme.txt 2012-08-17 16:37:03 UTC (rev 87) @@ -0,0 +1,13 @@ +This bash script generates a keyprint of a particular certificate in Linux, as used in the KEYP extension. + +The script uses OpenSSL, filters all the verbosity OpenSSL adds and then uses Python to encode it into Base32. + +The script first calls OpenSSL to get the fingerprint then remove the verbosity and the colons convert with Python and remove any padding. + +How to use: +./keyp_keyprint_generation.sh file + +Where 'file' is the name and path of the certificate file. + +Example: +./keyp_keyprint_generation.sh /etc/adchpp/certs/cacert.pem \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |