Skip to content

Instantly share code, notes, and snippets.

@kdkanishka
Forked from koba-ninkigumi/sign
Created January 13, 2021 08:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kdkanishka/31f0cd88608fb1d39027aa75e3fe4074 to your computer and use it in GitHub Desktop.
Save kdkanishka/31f0cd88608fb1d39027aa75e3fe4074 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