check ASN1 type before using it