Last active
August 14, 2019 20:01
-
-
Save s4parke/b632921e1f13fb0297298dc325d179ab to your computer and use it in GitHub Desktop.
Server-side commands to create digital signature for image
This file contains hidden or 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
# Make a hash of the image data | |
openssl dgst -sha256 wreckage.jpg > digest.txt | |
# Make a hash of DC metadata from XMP sidecar file | |
xml sel -N dc="http://purl.org/dc/elements/1.1/" -t -m "//dc:title" -c . -m "//dc:creator" -c . -m "//dc:description" -c . -n gator-meta.jpg.xml | openssl dgst -sha256 >> digest.txt | |
# Sign and base64 encode the digest | |
openssl rsautl -sign -inkey private_key.pem -keyform PEM -in digest.txt | base64 > signature | |
# Put the signature into the XMP sidecar file | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment