sc_asn1_put_tag(3) Construct an ASN.1 entry in a buffer

SYNOPSIS


#include <opensc.h>
int sc_asn1_put_tag(int tag, const unsigned char *data, int datalen,
unsigned char *out, int outlen, unsigned char **nextbuf);

DESCRIPTION

This function constructs a single entry in an ASN.1 stream, at the buffer pointed to by out (which is outlen bytes long). The tag to be used is in tag, and the entry payload is pointed to by data, which is datalen bytes long.

If nextbuf is not NULL, it will be filled in with a pointer to the buffer address immediately following the newly copied entry.

RETURN VALUE

Returns 0 if successful, or a negative value in case of error.