ntrepid8 / ex_crypto

Wrapper around the Erlang crypto module for Elixir.
MIT License
150 stars 48 forks source link

feature/2018.03.13_add-fingerprint-1 #24

Closed ntrepid8 closed 6 years ago

ntrepid8 commented 6 years ago
ntrepid8 commented 6 years ago

@obrok what are you thoughts on updating the inspect output to include the SHA256 fingerprint?

#ExPublicKey.RSAPrivateKey<
     fingerprint_sha256=7a:40:1c:b9:4b:b8:a5:bb:6b:98:b6:1b:8b:7a:24:8d:45:9b:e5:54
      17:7e:66:26:7e:95:11:9d:39:14:7b:b2>

It also works for the public key struct:

#ExPublicKey.RSAPublicKey<
     fingerprint_sha256=7a:40:1c:b9:4b:b8:a5:bb:6b:98:b6:1b:8b:7a:24:8d:45:9b:e5:54
      17:7e:66:26:7e:95:11:9d:39:14:7b:b2>

I calculated the fingerprints so they would match a fingerprint generated by openssl as described in these AWS docs: