swarmauri_signing_ecdsa 0.3.0.dev45__tar.gz → 0.11.0.dev1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,24 +1,26 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: swarmauri_signing_ecdsa
3
- Version: 0.3.0.dev45
3
+ Version: 0.11.0.dev1
4
4
  Summary: ECDSA-based signer for Swarmauri
5
5
  License-Expression: Apache-2.0
6
6
  License-File: LICENSE
7
7
  Keywords: swarmauri,signing,ecdsa,elliptic-curve,cryptography,sdk,standards,digital-signature,signature-algorithm,nist-curves,key-formats
8
8
  Author: Jacob Stewart
9
9
  Author-email: jacob@swarmauri.com
10
- Requires-Python: >=3.10,<3.13
10
+ Requires-Python: >=3.10,<3.15
11
11
  Classifier: Development Status :: 1 - Planning
12
12
  Classifier: License :: OSI Approved :: Apache Software License
13
13
  Classifier: Natural Language :: English
14
+ Classifier: Topic :: Security :: Cryptography
15
+ Classifier: Intended Audience :: Developers
14
16
  Classifier: Programming Language :: Python
15
17
  Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3 :: Only
16
19
  Classifier: Programming Language :: Python :: 3.10
17
20
  Classifier: Programming Language :: Python :: 3.11
18
21
  Classifier: Programming Language :: Python :: 3.12
19
- Classifier: Topic :: Security :: Cryptography
20
- Classifier: Intended Audience :: Developers
21
- Classifier: Programming Language :: Python :: 3 :: Only
22
+ Classifier: Programming Language :: Python :: 3.13
23
+ Classifier: Programming Language :: Python :: 3.14
22
24
  Provides-Extra: cbor
23
25
  Requires-Dist: cbor2 ; extra == "cbor"
24
26
  Requires-Dist: cryptography
@@ -29,23 +31,21 @@ Project-URL: Homepage, https://github.com/swarmauri/swarmauri-sdk
29
31
  Project-URL: Source, https://github.com/swarmauri/swarmauri-sdk/tree/main/pkgs/standards/swarmauri_signing_ecdsa
30
32
  Description-Content-Type: text/markdown
31
33
 
32
- ![Swarmauri Logo](https://github.com/swarmauri/swarmauri-sdk/blob/3d4d1cfa949399d7019ae9d8f296afba773dfb7f/assets/swarmauri.brand.theme.svg)
33
-
34
+ ![Swarmauri Logo](https://raw.githubusercontent.com/swarmauri/swarmauri-sdk/master/assets/swarmauri_sdk_brand.png)
34
35
 
35
36
  <p align="center">
36
- <a href="https://pypi.org/project/swarmauri_signing_ecdsa/">
37
- <img src="https://img.shields.io/pypi/dm/swarmauri_signing_ecdsa" alt="PyPI - Downloads"/></a>
37
+ <a href="https://pepy.tech/project/swarmauri_signing_ecdsa/">
38
+ <img src="https://static.pepy.tech/badge/swarmauri_signing_ecdsa/month" alt="PyPI - Downloads"/></a>
38
39
  <a href="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/standards/swarmauri_signing_ecdsa/">
39
40
  <img alt="Hits" src="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/standards/swarmauri_signing_ecdsa.svg"/></a>
40
41
  <a href="https://pypi.org/project/swarmauri_signing_ecdsa/">
41
- <img src="https://img.shields.io/pypi/pyversions/swarmauri_signing_ecdsa" alt="PyPI - Python Version"/></a>
42
+ <img src="https://img.shields.io/badge/python-3.10%20%7C%203.11%20%7C%203.12%20%7C%203.13%20%7C%203.14-blue" alt="PyPI - Python Version"/></a>
42
43
  <a href="https://pypi.org/project/swarmauri_signing_ecdsa/">
43
44
  <img src="https://img.shields.io/pypi/l/swarmauri_signing_ecdsa" alt="PyPI - License"/></a>
44
45
  <a href="https://pypi.org/project/swarmauri_signing_ecdsa/">
45
46
  <img src="https://img.shields.io/pypi/v/swarmauri_signing_ecdsa?label=swarmauri_signing_ecdsa&color=green" alt="PyPI - swarmauri_signing_ecdsa"/></a>
46
- </p>
47
-
48
- ---
47
+ <a href="https://discord.gg/N4UpBuQv8T">
48
+ <img src="https://img.shields.io/badge/Discord-Join%20Chat-5865F2?logo=discord&logoColor=white" alt="Discord"/></a></p>
49
49
 
50
50
  # Swarmauri Signing ECDSA
51
51
 
@@ -149,3 +149,5 @@ The signer registers under the `swarmauri.signings` entry point as
149
149
  If you want to contribute to swarmauri-sdk, read up on our
150
150
  [guidelines for contributing](https://github.com/swarmauri/swarmauri-sdk/blob/master/CONTRIBUTING.md)
151
151
  that will help you get started.
152
+
153
+
@@ -1,20 +1,18 @@
1
- ![Swarmauri Logo](https://github.com/swarmauri/swarmauri-sdk/blob/3d4d1cfa949399d7019ae9d8f296afba773dfb7f/assets/swarmauri.brand.theme.svg)
2
-
1
+ ![Swarmauri Logo](https://raw.githubusercontent.com/swarmauri/swarmauri-sdk/master/assets/swarmauri_sdk_brand.png)
3
2
 
4
3
  <p align="center">
5
- <a href="https://pypi.org/project/swarmauri_signing_ecdsa/">
6
- <img src="https://img.shields.io/pypi/dm/swarmauri_signing_ecdsa" alt="PyPI - Downloads"/></a>
4
+ <a href="https://pepy.tech/project/swarmauri_signing_ecdsa/">
5
+ <img src="https://static.pepy.tech/badge/swarmauri_signing_ecdsa/month" alt="PyPI - Downloads"/></a>
7
6
  <a href="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/standards/swarmauri_signing_ecdsa/">
8
7
  <img alt="Hits" src="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/standards/swarmauri_signing_ecdsa.svg"/></a>
9
8
  <a href="https://pypi.org/project/swarmauri_signing_ecdsa/">
10
- <img src="https://img.shields.io/pypi/pyversions/swarmauri_signing_ecdsa" alt="PyPI - Python Version"/></a>
9
+ <img src="https://img.shields.io/badge/python-3.10%20%7C%203.11%20%7C%203.12%20%7C%203.13%20%7C%203.14-blue" alt="PyPI - Python Version"/></a>
11
10
  <a href="https://pypi.org/project/swarmauri_signing_ecdsa/">
12
11
  <img src="https://img.shields.io/pypi/l/swarmauri_signing_ecdsa" alt="PyPI - License"/></a>
13
12
  <a href="https://pypi.org/project/swarmauri_signing_ecdsa/">
14
13
  <img src="https://img.shields.io/pypi/v/swarmauri_signing_ecdsa?label=swarmauri_signing_ecdsa&color=green" alt="PyPI - swarmauri_signing_ecdsa"/></a>
15
- </p>
16
-
17
- ---
14
+ <a href="https://discord.gg/N4UpBuQv8T">
15
+ <img src="https://img.shields.io/badge/Discord-Join%20Chat-5865F2?logo=discord&logoColor=white" alt="Discord"/></a></p>
18
16
 
19
17
  # Swarmauri Signing ECDSA
20
18
 
@@ -117,4 +115,5 @@ The signer registers under the `swarmauri.signings` entry point as
117
115
 
118
116
  If you want to contribute to swarmauri-sdk, read up on our
119
117
  [guidelines for contributing](https://github.com/swarmauri/swarmauri-sdk/blob/master/CONTRIBUTING.md)
120
- that will help you get started.
118
+ that will help you get started.
119
+
@@ -1,10 +1,10 @@
1
1
  [project]
2
2
  name = "swarmauri_signing_ecdsa"
3
- version = "0.3.0.dev45"
3
+ version = "0.11.0.dev1"
4
4
  description = "ECDSA-based signer for Swarmauri"
5
5
  license = "Apache-2.0"
6
6
  readme = "README.md"
7
- requires-python = ">=3.10,<3.13"
7
+ requires-python = ">=3.10,<3.15"
8
8
  authors = [{ name = "Jacob Stewart", email = "jacob@swarmauri.com" }]
9
9
  keywords = [
10
10
  "swarmauri",
@@ -23,14 +23,16 @@ classifiers = [
23
23
  "Development Status :: 1 - Planning",
24
24
  "License :: OSI Approved :: Apache Software License",
25
25
  "Natural Language :: English",
26
+ "Topic :: Security :: Cryptography",
27
+ "Intended Audience :: Developers",
26
28
  "Programming Language :: Python",
27
29
  "Programming Language :: Python :: 3",
30
+ "Programming Language :: Python :: 3 :: Only",
28
31
  "Programming Language :: Python :: 3.10",
29
32
  "Programming Language :: Python :: 3.11",
30
33
  "Programming Language :: Python :: 3.12",
31
- "Topic :: Security :: Cryptography",
32
- "Intended Audience :: Developers",
33
- "Programming Language :: Python :: 3 :: Only",
34
+ "Programming Language :: Python :: 3.13",
35
+ "Programming Language :: Python :: 3.14",
34
36
  ]
35
37
  dependencies = [
36
38
  "swarmauri_core",
@@ -39,7 +39,10 @@ except Exception: # pragma: no cover - runtime check
39
39
  def _require_crypto() -> None:
40
40
  if not _CRYPTO_OK:
41
41
  raise RuntimeError(
42
- "EcdsaEnvelopeSigner requires 'cryptography'. Install with: pip install cryptography"
42
+ (
43
+ "EcdsaEnvelopeSigner requires 'cryptography'. Install with: "
44
+ "pip install cryptography"
45
+ )
43
46
  )
44
47
 
45
48
 
@@ -89,7 +92,9 @@ def _keyref_to_ec_private(key: KeyRef) -> ec.EllipticCurvePrivateKey:
89
92
  if isinstance(data, str):
90
93
  data = data.encode("utf-8")
91
94
  if not isinstance(data, (bytes, bytearray)):
92
- raise TypeError("KeyRef 'pem' expects 'priv' or 'data' bytes/str.")
95
+ raise TypeError(
96
+ "KeyRef 'pem' expects 'priv' or 'data' bytes/str."
97
+ )
93
98
  password = key.get("password")
94
99
  if isinstance(password, str):
95
100
  password = password.encode("utf-8")
@@ -99,7 +104,8 @@ def _keyref_to_ec_private(key: KeyRef) -> ec.EllipticCurvePrivateKey:
99
104
 
100
105
  def _public_key_id_ec(pk: ec.EllipticCurvePublicKey) -> str:
101
106
  spki = pk.public_bytes(
102
- serialization.Encoding.DER, serialization.PublicFormat.SubjectPublicKeyInfo
107
+ serialization.Encoding.DER,
108
+ serialization.PublicFormat.SubjectPublicKeyInfo,
103
109
  )
104
110
  return hashlib.sha256(spki).hexdigest()
105
111
 
@@ -120,7 +126,10 @@ def _gather_ec_pubkeys(
120
126
  if isinstance(item, ec.EllipticCurvePublicKey):
121
127
  if item.curve.name != expected_curve.name:
122
128
  raise ValueError(
123
- f"Curve mismatch: want {expected_curve.name}, got {item.curve.name}"
129
+ (
130
+ f"Curve mismatch: want {expected_curve.name}, got "
131
+ f"{item.curve.name}"
132
+ )
124
133
  )
125
134
  pubs.append(item)
126
135
  elif isinstance(item, (bytes, bytearray)):
@@ -129,7 +138,10 @@ def _gather_ec_pubkeys(
129
138
  raise TypeError("PEM is not an EC public key.")
130
139
  if pk.curve.name != expected_curve.name:
131
140
  raise ValueError(
132
- f"Curve mismatch: want {expected_curve.name}, got {pk.curve.name}"
141
+ (
142
+ f"Curve mismatch: want {expected_curve.name}, got "
143
+ f"{pk.curve.name}"
144
+ )
133
145
  )
134
146
  pubs.append(pk)
135
147
  elif isinstance(item, str):
@@ -138,7 +150,10 @@ def _gather_ec_pubkeys(
138
150
  raise TypeError("PEM is not an EC public key.")
139
151
  if pk.curve.name != expected_curve.name:
140
152
  raise ValueError(
141
- f"Curve mismatch: want {expected_curve.name}, got {pk.curve.name}"
153
+ (
154
+ f"Curve mismatch: want {expected_curve.name}, got "
155
+ f"{pk.curve.name}"
156
+ )
142
157
  )
143
158
  pubs.append(pk)
144
159
  elif isinstance(item, dict) and item.get("kty") == "EC":
@@ -212,7 +227,9 @@ class EcdsaEnvelopeSigner(SigningBase):
212
227
  )
213
228
  sig_der = sk.sign(payload, ec.ECDSA(h))
214
229
  kid = _public_key_id_ec(sk.public_key())
215
- return [_Sig({"alg": token, "kid": kid, "sig": sig_der, "sigfmt": "DER"})]
230
+ return [
231
+ _Sig({"alg": token, "kid": kid, "sig": sig_der, "sigfmt": "DER"})
232
+ ]
216
233
 
217
234
  async def verify_bytes(
218
235
  self,
@@ -284,7 +301,9 @@ class EcdsaEnvelopeSigner(SigningBase):
284
301
  require: Optional[Mapping[str, object]] = None,
285
302
  opts: Optional[Mapping[str, object]] = None,
286
303
  ) -> bool:
287
- return await self.verify_bytes(digest, signatures, require=require, opts=opts)
304
+ return await self.verify_bytes(
305
+ digest, signatures, require=require, opts=opts
306
+ )
288
307
 
289
308
  async def canonicalize_envelope(
290
309
  self,
@@ -321,7 +340,9 @@ class EcdsaEnvelopeSigner(SigningBase):
321
340
  opts: Optional[Mapping[str, object]] = None,
322
341
  ) -> bool:
323
342
  payload = await self.canonicalize_envelope(env, canon=canon, opts=opts)
324
- return await self.verify_bytes(payload, signatures, require=require, opts=opts)
343
+ return await self.verify_bytes(
344
+ payload, signatures, require=require, opts=opts
345
+ )
325
346
 
326
347
 
327
348
  def _raw_lengths_for_curve(curve: ec.EllipticCurve) -> set[int]: