Rewrite PKCS#12 code and remove some of the old