pkey: use DSA and RSA PrivateKey functions in to_pem
pkey: use DSA and RSA PrivateKey functions in to_pem

Detect what type of key we are dealing with and use the right to_pem
function. This way we match the enconding that the openssl dsa|rsa apps
use for certificates.

leecrest/luacrypto,aryajur/luacrypto,aryajur/luacrypto,hp-sam/luacrypto-1,leecrest/luacrypto,mkottman/luacrypto,hp-sam/luacrypto-1,mkottman/luacrypto