The
DSA structure passed to the private key encoding functions should have all the private key components present.The data encoded by the private key functions is unencrypted and therefore offers no private key security.
The DSA_PUBKEY functions should be used in preference to the DSAPublicKey functions when encoding public keys because they use a standard format.
The DSAPublicKey functions use an non standard format the actual data encoded depends on the value of the write_params field of the a key parameter. If write_params is zero then only the pub_key field is encoded as an INTEGER. If write_params is 1 then a SEQUENCE consisting of the p, q, g and pub_key respectively fields are encoded.
The DSAPrivateKey functions also use a non standard structure consiting consisting of a SEQUENCE containing the p, q, g and pub_key and priv_key fields respectively.