---
name: "sc_get_data"
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_get_data"
---

# sc\_get\_data(3)

Get a primitive data object from a card

## NAME

sc\_get\_data - Get a primitive data object from a card

## SYNOPSIS

```
#include <opensc.h>
int sc_get_data(sc_card_t *card, unsigned int tag,
                unsigned char *buf, size_t buflen);
```

## DESCRIPTION

This function is used to retrieve a primitive data object from *card*. It corresponds to the GET DATA command in the ISO 7816 standard. The data is stored in *buf*, which is *buflen* bytes long.

The *tag* parameter specifies the object to be retrieved. Refer to the standard for the correct values to use.

## RETURN VALUE

Returns 0 if successful, or a negative value in case of error.
