@@ -494,7 +494,7 @@ def test_get_unverified_header_fails_on_bad_header_types(
494494 )
495495 def test_encode_decode_with_rsa_sha256 (self , jws , payload ):
496496 # PEM-formatted RSA key
497- with open ("tests/keys/testkey_rsa" , "r" ) as rsa_priv_file :
497+ with open ("tests/keys/testkey_rsa.priv " , "r" ) as rsa_priv_file :
498498 priv_rsakey = load_pem_private_key (
499499 force_bytes (rsa_priv_file .read ()),
500500 password = None ,
@@ -510,7 +510,7 @@ def test_encode_decode_with_rsa_sha256(self, jws, payload):
510510 jws .decode (jws_message , pub_rsakey , algorithms = ["RS256" ])
511511
512512 # string-formatted key
513- with open ("tests/keys/testkey_rsa" , "r" ) as rsa_priv_file :
513+ with open ("tests/keys/testkey_rsa.priv " , "r" ) as rsa_priv_file :
514514 priv_rsakey = rsa_priv_file .read ()
515515 jws_message = jws .encode (payload , priv_rsakey , algorithm = "RS256" )
516516
@@ -523,7 +523,7 @@ def test_encode_decode_with_rsa_sha256(self, jws, payload):
523523 )
524524 def test_encode_decode_with_rsa_sha384 (self , jws , payload ):
525525 # PEM-formatted RSA key
526- with open ("tests/keys/testkey_rsa" , "r" ) as rsa_priv_file :
526+ with open ("tests/keys/testkey_rsa.priv " , "r" ) as rsa_priv_file :
527527 priv_rsakey = load_pem_private_key (
528528 force_bytes (rsa_priv_file .read ()),
529529 password = None ,
@@ -538,7 +538,7 @@ def test_encode_decode_with_rsa_sha384(self, jws, payload):
538538 jws .decode (jws_message , pub_rsakey , algorithms = ["RS384" ])
539539
540540 # string-formatted key
541- with open ("tests/keys/testkey_rsa" , "r" ) as rsa_priv_file :
541+ with open ("tests/keys/testkey_rsa.priv " , "r" ) as rsa_priv_file :
542542 priv_rsakey = rsa_priv_file .read ()
543543 jws_message = jws .encode (payload , priv_rsakey , algorithm = "RS384" )
544544
@@ -551,7 +551,7 @@ def test_encode_decode_with_rsa_sha384(self, jws, payload):
551551 )
552552 def test_encode_decode_with_rsa_sha512 (self , jws , payload ):
553553 # PEM-formatted RSA key
554- with open ("tests/keys/testkey_rsa" , "r" ) as rsa_priv_file :
554+ with open ("tests/keys/testkey_rsa.priv " , "r" ) as rsa_priv_file :
555555 priv_rsakey = load_pem_private_key (
556556 force_bytes (rsa_priv_file .read ()),
557557 password = None ,
@@ -566,7 +566,7 @@ def test_encode_decode_with_rsa_sha512(self, jws, payload):
566566 jws .decode (jws_message , pub_rsakey , algorithms = ["RS512" ])
567567
568568 # string-formatted key
569- with open ("tests/keys/testkey_rsa" , "r" ) as rsa_priv_file :
569+ with open ("tests/keys/testkey_rsa.priv " , "r" ) as rsa_priv_file :
570570 priv_rsakey = rsa_priv_file .read ()
571571 jws_message = jws .encode (payload , priv_rsakey , algorithm = "RS512" )
572572
@@ -599,7 +599,7 @@ def test_rsa_related_algorithms(self, jws):
599599 )
600600 def test_encode_decode_with_ecdsa_sha256 (self , jws , payload ):
601601 # PEM-formatted EC key
602- with open ("tests/keys/testkey_ec" , "r" ) as ec_priv_file :
602+ with open ("tests/keys/testkey_ec.priv " , "r" ) as ec_priv_file :
603603 priv_eckey = load_pem_private_key (
604604 force_bytes (ec_priv_file .read ()),
605605 password = None ,
@@ -614,7 +614,7 @@ def test_encode_decode_with_ecdsa_sha256(self, jws, payload):
614614 jws .decode (jws_message , pub_eckey , algorithms = ["ES256" ])
615615
616616 # string-formatted key
617- with open ("tests/keys/testkey_ec" , "r" ) as ec_priv_file :
617+ with open ("tests/keys/testkey_ec.priv " , "r" ) as ec_priv_file :
618618 priv_eckey = ec_priv_file .read ()
619619 jws_message = jws .encode (payload , priv_eckey , algorithm = "ES256" )
620620
@@ -628,7 +628,7 @@ def test_encode_decode_with_ecdsa_sha256(self, jws, payload):
628628 def test_encode_decode_with_ecdsa_sha384 (self , jws , payload ):
629629
630630 # PEM-formatted EC key
631- with open ("tests/keys/testkey_ec" , "r" ) as ec_priv_file :
631+ with open ("tests/keys/testkey_ec.priv " , "r" ) as ec_priv_file :
632632 priv_eckey = load_pem_private_key (
633633 force_bytes (ec_priv_file .read ()),
634634 password = None ,
@@ -643,7 +643,7 @@ def test_encode_decode_with_ecdsa_sha384(self, jws, payload):
643643 jws .decode (jws_message , pub_eckey , algorithms = ["ES384" ])
644644
645645 # string-formatted key
646- with open ("tests/keys/testkey_ec" , "r" ) as ec_priv_file :
646+ with open ("tests/keys/testkey_ec.priv " , "r" ) as ec_priv_file :
647647 priv_eckey = ec_priv_file .read ()
648648 jws_message = jws .encode (payload , priv_eckey , algorithm = "ES384" )
649649
@@ -656,7 +656,7 @@ def test_encode_decode_with_ecdsa_sha384(self, jws, payload):
656656 )
657657 def test_encode_decode_with_ecdsa_sha512 (self , jws , payload ):
658658 # PEM-formatted EC key
659- with open ("tests/keys/testkey_ec" , "r" ) as ec_priv_file :
659+ with open ("tests/keys/testkey_ec.priv " , "r" ) as ec_priv_file :
660660 priv_eckey = load_pem_private_key (
661661 force_bytes (ec_priv_file .read ()),
662662 password = None ,
@@ -671,7 +671,7 @@ def test_encode_decode_with_ecdsa_sha512(self, jws, payload):
671671 jws .decode (jws_message , pub_eckey , algorithms = ["ES512" ])
672672
673673 # string-formatted key
674- with open ("tests/keys/testkey_ec" , "r" ) as ec_priv_file :
674+ with open ("tests/keys/testkey_ec.priv " , "r" ) as ec_priv_file :
675675 priv_eckey = ec_priv_file .read ()
676676 jws_message = jws .encode (payload , priv_eckey , algorithm = "ES512" )
677677
0 commit comments