generate a selfsigned cert in memory