sc_asn1_find_tag(3) Find a tag in an ASN.1 stream


#include <opensc.h>
const unsigned char *sc_asn1_find_tag(struct sc_context *ctx,
const unsigned char *buf, size_t buflen,
unsigned int tag_in, size_t *taglen_in);


This function tries to find an ASN.1 tag matching tag_in in the buffer pointed to by buf, which is of size buflen. The buffer should contain a series of ASN.1 entries.


If the specified tag was not found, NULL is returned. If found, the address where it was found is returned, and taglen_in is set to the length of the found tag.