File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -294,6 +294,24 @@ def test_keys():
294294 assert len (keyl ['ec' ]) == 1
295295
296296
297+ def test_get_key ():
298+ ec_key = generate_private_key (NIST2SEC ['P-256' ], default_backend ())
299+ asym_private_key = ECKey (key = ec_key )
300+ asym_public_key = ECKey (key = asym_private_key .key .public_key ())
301+ sym_key = SYMKey (key = 'mekmitasdigoat' , kid = 'xyzzy' )
302+
303+ asym_private_key .get_key (private = True )
304+ asym_private_key .get_key (private = False )
305+
306+ with pytest .raises (ValueError ):
307+ asym_public_key .get_key (private = True )
308+ asym_public_key .get_key (private = False )
309+
310+ sym_key .get_key (private = True )
311+ with pytest .raises (ValueError ):
312+ sym_key .get_key (private = False )
313+
314+
297315def test_private_key_from_jwk ():
298316 keys = []
299317
You can’t perform that action at this time.
0 commit comments