err is the return code of openssl. If you pass a non-certificate file to it it returns a value on error + data in stderr, if it's a cert. it returns 0 in err and data in stdout