I'm banging my head with receipt validation.
I'm in a phase where I validate if certificate is valid and I need to parse ASN1 file.
Apple suggest to use asn1c, like :
#include "Payload.h" /* This header file is generated by asn1c. */
void *pld = NULL;
size_t pld_sz;
Payload_t *payload = NULL;
asn_dec_rval_t rval;
rval = asn_DEF_Payload.ber_decoder(NULL, &asn_DEF_Payload, (void **)&payload, pld, pld_sz, 0);
I already download asn1c-master.zip from: https://github.com/vlm/asn1c
Now I don't know how to install this lib into Xcode, and if I need some extra work or can I start as apple example after installing asn1c?
Thanks for help.
EDIT :
I do as instructed in INSTALL file : in asn1c-master file I run in terminal :
./configure
make
make check
make install
After that I create in separate folder file receipt.asn1
and add this text in it :
ReceiptModule DEFINITIONS ::=
BEGIN
ReceiptAttribute ::= SEQUENCE {
type INTEGER,
version INTEGER,
value OCTET STRING
}
Payload ::= SET OF ReceiptAttribute
END
After that I run
asn1c -fnative-types receipt.ans1
But I gut out :
-fnative-types: Deprecated option
ASN.1 grammar parse error near line 1 (token "{"): syntax error, unexpected '{', expecting TOK_typereference or TOK_capitalreference
Cannot parse "receipt.asn1"