Fix entension DER encoding.

Extensions such as certificate version were not being DER encoded.