python-nss-ng 1.3.5__tar.gz → 1.3.7__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.
Files changed (102) hide show
  1. python_nss_ng-1.3.7/.git_archival.txt +4 -0
  2. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/Makefile +4 -4
  3. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/PKG-INFO +1 -1
  4. python_nss_ng-1.3.7/_version.txt +1 -0
  5. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/doc/MAKEFILE_MIGRATION.md +2 -2
  6. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/pyproject.toml +3 -4
  7. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/src/deprecations.py +2 -3
  8. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/src/io.pyi +12 -12
  9. {python_nss_ng-1.3.5/typings/nss → python_nss_ng-1.3.7/src}/nss.pyi +61 -60
  10. {python_nss_ng-1.3.5/typings/nss → python_nss_ng-1.3.7/src}/ssl.pyi +10 -9
  11. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/test/exceptions.py +1 -1
  12. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/test/test_platform_specific.py +4 -9
  13. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/test/test_type_hints.py +0 -1
  14. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/typings/nss/deprecations.py +2 -3
  15. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/typings/nss/error.pyi +3 -3
  16. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/typings/nss/io.pyi +12 -12
  17. {python_nss_ng-1.3.5/src → python_nss_ng-1.3.7/typings/nss}/nss.pyi +61 -60
  18. {python_nss_ng-1.3.5/src → python_nss_ng-1.3.7/typings/nss}/ssl.pyi +10 -9
  19. python_nss_ng-1.3.5/.git_archival.txt +0 -4
  20. python_nss_ng-1.3.5/_version.txt +0 -1
  21. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/.aislop/config.yml +0 -0
  22. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/.clangd +0 -0
  23. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/AGENTS.md +0 -0
  24. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/CONTRIBUTING.md +0 -0
  25. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/LICENSE +0 -0
  26. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/LICENSE.gpl +0 -0
  27. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/LICENSE.lgpl +0 -0
  28. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/LICENSE.mpl +0 -0
  29. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/LICENSES/Apache-2.0.txt +0 -0
  30. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/LICENSES/MPL-2.0.txt +0 -0
  31. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/MANIFEST.in +0 -0
  32. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/QUICKSTART.md +0 -0
  33. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/README.md +0 -0
  34. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/REUSE.toml +0 -0
  35. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/SECURITY.md +0 -0
  36. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/doc/ChangeLog +0 -0
  37. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/doc/MANYLINUX_CONFIG.md +0 -0
  38. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/doc/MIGRATION.md +0 -0
  39. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/doc/MUTATION_TESTING.md +0 -0
  40. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/doc/TESTING.md +0 -0
  41. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/doc/examples/cert_dump.py +0 -0
  42. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/doc/examples/cert_trust.py +0 -0
  43. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/doc/examples/httplib_example.py +0 -0
  44. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/doc/examples/pbkdf2_example.py +0 -0
  45. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/doc/examples/ssl_cipher_info.py +0 -0
  46. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/doc/examples/ssl_example.py +0 -0
  47. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/doc/examples/ssl_version_range.py +0 -0
  48. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/doc/examples/verify_cert.py +0 -0
  49. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/doc/examples/verify_server.py +0 -0
  50. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/doc/get_api +0 -0
  51. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/meson.build +0 -0
  52. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/scripts/README.md +0 -0
  53. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/scripts/meson-version.py +0 -0
  54. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/scripts/run-all-tests.sh +0 -0
  55. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/src/NSPRerrs.h +0 -0
  56. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/src/SECerrs.h +0 -0
  57. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/src/SSLerrs.h +0 -0
  58. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/src/__init__.py +0 -0
  59. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/src/nss_context.py +0 -0
  60. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/src/py_nspr_common.h +0 -0
  61. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/src/py_nspr_error.c +0 -0
  62. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/src/py_nspr_error.h +0 -0
  63. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/src/py_nspr_io.c +0 -0
  64. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/src/py_nspr_io.h +0 -0
  65. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/src/py_nss.c +0 -0
  66. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/src/py_nss.h +0 -0
  67. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/src/py_shared_doc.h +0 -0
  68. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/src/py_ssl.c +0 -0
  69. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/src/py_ssl.h +0 -0
  70. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/src/py_traceback.h +0 -0
  71. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/src/secure_logging.py +0 -0
  72. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/test/conftest.py +0 -0
  73. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/test/run_tests +0 -0
  74. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/test/setup_certs.py +0 -0
  75. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/test/test_cert_components.py +0 -0
  76. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/test/test_cert_request.py +0 -0
  77. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/test/test_certificate_advanced.py +0 -0
  78. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/test/test_cipher.py +0 -0
  79. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/test/test_client_server.py +0 -0
  80. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/test/test_deprecations.py +0 -0
  81. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/test/test_digest.py +0 -0
  82. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/test/test_documentation_accuracy.py +0 -0
  83. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/test/test_error_refleaks.py +0 -0
  84. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/test/test_examples.py +0 -0
  85. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/test/test_misc.py +0 -0
  86. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/test/test_performance.py +0 -0
  87. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/test/test_pkcs12.py +0 -0
  88. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/test/test_property_based.py +0 -0
  89. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/test/test_secure_logging.py +0 -0
  90. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/test/test_security.py +0 -0
  91. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/test/test_thread_safety.py +0 -0
  92. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/test/test_util.py +0 -0
  93. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/test/test_zzz_error_messages.py +0 -0
  94. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/test/test_zzz_integration.py +0 -0
  95. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/test/test_zzz_nonexistent_certs.py +0 -0
  96. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/test/test_zzz_nss_context.py +0 -0
  97. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/test/test_zzz_ocsp.py +0 -0
  98. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/test/util.py +0 -0
  99. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/typings/nss/__init__.pyi +0 -0
  100. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/typings/nss/nss_context.py +0 -0
  101. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/typings/nss/secure_logging.py +0 -0
  102. {python_nss_ng-1.3.5 → python_nss_ng-1.3.7}/uv.lock +0 -0
@@ -0,0 +1,4 @@
1
+ node: ddf1f0561c6de0c301489f13c854314d6a1cca2a
2
+ node-date: 2026-11-17T23:47:11Z
3
+ describe-name: v1.3.7
4
+ ref-names: grafted, HEAD, tag: v1.3.7, origin/main, origin/HEAD
@@ -21,13 +21,13 @@ help:
21
21
  @echo " clean - Clean build artifacts"
22
22
  @echo ""
23
23
  @echo "Environment variables:"
24
- @echo " NSS_VERSION - NSS version (default: 3.118)"
25
- @echo " NSPR_VERSION - NSPR version (default: 4.37)"
24
+ @echo " NSS_VERSION - NSS version (default: 3.133)"
25
+ @echo " NSPR_VERSION - NSPR version (default: 4.39)"
26
26
  @echo " INSTALL_PREFIX - Install prefix (default: /usr)"
27
27
 
28
28
  # Configuration
29
- NSS_VERSION ?= 3.118
30
- NSPR_VERSION ?= 4.37
29
+ NSS_VERSION ?= 3.133
30
+ NSPR_VERSION ?= 4.39
31
31
  INSTALL_PREFIX ?= /usr
32
32
  PKG_CONFIG_PATH := $(INSTALL_PREFIX)/lib/pkgconfig:$(PKG_CONFIG_PATH)
33
33
  LD_LIBRARY_PATH := $(INSTALL_PREFIX)/lib:$(LD_LIBRARY_PATH)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-nss-ng
3
- Version: 1.3.5
3
+ Version: 1.3.7
4
4
  Summary: Python bindings for Network Security Services (NSS) and Netscape Portable Runtime (NSPR)
5
5
  Keywords: nss,nspr,cryptography,ssl,tls,pki,x509,security
6
6
  Author-Email: John Dennis <jdennis@redhat.com>, Matthew Watkins <mwatkins@linuxfoundation.org>
@@ -0,0 +1 @@
1
+ 1.3.7
@@ -58,8 +58,8 @@ Created identical Makefiles for both repositories with the following targets:
58
58
  **Configuration Variables:**
59
59
 
60
60
  ```makefile
61
- NSS_VERSION ?= 3.118
62
- NSPR_VERSION ?= 4.37
61
+ NSS_VERSION ?= 3.133
62
+ NSPR_VERSION ?= 4.39
63
63
  INSTALL_PREFIX ?= /usr
64
64
  ```
65
65
 
@@ -176,9 +176,6 @@ ignore = [
176
176
  "C901", # too complex
177
177
  "S101", # assert detected (allow in tests)
178
178
  "T201", # print found (intentional in examples)
179
- "UP006", # Use `X` instead of `typing.X` for type annotations (Python 3.10 compat)
180
- "UP007", # Use `X | Y` for union types (Python 3.10 compat)
181
- "UP035", # Import from `typing` is deprecated (Python 3.10 compat)
182
179
  ]
183
180
 
184
181
  [tool.ruff.lint.per-file-ignores]
@@ -247,7 +244,9 @@ ignore = [
247
244
  "UP024", # replace aliased exceptions with builtins
248
245
  "UP032", # use f-string instead of format
249
246
  ]
250
- "test/setup_certs.py" = ["S603", "S607"] # Allow subprocess calls in cert setup
247
+ # Allow subprocess calls in cert setup. UP006/UP035 stay ignored here
248
+ # until someone can edit this executable file to use `list`/`tuple`.
249
+ "test/setup_certs.py" = ["S603", "S607", "UP006", "UP035"]
251
250
  # Build-time version helper that shells out to the trusted `git` binary.
252
251
  "scripts/meson-version.py" = ["S603", "S607"]
253
252
 
@@ -9,12 +9,11 @@ and utilities for emitting deprecation warnings.
9
9
  """
10
10
 
11
11
  import warnings
12
- from typing import Dict
13
12
 
14
13
  # Central registry of deprecated functionality
15
14
  # Key: deprecated symbol name
16
15
  # Value: replacement/migration guidance
17
- DEPRECATED_REGISTRY: Dict[str, str] = {
16
+ DEPRECATED_REGISTRY: dict[str, str] = {
18
17
  "io.NetworkAddress()": (
19
18
  "NetworkAddress initialization from a string parameter only works for IPv4. "
20
19
  "Use io.AddrInfo instead for proper IPv4/IPv6 support."
@@ -97,7 +96,7 @@ def get_deprecation_message(symbol_name: str) -> str | None:
97
96
  return DEPRECATED_REGISTRY.get(symbol_name)
98
97
 
99
98
 
100
- def list_deprecated() -> Dict[str, str]:
99
+ def list_deprecated() -> dict[str, str]:
101
100
  """
102
101
  Get a copy of the entire deprecation registry.
103
102
 
@@ -8,7 +8,7 @@ This file provides type hints for the C extension module nss.io (NSPR I/O).
8
8
  """
9
9
 
10
10
  import socket
11
- from typing import Any, List, Tuple, Union
11
+ from typing import Any
12
12
 
13
13
  # Time conversion utilities
14
14
  def seconds_to_interval(seconds: float) -> int:
@@ -126,7 +126,7 @@ class NetworkAddress:
126
126
 
127
127
  def __init__(
128
128
  self,
129
- addr: Union[str, int, Tuple[str, int], None] = None,
129
+ addr: str | int | tuple[str, int] | None = None,
130
130
  port: int = 0,
131
131
  family: int = PR_AF_INET,
132
132
  ) -> None:
@@ -190,16 +190,16 @@ class HostEntry:
190
190
  ...
191
191
 
192
192
  @property
193
- def aliases(self) -> List[str]:
193
+ def aliases(self) -> list[str]:
194
194
  """Get list of hostname aliases."""
195
195
  ...
196
196
 
197
197
  @property
198
- def addresses(self) -> List[NetworkAddress]:
198
+ def addresses(self) -> list[NetworkAddress]:
199
199
  """Get list of network addresses."""
200
200
  ...
201
201
 
202
- def get_network_addresses(self, family: int = PR_AF_INET) -> List[NetworkAddress]:
202
+ def get_network_addresses(self, family: int = PR_AF_INET) -> list[NetworkAddress]:
203
203
  """Get network addresses filtered by family."""
204
204
  ...
205
205
 
@@ -323,7 +323,7 @@ class Socket:
323
323
  """
324
324
  ...
325
325
 
326
- def accept(self, timeout: int | None = None) -> Tuple[Socket, NetworkAddress]:
326
+ def accept(self, timeout: int | None = None) -> tuple[Socket, NetworkAddress]:
327
327
  """
328
328
  Accept an incoming connection.
329
329
 
@@ -371,7 +371,7 @@ class Socket:
371
371
 
372
372
  def recvfrom(
373
373
  self, bufsize: int, flags: int = 0, timeout: int | None = None
374
- ) -> Tuple[bytes, NetworkAddress]:
374
+ ) -> tuple[bytes, NetworkAddress]:
375
375
  """
376
376
  Receive data and sender address (UDP).
377
377
 
@@ -435,7 +435,7 @@ class Socket:
435
435
  """Read a line from socket."""
436
436
  ...
437
437
 
438
- def readlines(self, sizehint: int = -1, timeout: int | None = None) -> List[bytes]:
438
+ def readlines(self, sizehint: int = -1, timeout: int | None = None) -> list[bytes]:
439
439
  """Read lines from socket."""
440
440
  ...
441
441
 
@@ -445,7 +445,7 @@ class Socket:
445
445
 
446
446
  def accept_read(
447
447
  self, buf_size: int = 4096, timeout: int | None = None
448
- ) -> Tuple[Socket, NetworkAddress, bytes]:
448
+ ) -> tuple[Socket, NetworkAddress, bytes]:
449
449
  """Accept connection and read data in one operation."""
450
450
  ...
451
451
 
@@ -454,14 +454,14 @@ class Socket:
454
454
  ...
455
455
 
456
456
  @staticmethod
457
- def new_tcp_pair() -> Tuple[Socket, Socket]:
457
+ def new_tcp_pair() -> tuple[Socket, Socket]:
458
458
  """Create a pair of connected TCP sockets."""
459
459
  ...
460
460
 
461
461
  @staticmethod
462
462
  def poll(
463
- poll_desc_list: List[Tuple[Socket, int, int]], timeout: int | None = None
464
- ) -> List[Tuple[Socket, int, int]]:
463
+ poll_desc_list: list[tuple[Socket, int, int]], timeout: int | None = None
464
+ ) -> list[tuple[Socket, int, int]]:
465
465
  """Poll multiple sockets for I/O events."""
466
466
  ...
467
467
 
@@ -7,7 +7,8 @@ Type stubs for nss.nss module.
7
7
  This file provides type hints for the C extension module nss.nss.
8
8
  """
9
9
 
10
- from typing import Any, Callable, List, Tuple, Union
10
+ from collections.abc import Callable
11
+ from typing import Any
11
12
 
12
13
  # Version information
13
14
  def nss_get_version() -> str:
@@ -58,11 +59,11 @@ def find_cert_from_nickname(nickname: str, *pin_args: Any) -> Certificate:
58
59
  """Find a certificate by its nickname."""
59
60
  ...
60
61
 
61
- def find_certs_from_nickname(nickname: str, *pin_args: Any) -> List[Certificate]:
62
+ def find_certs_from_nickname(nickname: str, *pin_args: Any) -> list[Certificate]:
62
63
  """Find all certificates with the given nickname."""
63
64
  ...
64
65
 
65
- def find_certs_from_email_addr(email: str, *pin_args: Any) -> List[Certificate]:
66
+ def find_certs_from_email_addr(email: str, *pin_args: Any) -> list[Certificate]:
66
67
  """Find certificates associated with an email address."""
67
68
  ...
68
69
 
@@ -70,7 +71,7 @@ def find_key_by_any_cert(cert: Certificate, *pin_args: Any) -> Any:
70
71
  """Find the private key associated with a certificate."""
71
72
  ...
72
73
 
73
- def get_cert_nicknames(certdb: Any, what: int, *user_data: Any) -> List[str]:
74
+ def get_cert_nicknames(certdb: Any, what: int, *user_data: Any) -> list[str]:
74
75
  """Get certificate nicknames from the database.
75
76
 
76
77
  Args:
@@ -117,7 +118,7 @@ def read_hex(hex_string: str, separator: str | None = None) -> bytes:
117
118
  """Convert hex string to bytes."""
118
119
  ...
119
120
 
120
- def oid_str(oid: Union[int, str, SecItem]) -> str:
121
+ def oid_str(oid: int | str | SecItem) -> str:
121
122
  """Get the string representation of an OID.
122
123
 
123
124
  ``oid`` may be an integer tag, a string (tag name, AVA
@@ -263,7 +264,7 @@ def get_internal_key_slot() -> PK11Slot:
263
264
 
264
265
  def get_all_tokens(
265
266
  mechanism: int = 0, need_rw: bool = False, load_certs: bool = False, *pin_args: Any
266
- ) -> List[PK11Slot]:
267
+ ) -> list[PK11Slot]:
267
268
  """Get all available tokens."""
268
269
  ...
269
270
 
@@ -289,7 +290,7 @@ def is_fips() -> bool:
289
290
 
290
291
  # Key and parameter operations
291
292
  def import_sym_key(
292
- slot: PK11Slot, mechanism: int, origin: int, operation: int, key_data: Union[bytes, SecItem]
293
+ slot: PK11Slot, mechanism: int, origin: int, operation: int, key_data: bytes | SecItem
293
294
  ) -> Any:
294
295
  """Import a symmetric key.
295
296
 
@@ -304,7 +305,7 @@ def pub_wrap_sym_key(mechanism: int, pub_key: Any, sym_key: Any) -> bytes:
304
305
 
305
306
  def param_from_iv(
306
307
  mechanism: int,
307
- iv: Union[bytes, SecItem, None] = None,
308
+ iv: bytes | SecItem | None = None,
308
309
  ) -> SecItem:
309
310
  """Create parameters from an initialization vector.
310
311
 
@@ -345,7 +346,7 @@ def get_pad_mechanism(mechanism: int) -> int:
345
346
  def data_to_hex(
346
347
  data: bytes,
347
348
  octets_per_line: int = 16,
348
- separator: Union[str, None] = ":",
349
+ separator: str | None = ":",
349
350
  ) -> str:
350
351
  """Convert binary data to hexadecimal string.
351
352
 
@@ -357,8 +358,8 @@ def data_to_hex(
357
358
 
358
359
  def make_line_fmt_tuples(
359
360
  level: int,
360
- *lines: Union[str, List[str], Tuple[str, ...]],
361
- ) -> List[Tuple[int, str]]:
361
+ *lines: str | list[str] | tuple[str, ...],
362
+ ) -> list[tuple[int, str]]:
362
363
  """Create formatted line tuples for indented output.
363
364
 
364
365
  Each positional ``lines`` argument may be a single string or a
@@ -367,7 +368,7 @@ def make_line_fmt_tuples(
367
368
  """
368
369
  ...
369
370
 
370
- def indented_format(tuples: List[Tuple[int, str]]) -> str:
371
+ def indented_format(tuples: list[tuple[int, str]]) -> str:
371
372
  """Format indented text from line tuples."""
372
373
  ...
373
374
 
@@ -379,7 +380,7 @@ def base64_to_binary(data: str) -> bytes:
379
380
  """Convert base64 string to binary data."""
380
381
  ...
381
382
 
382
- def fingerprint_format_lines(fingerprint: bytes, level: int = 0) -> List[Tuple[int, str]]:
383
+ def fingerprint_format_lines(fingerprint: bytes, level: int = 0) -> list[tuple[int, str]]:
383
384
  """Format fingerprint as indented lines."""
384
385
  ...
385
386
 
@@ -408,7 +409,7 @@ def pk11_disabled_reason_name(reason: int) -> str:
408
409
  """Get the name of a disabled reason."""
409
410
  ...
410
411
 
411
- def oid_tag_name(tag: Union[int, str, SecItem]) -> str:
412
+ def oid_tag_name(tag: int | str | SecItem) -> str:
412
413
  """Get the name of an OID tag.
413
414
 
414
415
  ``tag`` may be an integer tag value, a string (tag name, AVA
@@ -417,11 +418,11 @@ def oid_tag_name(tag: Union[int, str, SecItem]) -> str:
417
418
  """
418
419
  ...
419
420
 
420
- def oid_tag(oid: Union[str, SecItem]) -> int:
421
+ def oid_tag(oid: str | SecItem) -> int:
421
422
  """Get the tag for an OID."""
422
423
  ...
423
424
 
424
- def oid_dotted_decimal(oid: Union[int, str, SecItem]) -> str:
425
+ def oid_dotted_decimal(oid: int | str | SecItem) -> str:
425
426
  """Get the dotted decimal representation of an OID.
426
427
 
427
428
  ``oid`` may be an integer tag, a string (a tag name like
@@ -431,7 +432,7 @@ def oid_dotted_decimal(oid: Union[int, str, SecItem]) -> str:
431
432
  """
432
433
  ...
433
434
 
434
- def list_certs(certdb: Any, *user_data: Any) -> List[Certificate]:
435
+ def list_certs(certdb: Any, *user_data: Any) -> list[Certificate]:
435
436
  """List all certificates in the database."""
436
437
  ...
437
438
 
@@ -452,35 +453,35 @@ def cert_general_name_type_from_name(name: str) -> int:
452
453
  ...
453
454
 
454
455
  # Certificate and key usage flags
455
- def cert_usage_flags(usage: int) -> List[str]:
456
+ def cert_usage_flags(usage: int) -> list[str]:
456
457
  """Get list of certificate usage flag names."""
457
458
  ...
458
459
 
459
- def key_usage_flags(usage: int) -> List[str]:
460
+ def key_usage_flags(usage: int) -> list[str]:
460
461
  """Get list of key usage flag names."""
461
462
  ...
462
463
 
463
- def cert_type_flags(cert_type: int) -> List[str]:
464
+ def cert_type_flags(cert_type: int) -> list[str]:
464
465
  """Get list of certificate type flag names."""
465
466
  ...
466
467
 
467
- def nss_init_flags(flags: int) -> List[str]:
468
+ def nss_init_flags(flags: int) -> list[str]:
468
469
  """Get list of NSS init flag names."""
469
470
  ...
470
471
 
471
- def x509_key_usage(flags: int, repr_kind: int = 0) -> Union[str, List[str]]:
472
+ def x509_key_usage(flags: int, repr_kind: int = 0) -> str | list[str]:
472
473
  """Get X.509 key usage representation."""
473
474
  ...
474
475
 
475
- def x509_cert_type(flags: int, repr_kind: int = 0) -> Union[str, List[str]]:
476
+ def x509_cert_type(flags: int, repr_kind: int = 0) -> str | list[str]:
476
477
  """Get X.509 certificate type representation."""
477
478
  ...
478
479
 
479
- def x509_ext_key_usage(oid_seq: SecItem, repr_kind: int = 0) -> Union[str, List[str]]:
480
+ def x509_ext_key_usage(oid_seq: SecItem, repr_kind: int = 0) -> str | list[str]:
480
481
  """Get X.509 extended key usage representation."""
481
482
  ...
482
483
 
483
- def x509_alt_name(gen_names: Any, repr_kind: int = 0) -> Union[str, List[str]]:
484
+ def x509_alt_name(gen_names: Any, repr_kind: int = 0) -> str | list[str]:
484
485
  """Get X.509 alternative name representation."""
485
486
  ...
486
487
 
@@ -530,9 +531,9 @@ def pkcs12_set_nickname_collision_callback(callback: Callable[..., Any]) -> None
530
531
 
531
532
  def pkcs12_export(
532
533
  nickname: str,
533
- output_file: Union[str, None] = None,
534
- pk12_passwd: Union[str, None] = None,
535
- cert_db_passwd: Union[str, None] = None,
534
+ output_file: str | None = None,
535
+ pk12_passwd: str | None = None,
536
+ cert_db_passwd: str | None = None,
536
537
  *args: Any,
537
538
  **kwargs: Any,
538
539
  ) -> Any:
@@ -582,7 +583,7 @@ SEC_OID_HMAC_SHA1: int
582
583
  class SecItem:
583
584
  """Represents a security item (binary data)."""
584
585
 
585
- def __init__(self, data: Union[bytes, str] | None = None, ascii: bool = False) -> None:
586
+ def __init__(self, data: bytes | str | None = None, ascii: bool = False) -> None:
586
587
  """
587
588
  Create a SecItem.
588
589
 
@@ -621,7 +622,7 @@ class Certificate:
621
622
  cls,
622
623
  flags: int,
623
624
  repr_kind: int = ...,
624
- ) -> Union[str, List[str], List[int]]:
625
+ ) -> str | list[str] | list[int]:
625
626
  """Decode an integer trust-flag bitmask into a list of
626
627
  flag names / enums / descriptions.
627
628
 
@@ -692,7 +693,7 @@ class Certificate:
692
693
  ...
693
694
 
694
695
  @property
695
- def extensions(self) -> List[CertificateExtension]:
696
+ def extensions(self) -> list[CertificateExtension]:
696
697
  """List of X.509 extensions on the certificate."""
697
698
  ...
698
699
 
@@ -731,7 +732,7 @@ class Certificate:
731
732
  """Verify the certificate hostname."""
732
733
  ...
733
734
 
734
- def check_valid_times(self, time: Union[int, None] = None, allow_override: bool = False) -> int:
735
+ def check_valid_times(self, time: int | None = None, allow_override: bool = False) -> int:
735
736
  """Check whether the certificate is currently within its
736
737
  validity period."""
737
738
  ...
@@ -764,7 +765,7 @@ class Certificate:
764
765
  """
765
766
  ...
766
767
 
767
- def format_lines(self, level: int = 0) -> List[Tuple[int, str]]:
768
+ def format_lines(self, level: int = 0) -> list[tuple[int, str]]:
768
769
  """Format certificate as indented lines."""
769
770
  ...
770
771
 
@@ -786,18 +787,18 @@ class SymKey:
786
787
  """Get the key length in bits."""
787
788
  ...
788
789
 
789
- def format_lines(self, level: int = 0) -> List[Tuple[int, str]]:
790
+ def format_lines(self, level: int = 0) -> list[tuple[int, str]]:
790
791
  """Format key information as indented lines."""
791
792
  ...
792
793
 
793
794
  class AlgorithmID:
794
795
  """Represents a cryptographic algorithm identifier."""
795
796
 
796
- def get_pbe_crypto_mechanism(self, key: SymKey) -> Tuple[int, SecItem]:
797
+ def get_pbe_crypto_mechanism(self, key: SymKey) -> tuple[int, SecItem]:
797
798
  """Get the cryptographic mechanism and parameters."""
798
799
  ...
799
800
 
800
- def format_lines(self, level: int = 0) -> List[Tuple[int, str]]:
801
+ def format_lines(self, level: int = 0) -> list[tuple[int, str]]:
801
802
  """Format algorithm ID information as indented lines."""
802
803
  ...
803
804
 
@@ -925,11 +926,11 @@ class PK11Slot:
925
926
 
926
927
  def generate_key_pair(
927
928
  self, mechanism: int, params: Any | None = None, *pin_args: Any
928
- ) -> Tuple[Any, Any]:
929
+ ) -> tuple[Any, Any]:
929
930
  """Generate a key pair."""
930
931
  ...
931
932
 
932
- def list_certs(self) -> List[Certificate]:
933
+ def list_certs(self) -> list[Certificate]:
933
934
  """List all certificates in the slot."""
934
935
  ...
935
936
 
@@ -937,7 +938,7 @@ class PK11Slot:
937
938
  """Generate a password-based encryption key."""
938
939
  ...
939
940
 
940
- def format_lines(self, level: int = 0) -> List[Tuple[int, str]]:
941
+ def format_lines(self, level: int = 0) -> list[tuple[int, str]]:
941
942
  """Format slot information as indented lines."""
942
943
  ...
943
944
 
@@ -992,7 +993,7 @@ class PK11SymKey:
992
993
  """Unwrap a symmetric key."""
993
994
  ...
994
995
 
995
- def format_lines(self, level: int = 0) -> List[Tuple[int, str]]:
996
+ def format_lines(self, level: int = 0) -> list[tuple[int, str]]:
996
997
  """Format key information as indented lines."""
997
998
  ...
998
999
 
@@ -1059,9 +1060,9 @@ class DN:
1059
1060
 
1060
1061
  def __len__(self) -> int: ...
1061
1062
  def __iter__(self) -> Any: ...
1062
- def __getitem__(self, key: Union[int, slice, str]) -> Any: ...
1063
+ def __getitem__(self, key: int | slice | str) -> Any: ...
1063
1064
  def __contains__(self, key: object) -> bool: ...
1064
- def has_key(self, key: Union[str, int, SecItem]) -> bool:
1065
+ def has_key(self, key: str | int | SecItem) -> bool:
1065
1066
  """Check if the DN has a specific key."""
1066
1067
  ...
1067
1068
 
@@ -1103,13 +1104,13 @@ class RDN:
1103
1104
  def __init__(self, *args: Any, **kwargs: Any) -> None: ...
1104
1105
  def __len__(self) -> int: ...
1105
1106
  def __iter__(self) -> Any: ...
1106
- def __getitem__(self, key: Union[int, slice, str]) -> Any: ...
1107
+ def __getitem__(self, key: int | slice | str) -> Any: ...
1107
1108
  def __contains__(self, key: object) -> bool: ...
1108
1109
  def __lt__(self, other: RDN) -> bool: ...
1109
1110
  def __le__(self, other: RDN) -> bool: ...
1110
1111
  def __gt__(self, other: RDN) -> bool: ...
1111
1112
  def __ge__(self, other: RDN) -> bool: ...
1112
- def has_key(self, key: Union[str, int, SecItem]) -> bool:
1113
+ def has_key(self, key: str | int | SecItem) -> bool:
1113
1114
  """Check if the RDN has a specific key."""
1114
1115
  ...
1115
1116
 
@@ -1147,7 +1148,7 @@ class AVA:
1147
1148
  class GeneralName:
1148
1149
  """Represents a general name in a certificate."""
1149
1150
 
1150
- def get_name(self, repr_kind: int = 0) -> Union[str, Tuple[int, str]]:
1151
+ def get_name(self, repr_kind: int = 0) -> str | tuple[int, str]:
1151
1152
  """Get the name representation."""
1152
1153
  ...
1153
1154
 
@@ -1162,7 +1163,7 @@ class CRLDistributionPt:
1162
1163
  """Get the reasons."""
1163
1164
  ...
1164
1165
 
1165
- def format_lines(self, level: int = 0) -> List[Tuple[int, str]]:
1166
+ def format_lines(self, level: int = 0) -> list[tuple[int, str]]:
1166
1167
  """Format as indented lines."""
1167
1168
  ...
1168
1169
 
@@ -1195,7 +1196,7 @@ class CertificateExtension:
1195
1196
  """Get the extension value."""
1196
1197
  ...
1197
1198
 
1198
- def format_lines(self, level: int = 0) -> List[Tuple[int, str]]:
1199
+ def format_lines(self, level: int = 0) -> list[tuple[int, str]]:
1199
1200
  """Format as indented lines."""
1200
1201
  ...
1201
1202
 
@@ -1219,7 +1220,7 @@ class PublicKey:
1219
1220
  """Get the key type."""
1220
1221
  ...
1221
1222
 
1222
- def format_lines(self, level: int = 0) -> List[Tuple[int, str]]:
1223
+ def format_lines(self, level: int = 0) -> list[tuple[int, str]]:
1223
1224
  """Format as indented lines."""
1224
1225
  ...
1225
1226
 
@@ -1240,7 +1241,7 @@ class RSAPublicKey:
1240
1241
  """Get the exponent."""
1241
1242
  ...
1242
1243
 
1243
- def format_lines(self, level: int = 0) -> List[Tuple[int, str]]:
1244
+ def format_lines(self, level: int = 0) -> list[tuple[int, str]]:
1244
1245
  """Format as indented lines."""
1245
1246
  ...
1246
1247
 
@@ -1251,7 +1252,7 @@ class RSAPublicKey:
1251
1252
  class DSAPublicKey:
1252
1253
  """Represents a DSA public key."""
1253
1254
 
1254
- def format_lines(self, level: int = 0) -> List[Tuple[int, str]]:
1255
+ def format_lines(self, level: int = 0) -> list[tuple[int, str]]:
1255
1256
  """Format as indented lines."""
1256
1257
  ...
1257
1258
 
@@ -1272,7 +1273,7 @@ class SignedData:
1272
1273
  """Get the signature."""
1273
1274
  ...
1274
1275
 
1275
- def format_lines(self, level: int = 0) -> List[Tuple[int, str]]:
1276
+ def format_lines(self, level: int = 0) -> list[tuple[int, str]]:
1276
1277
  """Format as indented lines."""
1277
1278
  ...
1278
1279
 
@@ -1283,7 +1284,7 @@ class SignedData:
1283
1284
  class SubjectPublicKeyInfo:
1284
1285
  """Represents subject public key info."""
1285
1286
 
1286
- def format_lines(self, level: int = 0) -> List[Tuple[int, str]]:
1287
+ def format_lines(self, level: int = 0) -> list[tuple[int, str]]:
1287
1288
  """Format as indented lines."""
1288
1289
  ...
1289
1290
 
@@ -1294,7 +1295,7 @@ class SubjectPublicKeyInfo:
1294
1295
  class KEYPQGParams:
1295
1296
  """Represents PQG parameters for key generation."""
1296
1297
 
1297
- def format_lines(self, level: int = 0) -> List[Tuple[int, str]]:
1298
+ def format_lines(self, level: int = 0) -> list[tuple[int, str]]:
1298
1299
  """Format as indented lines."""
1299
1300
  ...
1300
1301
 
@@ -1316,7 +1317,7 @@ class AuthKeyID:
1316
1317
  """X.509 Authority Key Identifier extension wrapper."""
1317
1318
 
1318
1319
  def __init__(self, *args: Any, **kwargs: Any) -> None: ...
1319
- def format_lines(self, level: int = 0) -> List[Tuple[int, str]]:
1320
+ def format_lines(self, level: int = 0) -> list[tuple[int, str]]:
1320
1321
  """Format as indented lines."""
1321
1322
  ...
1322
1323
 
@@ -1330,7 +1331,7 @@ class BasicConstraints:
1330
1331
  """X.509 Basic Constraints extension wrapper."""
1331
1332
 
1332
1333
  def __init__(self, *args: Any, **kwargs: Any) -> None: ...
1333
- def format_lines(self, level: int = 0) -> List[Tuple[int, str]]:
1334
+ def format_lines(self, level: int = 0) -> list[tuple[int, str]]:
1334
1335
  """Format as indented lines."""
1335
1336
  ...
1336
1337
 
@@ -1346,8 +1347,8 @@ class CRLDistributionPts:
1346
1347
  def __init__(self, *args: Any, **kwargs: Any) -> None: ...
1347
1348
  def __len__(self) -> int: ...
1348
1349
  def __iter__(self) -> Any: ...
1349
- def __getitem__(self, key: Union[int, slice]) -> Any: ...
1350
- def format_lines(self, level: int = 0) -> List[Tuple[int, str]]:
1350
+ def __getitem__(self, key: int | slice) -> Any: ...
1351
+ def format_lines(self, level: int = 0) -> list[tuple[int, str]]:
1351
1352
  """Format as indented lines."""
1352
1353
  ...
1353
1354
 
@@ -1363,8 +1364,8 @@ class AuthorityInfoAccesses:
1363
1364
  def __init__(self, *args: Any, **kwargs: Any) -> None: ...
1364
1365
  def __len__(self) -> int: ...
1365
1366
  def __iter__(self) -> Any: ...
1366
- def __getitem__(self, key: Union[int, slice]) -> Any: ...
1367
- def format_lines(self, level: int = 0) -> List[Tuple[int, str]]:
1367
+ def __getitem__(self, key: int | slice) -> Any: ...
1368
+ def format_lines(self, level: int = 0) -> list[tuple[int, str]]:
1368
1369
  """Format as indented lines."""
1369
1370
  ...
1370
1371
 
@@ -1392,7 +1393,7 @@ class PKCS12Decoder:
1392
1393
  def __init__(self, *args: Any, **kwargs: Any) -> None: ...
1393
1394
  def __iter__(self) -> Any: ...
1394
1395
  def __len__(self) -> int: ...
1395
- def __getitem__(self, key: Union[int, slice]) -> Any: ...
1396
+ def __getitem__(self, key: int | slice) -> Any: ...
1396
1397
  def __getattr__(self, name: str) -> Any: ...
1397
1398
 
1398
1399
  # ---------------------------------------------------------------------------