As of version 0.9.4, opensc still suffers from some endian problems.
On my Macintosh, the flags in commonObjectAttributes are all zero
for certificates. Changing the definition in libopensc/asn1.c from
SC_ASN1_BIT_STRING to SC_ASN1_BIT_FIELD seems to fix it.
Booleans cause a problem, too. The boolean for authority also is always
set to zero on a Macintosh. I "fixed" it by changing struct
in libopensc/pkcs15.h from "int authority" to "u8 authority". I don't
this is the right way to fix it, though. This is actually with version
but from a quick look, the later code looks the same.