Skip to content

Commit 64e02a0

Browse files
authored
Use pyasn1 in python-jose (#9469)
1 parent 319597c commit 64e02a0

File tree

2 files changed

+12
-17
lines changed

2 files changed

+12
-17
lines changed

stubs/python-jose/METADATA.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
version = "3.3.*"
2-
requires = [] # excluding pyasn1, pyrsa, cryptography until typing is available
2+
requires = ["types-pyasn1"] # excluding pyrsa, cryptography until typing is available
33

44
[tool.stubtest]
55
ignore_missing_stub = false
Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,17 @@
1-
from typing import Any
2-
from typing_extensions import TypeAlias
3-
4-
# Enable when pyasn1 gets stubs:
5-
# from pyasn1.type import univ
6-
_Sequence: TypeAlias = Any
1+
from pyasn1.type import namedtype, univ
72

83
RSA_ENCRYPTION_ASN1_OID: str
94

10-
class RsaAlgorithmIdentifier(_Sequence):
11-
componentType: Any
5+
class RsaAlgorithmIdentifier(univ.Sequence):
6+
componentType: namedtype.NamedTypes
127

13-
class PKCS8PrivateKey(_Sequence):
14-
componentType: Any
8+
class PKCS8PrivateKey(univ.Sequence):
9+
componentType: namedtype.NamedTypes
1510

16-
class PublicKeyInfo(_Sequence):
17-
componentType: Any
11+
class PublicKeyInfo(univ.Sequence):
12+
componentType: namedtype.NamedTypes
1813

19-
def rsa_private_key_pkcs8_to_pkcs1(pkcs8_key): ...
20-
def rsa_private_key_pkcs1_to_pkcs8(pkcs1_key): ...
21-
def rsa_public_key_pkcs1_to_pkcs8(pkcs1_key): ...
22-
def rsa_public_key_pkcs8_to_pkcs1(pkcs8_key): ...
14+
def rsa_private_key_pkcs8_to_pkcs1(pkcs8_key) -> bytes: ...
15+
def rsa_private_key_pkcs1_to_pkcs8(pkcs1_key) -> bytes: ...
16+
def rsa_public_key_pkcs1_to_pkcs8(pkcs1_key) -> bytes: ...
17+
def rsa_public_key_pkcs8_to_pkcs1(pkcs8_key) -> bytes: ...

0 commit comments

Comments
 (0)