---
name: "sc_asn1_find_tag"
section: "3"
platform: "linux"
package: "libopensc2-dev"
version: "0.11.13-1.1"
release: "Debian 6.0 (Squeeze)"
platforms: ["linux"]
url: "https://new.carta.tech/sc_asn1_find_tag"
---

# sc\_asn1\_find\_tag(3)

Find a tag in an ASN.1 stream

## NAME

sc\_asn1\_find\_tag - Find a tag in an ASN.1 stream

## SYNOPSIS

```
#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);
```

## DESCRIPTION

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.

## RETURN VALUE

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.
