opensc/doc/api/asn1/sc_asn1_put_tag.xml

49 lines
1.4 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<refentry id="scasn1puttag">
<refentryinfo><title>OpenSC API Reference</title></refentryinfo>
<refmeta>
<refentrytitle>sc_asn1_put_tag</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>opensc</refmiscinfo>
</refmeta>
<refnamediv>
<refname>sc_asn1_put_tag</refname>
<refpurpose>Construct an ASN.1 entry in a buffer</refpurpose>
</refnamediv>
<refsect1>
<title>Synopsis</title>
<para>
<programlisting>
#include &lt;opensc.h&gt;
int sc_asn1_put_tag(int tag, const unsigned char *data, int datalen,
unsigned char *out, int outlen, unsigned char **nextbuf);
</programlisting>
</para>
</refsect1>
<refsect1>
<title>Description</title>
<para>
This function constructs a single entry in an ASN.1 stream, at the buffer pointed to by
<emphasis>out</emphasis> (which is <emphasis>outlen</emphasis> bytes long). The tag to be used
is in <emphasis>tag</emphasis>, and the entry payload is pointed to by <emphasis>data</emphasis>,
which is <emphasis>datalen</emphasis> bytes long.
</para>
<para>
If <emphasis>nextbuf</emphasis> is not NULL, it will be filled in with a pointer to the buffer
address immediately following the newly copied entry.
</para>
</refsect1>
<refsect1>
<title>Return value</title>
<para>
Returns 0 if successful, or a negative value in case of error.
</para>
</refsect1>
</refentry>