add logic to pem creation