opensc/doc/api/asn1/sc_asn1_find_tag.xml

45 lines
1.3 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<refentry id="scasn1findtag">
<refentryinfo><title>OpenSC API Reference</title></refentryinfo>
<refmeta>
<refentrytitle>sc_asn1_find_tag</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>opensc</refmiscinfo>
</refmeta>
<refnamediv>
<refname>sc_asn1_find_tag</refname>
<refpurpose>Find a tag in an ASN.1 stream</refpurpose>
</refnamediv>
<refsect1>
<title>Synopsis</title>
<para>
<programlisting>
#include &lt;opensc.h&gt;
const unsigned char *sc_asn1_find_tag(struct sc_context *ctx,
const unsigned char *buf, size_t buflen,
unsigned int tag_in, size_t *taglen_in);
</programlisting>
</para>
</refsect1>
<refsect1>
<title>Description</title>
<para>
This function tries to find an ASN.1 tag matching <emphasis>tag_in</emphasis> in the buffer
pointed to by <emphasis>buf</emphasis>, which is of size <emphasis>buflen</emphasis>. The buffer
should contain a series of ASN.1 entries.
</para>
</refsect1>
<refsect1>
<title>Return value</title>
<para>
If the specified tag was not found, NULL is returned. If found, the address where it was found is
returned, and <emphasis>taglen_in</emphasis> is set to the length of the found tag.
</para>
</refsect1>
</refentry>