signedshot 0.1.2__tar.gz → 0.1.3__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.
@@ -1331,7 +1331,7 @@ dependencies = [
1331
1331
 
1332
1332
  [[package]]
1333
1333
  name = "signedshot-validator"
1334
- version = "0.1.2"
1334
+ version = "0.1.3"
1335
1335
  dependencies = [
1336
1336
  "anyhow",
1337
1337
  "base64",
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "signedshot-validator"
3
- version = "0.1.2"
3
+ version = "0.1.3"
4
4
  edition = "2021"
5
5
  description = "Validator for SignedShot media authenticity proofs"
6
6
  license = "MIT"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: signedshot
3
- Version: 0.1.2
3
+ Version: 0.1.3
4
4
  Classifier: Development Status :: 4 - Beta
5
5
  Classifier: Intended Audience :: Developers
6
6
  Classifier: License :: OSI Approved :: MIT License
@@ -4,7 +4,7 @@ build-backend = "maturin"
4
4
 
5
5
  [project]
6
6
  name = "signedshot"
7
- version = "0.1.2"
7
+ version = "0.1.3"
8
8
  description = "Validator for SignedShot media authenticity proofs"
9
9
  readme = "README.md"
10
10
  license = { text = "MIT" }
@@ -3,7 +3,8 @@ from signedshot.signedshot import (
3
3
  ValidationResult,
4
4
  validate,
5
5
  validate_files,
6
+ validate_with_jwks,
6
7
  )
7
8
 
8
- __all__ = ["ValidationResult", "validate", "validate_files"]
9
- __version__ = "0.1.0"
9
+ __all__ = ["ValidationResult", "validate", "validate_files", "validate_with_jwks"]
10
+ __version__ = "0.1.3"
@@ -82,6 +82,33 @@ def validate(sidecar_json: str, media_bytes: bytes) -> ValidationResult:
82
82
  """
83
83
  ...
84
84
 
85
+ def validate_with_jwks(
86
+ sidecar_json: str, media_bytes: bytes, jwks_json: str
87
+ ) -> ValidationResult:
88
+ """Validate a SignedShot sidecar against media content using pre-loaded JWKS.
89
+
90
+ Use this when you already have the JWKS available locally, avoiding HTTP fetch.
91
+ This is useful for API services that want to validate using their own keys.
92
+
93
+ Args:
94
+ sidecar_json: The sidecar JSON as a string
95
+ media_bytes: The media file content as bytes
96
+ jwks_json: The JWKS JSON as a string (from /.well-known/jwks.json)
97
+
98
+ Returns:
99
+ ValidationResult with detailed information about the validation
100
+
101
+ Raises:
102
+ ValueError: If the sidecar or JWKS cannot be parsed
103
+
104
+ Example:
105
+ >>> jwks_json = '{"keys": [...]}'
106
+ >>> result = validate_with_jwks(sidecar_json, media_bytes, jwks_json)
107
+ >>> if result.valid:
108
+ ... print(f"Publisher: {result.capture_trust['publisher_id']}")
109
+ """
110
+ ...
111
+
85
112
  def validate_files(sidecar_path: str, media_path: str) -> ValidationResult:
86
113
  """Validate a SignedShot sidecar from file paths.
87
114
 
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes