aboutsummaryrefslogtreecommitdiff
path: root/frozen_deps/Cryptodome/PublicKey/__init__.py
diff options
context:
space:
mode:
authorDeterminant <[email protected]>2022-11-17 18:08:59 -0800
committerDeterminant <[email protected]>2022-11-17 18:08:59 -0800
commit8154806fe2fccacdc3dafaa68181a07bcf8d6c4c (patch)
treef477e6a005599bb88c18db142c267b9297c6060b /frozen_deps/Cryptodome/PublicKey/__init__.py
parentbe4dc086591c9bced04a507d127c83811c5700c4 (diff)
v0.1.7
Diffstat (limited to 'frozen_deps/Cryptodome/PublicKey/__init__.py')
-rw-r--r--frozen_deps/Cryptodome/PublicKey/__init__.py17
1 files changed, 8 insertions, 9 deletions
diff --git a/frozen_deps/Cryptodome/PublicKey/__init__.py b/frozen_deps/Cryptodome/PublicKey/__init__.py
index 4d019bf..99b67a4 100644
--- a/frozen_deps/Cryptodome/PublicKey/__init__.py
+++ b/frozen_deps/Cryptodome/PublicKey/__init__.py
@@ -60,17 +60,16 @@ def _expand_subject_public_key_info(encoded):
return algo_oid.value, spk, algo_params
-def _create_subject_public_key_info(algo_oid, secret_key, params=None):
+def _create_subject_public_key_info(algo_oid, public_key, params):
if params is None:
- params = DerNull()
-
- spki = DerSequence([
- DerSequence([
- DerObjectId(algo_oid),
- params]),
- DerBitString(secret_key)
- ])
+ algorithm = DerSequence([DerObjectId(algo_oid)])
+ else:
+ algorithm = DerSequence([DerObjectId(algo_oid), params])
+
+ spki = DerSequence([algorithm,
+ DerBitString(public_key)
+ ])
return spki.encode()