macosx: locate the best newest SDK present on the computer.

With recent versions of XCode, PC/SC headers are hidden inside
the SDK folder inside XCode app, and the global path is not
guaranteed to be present. This allows to build easily from source
without depending on a specific XCode/OSX version.
macosx: locate and target the latest SDK to build against.
macosx: update the minimal building instructions.
Use correct bit when writing PIV certificate object with gzipped certificate

NIST 800-73 clarified the CertInfo flag for gzipped certificate is 0x01
piv-tool was writting 0x80.
OpenSC card-piv.c continues to accept both.
Merge pull request #324 from dengert/piv-gzip-cert

Use correct bit when writing PIV certificate object with gzipped certifi...
Merge pull request #308 from martinpaljak/yosemite

Building on newer OSX versions without xcode command line tools
Add support for the IsoApplet (Java Card applet)

The IsoApplet can be found here:
https://github.com/philipWendland/IsoApplet
Add read/write support for this applet, including RSA and
ECC support.
IsoApplet: set lock when doing command chaining
IsoApplet: EC key-gen rework and refactorings

Rework the EC key generation mechanism to send the curve parameters to
the card. In earlier versions, the applet had a copy of the curve
parameters and there was a different algorithm reference for every
curve. This is unfeasible when trying to support a larger number of
curves because of size limitations of the applet.
This commit additionally includes some refactorings that should not
change the functionality.
IsoApplet: Do not set RSA hashes

See: 189e998486a5813bca2f6737a465ad62abb318c7
The IsoApplet requires the host to do the hashes with RSA. OpenSC will
add all hashes that are available in software and will not expect the
card to do the hashing.
IsoApplet: ECDSA signatures - only strip excess zeroes

It is required to strip excessive zeroes returned by some Java Cards when removeing the ASN1 structural information for PKCS#11 so that the x/y can be calculated by dividing the signature length by 2. However, the leading zero may only be stripped if it is excessive (outside the field length). Otherwise generated signatures are wrong in rare cases (1 out of 256).
IsoApplet: use AID directly when selecting applet

Now that apdu.data is const (see ef94c6b875b7927bb80e49139a29a3ce2b4937b7), this can be done without discarding the const qualifier of the aid parameter.
IsoApplet: Simplify the private key import

Use the new features of sc_asn1_put_tag introduced in OpenSC/OpenSC#314.
Additionally, a RSA private key is sent from one large buffer using either extended APDUs or chaining (in compliance to IsoApplet API version 00.05).
IsoApplet: Don't set ECC field length of 512

512 is wrong for EC FP (correct would be 521 bit), and neither of those
two are currently supported by OpenSC.
sc_asn1_put_tag - support larger tags

Enhance sc_asn1_put_tag to support larger tag names and larger tags.
Prior to this, sc_asn1_put_tag did only support tags with a length of at most 127 bytes and tag names of one byte.
adjust send/receive size accoriding to card capabilities
EC key storing: make sure algorithm params are available

When trying to import EC keys onto the card with pkcs15-init, the
params.ec of sc_pkcs15init_prkeyargs or pubkeyargs had not been
initialized. This commit fixes that by reading the curve name from the
EVP_KEY and initializing the parameters.

Also, in sc_pkcs15_encode_pubkey_as_spki, this commit adds code that
tries to construct the EC algorithm params from the key itself. This
prevents a NULL parameter in the SPKI/ASN1 encoding.
EC key storing: use the correct parameters

When trying to import EC keys onto a card with pkcs15-init, the
params.ec of sc_pkcs15init_prkeyargs or pubkeyargs had not been
initialized. In this case, use (or point to) the parameters of the
actual key contained in the same struct.
pkcs15-lib: prkey_bits - use private key field length

sc_pkcs15init_keybits can behave erroneously with certain EC keys. It basically strips leading most significant zero-bits. EC keys (privateD) can, however, have valid zeros at the beginning which legitimately count to the field length.
So, one can NOT calculate reliable key lengths only by looking at the privateD component of the private key. You have to look at the field length specified in the parameters.