zlint icon indicating copy to clipboard operation
zlint copied to clipboard

The range of IA5String

Open zzzsz opened this issue 1 year ago • 3 comments

I noticed that Zlint judges the range of IA5String as follows, I'd like to know where I can find the definition of the IA5String range. All I saw in RFC5280 is: “IA5String is limited to the set of ASCII characters.” But this only proves that IA5String is less than or equal to ASCII, but does not mean it is equal to ASCII. In the following range determination, the range determination basis of ASCII is used.

// IsIA5String returns true if raw is an IA5String, and returns false otherwise. func IsIA5String(raw []byte) bool { for _, b := range raw { i := int(b) if i > 127 || i < 0 { return false } } return true }

zzzsz avatar Jun 12 '24 03:06 zzzsz

See clauses 35 (b) (c), and clause 38 of X.680 2002-07 for the character repertoire of IA5String.

CBonnell avatar Jun 12 '24 12:06 CBonnell

It does seem like a comment pointing to the spec would be helpful there.

cardonator avatar Jun 12 '24 14:06 cardonator

有关 的字符集,请参阅X.680 2002-07的第 35(b)(c)条和第 38 条IA5String

Thank you for clearing up my confusion.

zzzsz avatar Jun 13 '24 03:06 zzzsz