File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22from cryptography .hazmat .primitives import hashes
33from cryptography .hazmat .backends import default_backend
44from cryptography .exceptions import InvalidKey , InvalidTag
5- from ed25519 import BadSignatureError
5+
6+
7+ from nacl .signing import VerifyKey
8+ from nacl .exceptions import BadSignatureError
9+
610import argparse
7- import ed25519
11+ # import ed25519
812import base64
913import json
1014import sys
4751
4852# Verify using Ed25519
4953try :
50- verify_key = ed25519 .VerifyingKey (
51- os .environ ['KEYGEN_PUBLIC_KEY' ].encode (),
52- encoding = 'hex' ,
54+ verify_key = VerifyKey (
55+ bytes .fromhex (os .environ ['KEYGEN_PUBLIC_KEY' ])
5356 )
5457
5558 verify_key .verify (
56- base64 .b64decode (sig ),
5759 ('license/%s' % enc ).encode (),
60+ base64 .b64decode (sig ),
5861 )
5962except (AssertionError , BadSignatureError ):
6063 print ('[error] verification failed!' )
Original file line number Diff line number Diff line change 11argparse
22cryptography
3- ed25519
3+ #ed25519
4+ pynacl
You can’t perform that action at this time.
0 commit comments