X509_get_pubkey should default to checked exception

An invalid certificate would cause a RuntimeException to crop up instead
of a checked exception. Instead throw an InvalidKeyException by default
which can be caught and handled.

Bug: 28574453
Change-Id: Ib9e92c96a35d2d330a4870175a4eb5fb24fc4026
3 files changed