3 Please read the README file for condition of use, before
6 Maurice Gittens <mgittens@gits.nl> January 1997
12 #include <netinet/in.h>
17 #include <openssl/rsa.h>
18 #include <openssl/evp.h>
19 #include <openssl/objects.h>
20 #include <openssl/x509.h>
21 #include <openssl/err.h>
22 #include <openssl/pem.h>
23 #include <openssl/ssl.h>
25 EVP_PKEY * ReadPublicKey(const char *certfile)
27 FILE *fp = fopen (certfile, "r");
34 x509 = (X509 *)PEM_ASN1_read ((char *(*)())d2i_X509,
40 ERR_print_errors_fp (stderr);
46 pkey=X509_extract_key(x509);
51 ERR_print_errors_fp (stderr);
56 EVP_PKEY *ReadPrivateKey(const char *keyfile)
58 FILE *fp = fopen(keyfile, "r");
64 pkey = (EVP_PKEY*)PEM_ASN1_read ((char *(*)())d2i_PrivateKey,
72 ERR_print_errors_fp (stderr);