This repository was archived by the owner on Mar 6, 2026. It is now read-only.
Commit 52558ae
feat: add cryptography as required dependency (#1929)
The `rsa` library has been deprecated and archived. This PR adds
`cryptography` as a the new preferred backend for RSA operations
In the short term, both `rsa` and `cryptography` will be listed as
dependencies. Soon, `rsa` will be removed, but still supported as an
optional dependency. Eventually, it will be completely removed from the
codebase.
As a part of this change, I introduced new RSASigner and RSAVerifier
wrapper classes, that can use either cryptography or rsa
implementations. Previously, the library would only import one or the
other, depending on if cryptography was installed. This simplifies the
import structure, and puts rsa and cryptography on equal footing
Fixes
#912
Towards
https://github.com/googleapis/google-auth-library-python/issues/1810
Towards
#941
---------
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>1 parent 8dcf91a commit 52558aeCopy full SHA for 52558ae
8 files changed
+332-61Lines changed: 332 additions & 61 deletions
File tree
Expand file treeCollapse file tree
Open diff view settings
Filter options
- google/auth/crypt
- tests
- crypt
Expand file treeCollapse file tree
Open diff view settings
Collapse file
google/auth/crypt/__init__.py
Copy file name to clipboardExpand all lines: google/auth/crypt/__init__.py+18-27Lines changed: 18 additions & 27 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
38 | 38 | |
39 | 39 | |
40 | 40 | |
| 41 | + |
| 42 | + |
41 | 43 | |
42 | 44 | |
43 | | - |
44 | | - |
45 | | - |
46 | | - |
47 | | - |
48 | | - |
49 | | - |
50 | | - |
51 | | - |
52 | | - |
53 | | - |
54 | | - |
55 | | - |
56 | | - |
57 | | - |
58 | | - |
59 | | - |
60 | | - |
61 | | - |
62 | | - |
63 | | - |
64 | | - |
65 | | - |
66 | | - |
67 | | - |
68 | | - |
69 | | - |
| 45 | + |
| 46 | + |
| 47 | + |
| 48 | + |
70 | 49 | |
71 | 50 | |
72 | 51 | |
| ||
103 | 82 | |
104 | 83 | |
105 | 84 | |
| 85 | + |
| 86 | + |
| 87 | + |
| 88 | + |
| 89 | + |
| 90 | + |
| 91 | + |
| 92 | + |
| 93 | + |
| 94 | + |
| 95 | + |
| 96 | + |
Collapse file
google/auth/crypt/_python_rsa.py
Copy file name to clipboardExpand all lines: google/auth/crypt/_python_rsa.py+13-7Lines changed: 13 additions & 7 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
40 | 40 | |
41 | 41 | |
42 | 42 | |
43 | | - |
44 | | - |
45 | | - |
46 | | - |
47 | | - |
48 | | - |
49 | | - |
| 43 | + |
| 44 | + |
| 45 | + |
50 | 46 | |
51 | 47 | |
52 | 48 | |
| ||
84 | 80 | |
85 | 81 | |
86 | 82 | |
| 83 | + |
| 84 | + |
| 85 | + |
| 86 | + |
| 87 | + |
87 | 88 | |
88 | 89 | |
89 | 90 | |
| ||
142 | 143 | |
143 | 144 | |
144 | 145 | |
| 146 | + |
| 147 | + |
| 148 | + |
| 149 | + |
| 150 | + |
145 | 151 | |
146 | 152 | |
147 | 153 | |
|
Collapse file
+2-2Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
102 | 102 | |
103 | 103 | |
104 | 104 | |
105 | | - |
| 105 | + |
106 | 106 | |
107 | 107 | |
108 | 108 | |
109 | 109 | |
110 | 110 | |
111 | 111 | |
112 | 112 | |
113 | | - |
| 113 | + |
114 | 114 | |
115 | 115 | |
116 | 116 | |
|
Collapse file
+109-12Lines changed: 109 additions & 12 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
12 | 12 | |
13 | 13 | |
14 | 14 | |
15 | | - |
| 15 | + |
| 16 | + |
16 | 17 | |
| 18 | + |
| 19 | + |
| 20 | + |
17 | 21 | |
18 | | - |
19 | | - |
20 | | - |
| 22 | + |
| 23 | + |
21 | 24 | |
22 | | - |
23 | | - |
24 | | - |
25 | | - |
26 | | - |
27 | | - |
| 25 | + |
| 26 | + |
| 27 | + |
| 28 | + |
28 | 29 | |
29 | | - |
30 | | - |
| 30 | + |
| 31 | + |
| 32 | + |
| 33 | + |
| 34 | + |
| 35 | + |
| 36 | + |
| 37 | + |
| 38 | + |
| 39 | + |
| 40 | + |
| 41 | + |
| 42 | + |
| 43 | + |
| 44 | + |
| 45 | + |
| 46 | + |
| 47 | + |
| 48 | + |
| 49 | + |
| 50 | + |
| 51 | + |
| 52 | + |
| 53 | + |
| 54 | + |
| 55 | + |
| 56 | + |
| 57 | + |
| 58 | + |
| 59 | + |
| 60 | + |
| 61 | + |
| 62 | + |
| 63 | + |
| 64 | + |
| 65 | + |
| 66 | + |
| 67 | + |
| 68 | + |
| 69 | + |
| 70 | + |
| 71 | + |
| 72 | + |
| 73 | + |
| 74 | + |
| 75 | + |
| 76 | + |
| 77 | + |
| 78 | + |
| 79 | + |
| 80 | + |
| 81 | + |
| 82 | + |
| 83 | + |
| 84 | + |
| 85 | + |
| 86 | + |
| 87 | + |
| 88 | + |
| 89 | + |
| 90 | + |
| 91 | + |
| 92 | + |
| 93 | + |
| 94 | + |
| 95 | + |
| 96 | + |
| 97 | + |
| 98 | + |
| 99 | + |
| 100 | + |
| 101 | + |
| 102 | + |
| 103 | + |
| 104 | + |
| 105 | + |
| 106 | + |
| 107 | + |
| 108 | + |
| 109 | + |
| 110 | + |
| 111 | + |
| 112 | + |
| 113 | + |
| 114 | + |
| 115 | + |
| 116 | + |
| 117 | + |
| 118 | + |
| 119 | + |
| 120 | + |
| 121 | + |
| 122 | + |
| 123 | + |
| 124 | + |
| 125 | + |
| 126 | + |
| 127 | + |
Collapse file
+11-10Lines changed: 11 additions & 10 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
18 | 18 | |
19 | 19 | |
20 | 20 | |
| 21 | + |
| 22 | + |
| 23 | + |
21 | 24 | |
22 | 25 | |
23 | 26 | |
24 | | - |
25 | | - |
| 27 | + |
| 28 | + |
| 29 | + |
26 | 30 | |
27 | 31 | |
28 | 32 | |
29 | | - |
30 | | - |
31 | | - |
32 | | - |
33 | 33 | |
34 | 34 | |
35 | 35 | |
36 | 36 | |
37 | | - |
| 37 | + |
38 | 38 | |
39 | 39 | |
40 | 40 | |
41 | | - |
42 | | - |
| 41 | + |
| 42 | + |
43 | 43 | |
44 | | - |
| 44 | + |
45 | 45 | |
46 | 46 | |
47 | 47 | |
| ||
76 | 76 | |
77 | 77 | |
78 | 78 | |
| 79 | + |
79 | 80 | |
80 | 81 | |
81 | 82 | |
|
Collapse file
tests/crypt/test__python_rsa.py
Copy file name to clipboardExpand all lines: tests/crypt/test__python_rsa.py+3-2Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
195 | 195 | |
196 | 196 | |
197 | 197 | |
198 | | - |
199 | 198 | |
200 | 199 | |
201 | 200 | |
202 | | - |
| 201 | + |
| 202 | + |
| 203 | + |
0 commit comments