Yes, but you will need to show the proctor/invigilator all around your room including under the desk
Whilst you can do the online examination for the A2 CofC on an iMac, you will need to be able to freely show the proctor around your room and show the proctor under your desk; not easy with a bulk iMac!
We would highly suggest that if you have an iMac then to use an external webcam with enough cable to freely show the proctor under the table/desk (you can get USB extenders if the cable supplied with the webcam is too short!).
In addition, although you may be tempted to only get a relatively cheap webcam for the purpose of the examination you need to ensure that you can be clearly visible (not super pixelated!) and it can show the details on your government issued ID.
We would recommend that you check the webcam quality with someone else before you do your examination - see if they can read your details on their screen!
Remember, this is an official examination conducted on behalf of the CAA and is fully auditable at any time.