const BYTE * value
Pointer into the source buffer.
Definition: util.h:67
DWORD tlvLength
The length of the whole TLV.
Definition: util.h:69
USHORT tag
The Tag.
Definition: util.h:66
DWORD length
The length of the value.
Definition: util.h:68
DWORD tlvLength
The length of the whole TLV.
Definition: util.h:59
USHORT tag
The Tag.
Definition: util.h:55
PBYTE extendedValue
The extended value if length > 256. Must be manually allocated and deallocated.
Definition: util.h:58
DWORD length
The length of the value.
Definition: util.h:56
long LONG
A long value.
Definition: types.h:69
unsigned char BYTE
A Microsoft/Muscle BYTE definition.
Definition: types.h:67
unsigned char * PBYTE
A Microsoft/Muscle LPBYTE, pointer to unsigned char.
Definition: types.h:64
unsigned long * PDWORD
A Microsoft LPDWORD/Muscle pointer to a DWORD.
Definition: types.h:66
unsigned long DWORD
A Microsoft/Muscle DWORD definition.
Definition: types.h:68
OPGP_NO_API DWORD get_int(PBYTE buf, DWORD offset)
Returns an unsigned int from the given position.
Definition: util.c:51
OPGP_NO_API LONG parse_apdu_case(PBYTE apduCommand, DWORD apduCommandLength, PBYTE caseAPDU, PDWORD lc, PDWORD le)
Parse the APDU case.
Definition: util.c:256
OPGP_NO_API LONG read_TLV(const BYTE *buffer, DWORD length, TLV *tlv)
Reads a TLV struct from the given buffer.
Definition: util.c:93
OPGP_NO_API DWORD convert_byte(BYTE b)
Converts a ISO 7816-4 Le Byte into its value.
Definition: util.c:42
OPGP_NO_API LONG parse_simple_tlv(const BYTE *buffer, DWORD length, GP_SIMPLE_TLV *tlv)
Reads a TLV view from the given buffer without copying the value.
Definition: util.c:155
DWORD get_number(PBYTE buf, DWORD offset, BYTE numLength)
Returns an unsigned int from the given position by taking just numLength bytes starting at offset int...
Definition: util.c:61
OPGP_NO_API OPGP_ERROR_STATUS append_tlv(PBYTE buffer, DWORD bufferSize, PDWORD offset, USHORT tag, const BYTE *value, DWORD valueLength)
Appends a TLV to the given buffer.
Definition: util.c:208
OPGP_NO_API LONG write_TLV_length(PBYTE buffer, DWORD offset, DWORD lengthLeft, USHORT length)
Writes a TLV length field following DER BER rules.
Definition: util.c:322
OPGP_NO_API DWORD get_short(PBYTE buf, DWORD offset)
Returns an unsigned short int from the given position.
Definition: util.c:82
OPGP_NO_API LONG parse_OID_numeric_string(PBYTE oid, DWORD oidLength, char *out, DWORD outLength)
Parses a DER encoded OID into a numeric string (e.g. "1.2.840.113549").
Definition: util.c:352