Move PKCS#12 key derivation to a separate file