Skip to content

Commit b26c210

Browse files
author
Jon Wayne Parrott
committed
Final cleanup
1 parent 5644abb commit b26c210

File tree

2 files changed

+4
-14
lines changed

2 files changed

+4
-14
lines changed

google/auth/crypt/_cryptography_rsa.py

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -58,20 +58,8 @@ def verify(self, message, signature):
5858
return False
5959

6060
@classmethod
61+
@_helpers.copy_docstring(base.Signer)
6162
def from_string(cls, public_key):
62-
"""Construct an Verifier instance from a public key or public
63-
certificate string.
64-
65-
Args:
66-
public_key (Union[str, bytes]): The public key in PEM format or the
67-
x509 public key certificate.
68-
69-
Returns:
70-
Verifier: The constructed verifier.
71-
72-
Raises:
73-
ValueError: If the public_key can't be parsed.
74-
"""
7563
public_key_data = _helpers.to_bytes(public_key)
7664

7765
if _CERTIFICATE_MARKER in public_key_data:

google/auth/crypt/rsa.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,14 @@
1616

1717

1818
try:
19+
# Prefer cryptograph-based RSA implementation.
1920
from google.auth.crypt import _cryptography_rsa
2021

2122
RSASigner = _cryptography_rsa.RSASigner
2223
RSAVerifier = _cryptography_rsa.RSAVerifier
2324
except ImportError: # pragma: NO COVER
24-
# Fallback to pure-python RSA implementation
25+
# Fallback to pure-python RSA implementation if cryptography is
26+
# unavailable.
2527
from google.auth.crypt import _python_rsa
2628

2729
RSASigner = _python_rsa.RSASigner

0 commit comments

Comments
 (0)