1SC_ASN1_ENCODE(3) OpenSC API reference SC_ASN1_ENCODE(3)
2
3
4
6 sc_asn1_encode - Encode ASN.1 entries into a stream
7
9 #include <opensc.h>
10
11 int sc_asn1_encode(struct sc_context *ctx, const struct sc_asn1_entry *asn1,
12 unsigned char **newbuf, size_t *size);
13
14
15
17 This function encodes an array of entries pointed to by asn1 and
18 terminated by a NULL entry (i.e. where the name field of the entry is
19 NULL) into a newly allocated buffer.
20
21 The new buffer containing the ASN.1 stream will be stored in newbuf,
22 and the size of this buffer is stored in size. The application must
23 free this buffer after use.
24
26 Returns 0 if successful, or a negative value in case of error.
27
28
29
30opensc 05/04/2007 SC_ASN1_ENCODE(3)