APIs now expose pk encoding choice.

Callers could specify pkcs_1 or pkcs_8 for private
key serialization