File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -94,8 +94,11 @@ class OKPKey(CurveKey[PrivateOKPKey, PublicOKPKey]):
94
94
def exchange_derive_key (self , key : "OKPKey" ) -> bytes :
95
95
# used in ECDH-ES Algorithms
96
96
pubkey : t .Union [X25519PublicKey , X448PublicKey ] = key .get_op_key ("deriveKey" ) # type: ignore[assignment]
97
- if ((isinstance (self .private_key , X25519PrivateKey ) and isinstance (pubkey , X25519PublicKey )) or
98
- (isinstance (self .private_key , X448PrivateKey ) and isinstance (pubkey , X448PublicKey ))):
97
+
98
+ # this if else logic is used for type hints
99
+ if isinstance (self .private_key , X25519PrivateKey ) and isinstance (pubkey , X25519PublicKey ):
100
+ return self .private_key .exchange (pubkey )
101
+ elif isinstance (self .private_key , X448PrivateKey ) and isinstance (pubkey , X448PublicKey ):
99
102
return self .private_key .exchange (pubkey )
100
103
raise InvalidExchangeKeyError ()
101
104
You can’t perform that action at this time.
0 commit comments