Use specific RSA/DSA export variants
The reason is, that the output of a PEM is different in the case of
PrivateKey variant and DSAPrivateKey and RSAPrivateKey
variants. According to the manual they should behave the same way. They
don't. They seem to be in a different ASN1 format. This change is to be
consistent with the default behaviour of the command line tool.
This problem does not seem to appear on DER keys, but just for
consistency and to be safe do the same there.
Change-Id: I6a765e831515e9aac0353595132a139aec7b38d2