> I'm trying to write the public/private keys to a PEM file. I'm using the book "Network Security > with OpenSSL" as a reference which says I need to use PEM_write_DSA_PUBKEY, but I can't find > this anywhere in the openssl source. I'm using 0.9.7d. I see PEM_write_DSAPrivateKey, but > nothing for public key. Am I missing something? Anybody know what function should I be using?
Yes, you are missing something. What you're missing is that this function is made by preprocessor magic. Look for these bits of code: #define IMPLEMENT_PEM_write_cb_fp(name, type, str, asn1) \ int PEM_write_##name(FILE *fp, type *x, const EVP_CIPHER *enc, \ unsigned char *kstr, int klen, pem_password_cb *cb, \ void *u) \ { \ return(PEM_ASN1_write((int (*)())i2d_##asn1,str,fp, \ (char *)x,enc,kstr,klen,cb,u)); \ } #endif #define DECLARE_PEM_write(name, type) \ DECLARE_PEM_write_bio(name, type) \ DECLARE_PEM_write_fp(name, type) #define DECLARE_PEM_rw(name, type) \ DECLARE_PEM_read(name, type) \ DECLARE_PEM_write(name, type) DECLARE_PEM_rw(DSA_PUBKEY, DSA) DS ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List openssl-users@openssl.org Automated List Manager [EMAIL PROTECTED]