Skip to content

Instantly share code, notes, and snippets.

View hanlsin's full-sized avatar
🧨
Step on a mine

Aaron (Yun Woo) Park hanlsin

🧨
Step on a mine
View GitHub Profile
@hanlsin
hanlsin / test_es512.py
Last active October 29, 2021 05:13
Test how to sign and verify message using private/public key pem of ES512 (Secp521r1)
import json
from cryptography.hazmat.primitives import hashes, serialization
from cryptography.hazmat.primitives.asymmetric import ec
from datetime import datetime
signing_key_pem = """-----BEGIN PRIVATE KEY-----
MIHuAgEAMBAGByqGSM49AgEGBSuBBAAjBIHWMIHTAgEBBEIBkiSDzU6KHLoOpMeo
GK/XkJzLhU2xzi3SKl9sXtQXrjTz8dDuLVSTuw76h1PDdzJWmAHmUQTUrNizD/ms
lEZhWxyhgYkDgYYABAGvrsUqZtjKo7bTTuOwTqJjeajLxO8671CA9DN/Dm4tIz6W
qvP/cvNmAMOWZDQ8VMJKdyBJl7TZ4vsE7hgHhzrtigD8HvHkCecYcVPAw27HsxnC

Keybase proof

I hereby claim:

  • I am hanlsin on github.
  • I am yunwpark (https://keybase.io/yunwpark) on keybase.
  • I have a public key ASDWlYkth3eiCEH-0AMf9qt3_rZmN44VbuGfoqew8UZ9Jwo

To claim this, I am signing this object: