Skip to content

Commit

Permalink
Add PKCS#8 identifier.
Browse files Browse the repository at this point in the history
  • Loading branch information
StevenMacias authored and mahavirj committed Jan 4, 2023
1 parent 353cefc commit 1d34837
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion espsecure/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,11 @@ def _load_sbv2_pub_key(keydata):

def _get_sbv2_pub_key(keyfile):
key_data = keyfile.read()
if b"-BEGIN RSA PRIVATE KEY" in key_data or b"-BEGIN EC PRIVATE KEY" in key_data:
if (
b"-BEGIN RSA PRIVATE KEY" in key_data
or b"-BEGIN EC PRIVATE KEY" in key_data
or b"-BEGIN PRIVATE KEY" in key_data
):
return _load_sbv2_signing_key(key_data).public_key()
elif b"-BEGIN PUBLIC KEY" in key_data:
vk = _load_sbv2_pub_key(key_data)
Expand Down

0 comments on commit 1d34837

Please sign in to comment.