---
name: "sc_asn1_read_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_read_tag"
---

# sc\_asn1\_read\_tag(3)

Extract a tag from an ASN.1 entry

## NAME

sc\_asn1\_read\_tag - Extract a tag from an ASN.1 entry

## SYNOPSIS

```
#include <opensc.h>
int sc_asn1_read_tag(const unsigned char **buf, size_t buflen,
                     unsigned int *cla_out, unsigned int *tag_out, size_t *taglen);
```

## DESCRIPTION

This function extracts a tag from an ASN.1 entry at the buffer pointed to by the pointer in *buf*. The buffer is *buflen* bytes long. The tag class will be stored in *cla\_out*, the tag itself in *tag\_out*, and the length of the extracted tag in *tag\_len*.

## RETURN VALUE

Returns 1 if successful, or -1 in case of error.
