1
/* tlv.h - Tag-Length-Value Utilities
2
* Copyright (C) 2004 Free Software Foundation, Inc.
4
* This file is part of GnuPG.
6
* GnuPG is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 2 of the License, or
9
* (at your option) any later version.
11
* GnuPG is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
27
CLASS_APPLICATION = 1,
40
TAG_OBJECT_DESCRIPTOR = 7,
44
TAG_EMBEDDED_PDV = 11,
46
TAG_REALTIVE_OID = 13,
49
TAG_NUMERIC_STRING = 18,
50
TAG_PRINTABLE_STRING = 19,
51
TAG_TELETEX_STRING = 20,
52
TAG_VIDEOTEX_STRING = 21,
55
TAG_GENERALIZED_TIME = 24,
56
TAG_GRAPHIC_STRING = 25,
57
TAG_VISIBLE_STRING = 26,
58
TAG_GENERAL_STRING = 27,
59
TAG_UNIVERSAL_STRING = 28,
60
TAG_CHARACTER_STRING = 29,
66
/* Locate a TLV encoded data object in BUFFER of LENGTH and return a
67
pointer to value as well as its length in NBYTES. Return NULL if
68
it was not found. Note, that the function does not check whether
69
the value fits into the provided buffer.*/
70
const unsigned char *find_tlv (const unsigned char *buffer, size_t length,
71
int tag, size_t *nbytes);
74
/* ASN.1 BER parser: Parse BUFFER of length SIZE and return the tag
75
and the length part from the TLV triplet. Update BUFFER and SIZE
77
gpg_error_t parse_ber_header (unsigned char const **buffer, size_t *size,
78
int *r_class, int *r_tag,
80
int *r_ndef, size_t *r_length, size_t *r_nhdr);
84
#endif /* SCD_TLV_H */