diff options
author | Alexander Sulfrian <alex@spline.inf.fu-berlin.de> | 2015-11-17 01:43:35 +0100 |
---|---|---|
committer | Alexander Sulfrian <alex@spline.inf.fu-berlin.de> | 2015-11-17 01:43:35 +0100 |
commit | b125d69848aaac1265b70b59aea3a4bcd37de54c (patch) | |
tree | 27b02383061e9cea91447211f8ff165ccfb3ead0 /pubkey | |
parent | 58d8d656e3e805888de2932ff58c71ba76e8027b (diff) | |
download | bcfg2-tools-b125d69848aaac1265b70b59aea3a4bcd37de54c.tar.gz bcfg2-tools-b125d69848aaac1265b70b59aea3a4bcd37de54c.tar.bz2 bcfg2-tools-b125d69848aaac1265b70b59aea3a4bcd37de54c.zip |
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.
Diffstat (limited to 'pubkey')
-rwxr-xr-x | pubkey | 27 |
1 files changed, 27 insertions, 0 deletions
@@ -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):/' |