@Inject
PlatformLayerHelpers platformLayerClient;
public GoogleComputeClient getComputeClient(GoogleCloud cloud) throws OpsException {
KeyParser parser = new KeyParser();
Object parsed = parser.parse(cloud.serviceAccountKey.plaintext());
PrivateKey privateKey;
if (parsed == null) {
throw new OpsException("Cannot parse private key");
} else if (parsed instanceof PrivateKey) {
privateKey = (PrivateKey) parsed;