Once you've been in Spain for a while, you'll eventually have to deal with the government. Obtaining a digital certificate can be worth while to allow you to do many things online such as: Filing taxes, user authentication on government websites, social security information, signing documents, dealing traffic fines, and much more.
Usually it make sense to do this after you're legally resident and have the NIE (Foreign Identification number) done. You can obtain a personal digital certificate, or also certificates for companies or other legal entities. Here I'll outline the steps necessary.