We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9ab417c commit 57f91a5Copy full SHA for 57f91a5
pkcs11/util/x509.py
@@ -2,6 +2,7 @@
2
Certificate handling utilities for X.509 (SSL) certificates.
3
"""
4
5
+from asn1crypto.core import OctetString
6
from asn1crypto.x509 import Certificate
7
8
from pkcs11.constants import Attribute, CertificateType, ObjectClass
@@ -55,6 +56,10 @@ def decode_x509_public_key(der):
55
56
elif key_type is KeyType.EC:
57
params = key_info["algorithm"]["parameters"].dump()
58
59
+ # bytes(key_info['public_key']) returns the binary encoding
60
+ # of the EC point itself (decoded from its BitString representation in X.509),
61
+ # but PKCS#11 expects this as a DER OctetString.
62
+ key = OctetString(key).dump()
63
attrs.update(
64
{
65
Attribute.EC_PARAMS: params,
0 commit comments