The OKPKey.__delitem__() function has a bug in the if condition. Currently the code
import pycose.keys.curves
key = pycose.keys.OKPKey.generate_key(pycose.keys.curves.Ed25519)
del key[pycose.keys.keyparam.OKPKpX]
del key[pycose.keys.keyparam.OKPKpD]
print(key)
will run and print
<COSE_Key(OKPKey): {'OKPKpCurve': 'Ed25519', 'KpKty': 'KtyOKP'}>
The if in line 249
|
if self._key_transform(key) == OKPKpX and OKPKpD not in self.store: |
should be an
elif, otherwise the first
if is ignored.