|
@@ -2,6 +2,7 @@
|
|
|
|
|
|
import cryptography.hazmat.backends
|
|
|
import cryptography.hazmat.primitives.serialization
|
|
|
+import cryptography.x509
|
|
|
import math
|
|
|
import sys
|
|
|
|
|
@@ -10,13 +11,11 @@ backend = cryptography.hazmat.backends.default_backend()
|
|
|
with open('smartcard-app-id.hex', 'r') as f:
|
|
|
appid = int(f.read(), 16)
|
|
|
|
|
|
-with open('pub.pem', 'rb') as f:
|
|
|
- pubkey = cryptography.hazmat.primitives.serialization.load_pem_public_key(
|
|
|
- f.read(),
|
|
|
- backend,
|
|
|
- )
|
|
|
+with open('cert-request.pem', 'rb') as f:
|
|
|
+ req = cryptography.x509.load_pem_x509_csr(f.read(), backend)
|
|
|
+assert req.is_signature_valid
|
|
|
|
|
|
-pubnums = pubkey.public_numbers()
|
|
|
+pubnums = req.public_key().public_numbers()
|
|
|
|
|
|
key_data = ['shadowed-private-key', [
|
|
|
'rsa',
|