internal static byte[][] SegmentedEncodeAttributeSet(this IEnumerable <X501Attribute> attributes) { List <byte[][]> encodedAttributes = new List <byte[][]>(); foreach (X501Attribute attribute in attributes) { encodedAttributes.Add( DerEncoder.ConstructSegmentedSequence( DerEncoder.SegmentedEncodeOid(attribute.Oid), DerEncoder.ConstructSegmentedPresortedSet( attribute.RawData.WrapAsSegmentedForSequence()))); } return(DerEncoder.ConstructSegmentedSet(encodedAttributes.ToArray())); }