Skip to content

Instantly share code, notes, and snippets.

@koba-ninkigumi
Created September 24, 2012 02:02
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save koba-ninkigumi/3773813 to your computer and use it in GitHub Desktop.
Save koba-ninkigumi/3773813 to your computer and use it in GitHub Desktop.
How to make, show and verify binary signature with openssl.
自己署名証明書の作成
# Make key.pem and cert.pem
openssl req -new -days 365 -x509 -nodes -keyout key.pem -out cert.pem
証明書の内容の表示
# Show cert.pem
openssl x509 -text -noout < cert.pem
署名ファイルの作成
# Make signature
openssl smime -binary -sign -signer cert.pem -inkey key.pem -in manifest.json -out signature -outform DER
署名ファイルの内容の表示
# Show signature
openssl asn1parse -inform der -in signature
署名の検証
# Verify signature
openssl smime -verify -CAfile cert.pem -content manifest.json -in signature -inform DER
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment