From b125d69848aaac1265b70b59aea3a4bcd37de54c Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Tue, 17 Nov 2015 01:43:35 +0100 Subject: show-req: Add utility to show pending siging requests Also adds "pubkey" to generate the pubkey of a private key for a certificate request at the DFN. --- pubkey | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100755 pubkey (limited to 'pubkey') diff --git a/pubkey b/pubkey new file mode 100755 index 0000000..4a6d781 --- /dev/null +++ b/pubkey @@ -0,0 +1,27 @@ +#!/bin/bash + +KEY=$1 +PASS=$2 + +declare -a ARGS +if [[ -n "$KEY" ]]; then + if [[ ! -r "$KEY" ]]; then + echo "Usage: $0 [KEY [PASSFILE]]" >&2 + exit 1 + fi + + ARGS+=("-in" "$KEY") +fi + +if [[ -n "$PASS" ]]; then + if [[ ! -r "$PASS" ]]; then + echo "Usage: $0 [KEY [PASSFILE]]" >&2 + exit 1 + fi + + ARGS+=("-passin" "file:$PASS") +fi + +openssl rsa "${ARGS[@]}" -pubout 2>/dev/null | \ + openssl rsa -pubin -noout -text | \ + sed -e '/Modulus:$/d;s/Public-Key: (\(.*\))/Modulus (\1):/' -- cgit v1.2.3-1-g7c22