Created
February 26, 2016 19:48
-
-
Save kgaughan/f86122d1687bea43c7dd to your computer and use it in GitHub Desktop.
Generate SHA256 hash for a given cert chain for use in a TLSA (DANE) record
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
extract() { | |
openssl x509 -in $1 -noout -pubkey | openssl rsa -pubin -outform DER | |
} | |
digest() { | |
openssl dgst -sha256 -hex | |
} | |
extract $1 | digest |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment