55 lines
1.5 KiB
XML
55 lines
1.5 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<refentry id="screadbinary">
|
|
<refentryinfo><title>OpenSC API Reference</title></refentryinfo>
|
|
<refmeta>
|
|
<refentrytitle>sc_read_binary</refentrytitle>
|
|
<manvolnum>3</manvolnum>
|
|
<refmiscinfo>opensc</refmiscinfo>
|
|
</refmeta>
|
|
|
|
<refnamediv>
|
|
<refname>sc_read_binary</refname>
|
|
<refpurpose>Read a file</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1>
|
|
<title>Synopsis</title>
|
|
<para>
|
|
<programlisting>
|
|
#include <opensc.h>
|
|
|
|
int sc_read_binary(struct sc_card *card, unsigned int offset,
|
|
unsigned char *buf, size_t count,
|
|
unsigned long flags);
|
|
</programlisting>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<para>
|
|
This function reads from a transparent elementary file (EF) on <emphasis>card</emphasis>. It
|
|
corresponds to the ISO 7816 READ BINARY function. Call <link
|
|
linkend="scselectfile">sc_select_file()</link> first to select the file to read from.
|
|
</para>
|
|
|
|
<para>
|
|
The data read from the file is stored in <emphasis>buf</emphasis>, which is
|
|
<emphasis>count</emphasis> bytes long.
|
|
</para>
|
|
|
|
<para>
|
|
The <emphasis>offset</emphasis> argument specifies the file offset in bytes. The
|
|
<emphasis>flags</emphasis> argument is currently not used, and should be set to 0.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1>
|
|
<title>Return value</title>
|
|
<para>
|
|
If successful, the number of bytes read is returned. Otherwise, a negative value is
|
|
returned.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|