Fix parsing certificate with fallback to PEM.

Also moving extractPubKey to wifikeystorehal_utils.h for visibility
for unit testing.

Bug: 196323960
Test: WifiLegacyKeystoreIntegrationTest
Merged-In: I2374de6566355b24b6678d6876481f576aae6c37
Change-Id: I2374de6566355b24b6678d6876481f576aae6c37
(cherry picked from commit 071ac0d87d0755f6613b8bee940a122faac1b69e)
4 files changed