Fix CDN communication with V3 certificates.

Cert parsing logic assumed nothing in the pem file except cert and key. V3 certs however also carry entitlement data and a signature. Extract key and cert more explicitly, and extracted the logic into a small class for testing purposes.