File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -89,6 +89,14 @@ def test_round_trip_with_different_key_types(self, key):
8989 assert verified_data ['testkey' ] == 'testvalue'
9090
9191
92+ class TestJWK (object ):
93+ def test_jwk (self , payload ):
94+ key_data = 'key'
95+ key = jwk .construct (key_data , algorithm = 'HS256' )
96+ token = jws .sign (payload , key , algorithm = ALGORITHMS .HS256 )
97+ assert jws .verify (token , key_data , ALGORITHMS .HS256 ) == payload
98+
99+
92100class TestHMAC (object ):
93101
94102 def testHMAC256 (self , payload ):
@@ -272,6 +280,10 @@ def test_tuple(self):
272280 def test_list (self ):
273281 assert ['test' , 'key' ] == jws ._get_keys (['test' , 'key' ])
274282
283+ def test_jwk (self ):
284+ jwkey = jwk .construct ('key' , algorithm = 'HS256' )
285+ assert (jwkey ,) == jws ._get_keys (jwkey )
286+
275287
276288class TestRSA (object ):
277289
You can’t perform that action at this time.
0 commit comments