Support routines for ASN1 scanning function, doesn't do much yet.