Skip to content

Commit 6965967

Browse files
committed
fixup! Improve asymmetric key check in CryptographyHMACKey
1 parent 057bc6f commit 6965967

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

jose/backends/cryptography_backend.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@
5656

5757

5858
def is_pem_format(key):
59+
"""
60+
Return True if the key is PEM format
61+
This function uses the list of valid PEM headers defined in
62+
_PEMS dict.
63+
"""
5964
return bool(_PEM_RE.search(key))
6065

6166

@@ -73,6 +78,11 @@ def is_pem_format(key):
7378

7479

7580
def is_ssh_key(key):
81+
"""
82+
Return True if the key is a SSH key
83+
This function uses the list of valid SSH key format defined in
84+
_SSH_KEY_FORMATS dict.
85+
"""
7686
if any(string_value in key for string_value in _SSH_KEY_FORMATS):
7787
return True
7888

0 commit comments

Comments
 (0)