add header file

- unclutter code
- externalize function prototypes and definitions
allow statically linking of OpenSSL