Until now the JOSE pieces only had enough support for ACME. This patch improves the JWK parsing to prepare for more complete support and for adding JWE, genaes and genec in later patches.
Introduce an api for efficiently dealing with allocations for large, unknown amounts of objects.