---
name: "sc_set_card_driver"
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_set_card_driver"
---

# sc\_set\_card\_driver(3)

Force the use of a specified smart card driver

## NAME

sc\_set\_card\_driver - Force the use of a specified smart card driver

## SYNOPSIS

```
#include <opensc.h>
int sc_set_card_driver(struct sc_context *ctx, const char *short_name);
```

## DESCRIPTION

This function forces the use of a a specific card driver to be used in context *ctx*. The name of the driver is specified in *short\_name*. Possible options are:

etoken

flex

cyberflex

gpk

miocos

mcrd

setcos

starcos

tcos

openpgp

jcop

oberthur

belpic

emv

This function only needs to be called if OpenSC fails to auto-detect your card. If used, it should be called immediately after establishing a new context with sc\_establish\_context(), but before doing anything else with the context.

## RETURN VALUE

If an error occurred, a negative value is returned indicating the error. Otherwise, 0 is returned.
