Let me try to see if I can find any other 'elegant' solution for this. I just replicated the behavior found at the [google-api-ruby-client](https://github.com/google/google-api-ruby-client/blob/master/lib/google/api_client/auth/key_utils.rb#L78).

The problem here is not rescuing if the file doesn't exist (Errno::ENOENT), the problem is that if you send a PKCS12 string, and depending on the encoding of your machine, it can throw different exceptions (i.e. ArgumentError because the string contains null bytes, ...).