[tls] Use our own ASN.1 routines for certificate parsing