- #!/bin/bash
- #modulus="f357fd12f0287bd924ae74d602136d1b50565bc764d591d42f1866200bd671034df1e6b253d63e12046ad0b558d69bd422b7f8248723465c9bb771285659b4c9dc9f7070079134dab01f013e772322334cd72f10156243859cd6444ef1609496772b94928970ffb7e2957ae483c72a36dd223ebf9cf1eb95ff5b03f959676baab18c2aefa0c523f711775cbba872793cb35249f5ab69b248f4e6d73807afb920d2b44d616bde4ab42e0f7aa412d3ab719c55ee37c4bd0192cbcac055c80665b655d5776b014ef53d872639dfdb4e62109aa839771936bd0cb5b79e5bfb5f6deb71bbf28b165ba5091a0a4f3703e0c946be379e2f6dc39e74271d439ceb531bc206bbe0b85ff34e22667df2d5b7401e192f41e327b1a7a8f6f2d36cc757fc64e7094996462b133ece8c4c376689f72223f0258365cf987c985d279adf3e2b20fcc0978f171330ab0a596f713033c1ca22230a72bf00997e81c86e6602d9a2d694ae95418d1f5e6a32d6f946252d9366d2e925d915178f6543f6fd23fb82a883ae"
- #echo -n $modulus | xxd -r -p | openssl dgst -sha256
- #Extract modulus from private key
- modulus_bigendian=$(openssl rsa -noout -modulus -in $1 | cut -d'=' -f2)
- modulus_littleendian=$(printf %s "$modulus_bigendian" | dd conv=swab 2> /dev/null | rev)
- echo -n $modulus_littleendian | xxd -r -p | openssl dgst -sha256
|