opensc/doc/api/asn1/sc_asn1_read_tag.xml

45 lines
1.2 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<refentry id="scasn1readtag">
<refentryinfo><title>OpenSC API Reference</title></refentryinfo>
<refmeta>
<refentrytitle>sc_asn1_read_tag</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>opensc</refmiscinfo>
</refmeta>
<refnamediv>
<refname>sc_asn1_read_tag</refname>
<refpurpose>Extract a tag from an ASN.1 entry</refpurpose>
</refnamediv>
<refsect1>
<title>Synopsis</title>
<para>
<programlisting>
#include &lt;opensc.h&gt;
int sc_asn1_read_tag(const unsigned char **buf, size_t buflen,
unsigned int *cla_out, unsigned int *tag_out, size_t *taglen);
</programlisting>
</para>
</refsect1>
<refsect1>
<title>Description</title>
<para>
This function extracts a tag from an ASN.1 entry at the buffer pointed to by
the pointer in <emphasis>buf</emphasis>. The buffer is <emphasis>buflen</emphasis> bytes long.
The tag class will be stored in <emphasis>cla_out</emphasis>, the tag itself in
<emphasis>tag_out</emphasis>, and the length of the extracted tag in
<emphasis>tag_len</emphasis>.
</para>
</refsect1>
<refsect1>
<title>Return value</title>
<para>
Returns 1 if successful, or -1 in case of error.
</para>
</refsect1>
</refentry>