I was wondering whether someone knows any good examples on using libssl as a programming library. Its kind of annoying only digging through the code of libssl trying to make sense of it. In the worst case I'll just keep going @ try and error.
You've run into the lack of documentation problem OpenSSL has. IBM DeveloperWorks does have a couple articles about using OpenSSL:
- http://www.ibm.com/developerworks/linux/library/l-openssl.html
- http://www.ibm.com/developerworks/linux/library/l-openssl2.html
- http://www.ibm.com/developerworks/linux/library/l-openssl3.html
If you want to utilize a better documented library, you can take a look at Mozilla NSS:
Just that I'm using Openssl too and think their wiki page also has some good info: http://wiki.openssl.org/index.php/Main_Page
Here is a good working example that's especially useful for iOS developers:
the remail email client uses MailCore iOS email library wrapper, which in turn uses the multi-purpose libetpan email library, which in turn uses SASL, an authentication layer, which in turn uses your beloved openSSL.
So if you're a believer in the learn-by-example methodology, the above gives you a lot to work with and practice on.
来源:https://stackoverflow.com/questions/5009271/any-good-examples-on-programming-using-libssl