Skip to content

Commit a7ef449

Browse files
committed
fix: add CryptoProperties __lt__
Signed-off-by: Jan Kowalleck <[email protected]>
1 parent b2d5399 commit a7ef449

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

cyclonedx/model/crypto.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1519,6 +1519,25 @@ def __eq__(self, other: object) -> bool:
15191519
return hash(other) == hash(self)
15201520
return False
15211521

1522+
def __lt__(self, other: Any) -> bool:
1523+
if isinstance(other, CryptoProperties):
1524+
return _ComparableTuple((
1525+
self.asset_type,
1526+
self.algorithm_properties,
1527+
self.certificate_properties,
1528+
self.related_crypto_material_properties,
1529+
self.protocol_properties,
1530+
self.oid,
1531+
)) < _ComparableTuple((
1532+
other.asset_type,
1533+
other.algorithm_properties,
1534+
other.certificate_properties,
1535+
other.related_crypto_material_properties,
1536+
other.protocol_properties,
1537+
other.oid,
1538+
))
1539+
return NotImplemented
1540+
15221541
def __hash__(self) -> int:
15231542
return hash((self.asset_type, self.algorithm_properties, self.certificate_properties,
15241543
self.related_crypto_material_properties, self.protocol_properties, self.oid))

0 commit comments

Comments
 (0)