Moved from address check out of loop to improve performance
Removed unused member variable
Added error handling for exchange detection
Added support for PEM (OpenSSL, PKCS #8) and DER keys. Fix #69