add encryptDataWithKey to avoid creating a PEM when unnecessary