opensc/doc/api/card/sc_get_challenge.xml

42 lines
1.0 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<refentry id="scgetchallenge">
<refentryinfo><title>OpenSC API Reference</title></refentryinfo>
<refmeta>
<refentrytitle>sc_get_challenge</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>opensc</refmiscinfo>
</refmeta>
<refnamediv>
<refname>sc_get_challenge</refname>
<refpurpose>Request a challenge from a card</refpurpose>
</refnamediv>
<refsect1>
<title>Synopsis</title>
<para>
<programlisting>
#include &lt;opensc.h&gt;
int sc_get_challenge(struct sc_card *card, unsigned char *rnd, size_t len);
</programlisting>
</para>
</refsect1>
<refsect1>
<title>Description</title>
<para>
This function requests a challenge (i.e. random bytes) from
<emphasis>card</emphasis>. The returned data will be stored in
<emphasis>rnd</emphasis>, and will be <emphasis>len</emphasis> bytes long.
</para>
</refsect1>
<refsect1>
<title>Return value</title>
<para>
Returns 0 if successful, or a negative value in case of error.
</para>
</refsect1>
</refentry>