1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
|
.\"Generated by db2man.xsl. Don't modify this, modify the source.
.de Sh \" Subsection
.br
.if t .Sp
.ne 5
.PP
\fB\\$1\fR
.PP
..
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Ip \" List item
.br
.ie \\n(.$>=3 .ne \\$3
.el .ne 3
.IP "\\$1" \\$2
..
.TH "SC_ASN1_ENCODE" 3 "" "" "OpenSC API Reference"
.SH NAME
sc_asn1_encode \- Encode ASN.1 entries into a stream
.SH "SYNOPSIS"
.PP
.nf
#include <opensc\&.h>
int sc_asn1_encode(struct sc_context *ctx, const struct sc_asn1_entry *asn1,
unsigned char **newbuf, size_t *size);
.fi
.SH "DESCRIPTION"
.PP
This function encodes an array of entries pointed to by \fIasn1\fR and terminated by a NULL entry (i\&.e\&. where the name field of the entry is NULL) into a newly allocated buffer\&.
.PP
The new buffer containing the ASN\&.1 stream will be stored in \fInewbuf\fR, and the size of this buffer is stored in \fIsize\fR\&. The application must free this buffer after use\&.
.SH "RETURN VALUE"
.PP
Returns 0 if successful, or a negative value in case of error\&.
|