summaryrefslogtreecommitdiffstats
path: root/cert2curlpub
diff options
context:
space:
mode:
Diffstat (limited to 'cert2curlpub')
-rwxr-xr-xcert2curlpub4
1 files changed, 4 insertions, 0 deletions
diff --git a/cert2curlpub b/cert2curlpub
new file mode 100755
index 0000000..81bd07d
--- /dev/null
+++ b/cert2curlpub
@@ -0,0 +1,4 @@
+#!/bin/bash
+
+hash=$(sed -n '/-----BEGIN/,/-----END/p' | openssl x509 -noout -pubkey | openssl rsa -noout -pubin -outform DER | openssl dgst -sha256 -binary | openssl enc -base64)
+echo "sha256//$hash"