I hit my head about checking a check.
I am in the phase where I am checking if the certificate is valid and I need to parse the ASN1 file.
Apple suggests using asn1c, for example:
#include "Payload.h"
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 do not know how to install this library in Xcode, and if I need more work, or can I run the apple example after installing asn1c?
Thanks for the help.
EDIT:
I follow the instructions in the INSTALL file: in the asn1c-master file I run in the terminal:
./configure
make
make check
make install
After that, I create a folder in a separate file receipt.asn1and add this text to it:
ReceiptModule DEFINITIONS ::=
BEGIN
ReceiptAttribute ::= SEQUENCE {
type INTEGER,
version INTEGER,
value OCTET STRING
}
Payload ::= SET OF ReceiptAttribute
END
After that I launched
asn1c -fnative-types receipt.ans1
But I exit from:
-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"