Skip to main content

Module set_of

Module set_of 

Source
Expand description

ASN.1 SET OF support.

ยงOrdering Notes

Some DER serializer implementations fail to properly sort elements of a SET OF. This is technically non-canonical, but occurs frequently enough that most DER decoders tolerate it.

When decoding with EncodingRules::Der, this implementation sorts the elements of SET OF at decode-time to ensure reserializations are canonical.

Structsยง

SetOfIter
Iterator over the elements of an [SetOf].
SetOfVec
ASN.1 SET OF backed by a Vec.

Functionsยง

check_der_ordering ๐Ÿ”’
Ensure set elements are lexicographically ordered using DerOrd.
check_duplicate ๐Ÿ”’
Check if the given item is a duplicate, given an iterator over sorted items (which we can short-circuit once we hit Ordering::Less.
der_sort ๐Ÿ”’
Sort a mut slice according to its DerOrd, returning any errors which might occur during the comparison.