public MaaServiceApiCaller(ApiInfo apiInfo, List <WeightedAttestationProvidersInfo> weightedProviders, string enclaveInfoFileName, bool forceReconnects)
 {
     _apiInfo           = apiInfo;
     _weightedProviders = weightedProviders;
     _enclaveInfo       = EnclaveInfo.CreateFromFile(enclaveInfoFileName);
     _forceReconnects   = forceReconnects;
     _maaService        = CreateMaaService();
 }
Example #2
0
 private async Task <MaaService.MaaResponse> AttestSgxEnclaveAsync(MaaService maaService)
 {
     if (_apiInfo.UsePreviewApi)
     {
         return(await WrapServiceCallAsync(async() => await maaService.AttestSgxEnclaveAsync(new Maa.Preview.AttestSgxEnclaveRequestBody(_enclaveInfo))));
     }
     else
     {
         return(await WrapServiceCallAsync(async() => await maaService.AttestSgxEnclaveAsync(new Maa.Ga.AttestSgxEnclaveRequestBody(_enclaveInfo))));
     }
 }
 private async Task <MaaService.MaaResponse> GetUrlAsync(MaaService maaService)
 {
     return(await WrapServiceCallAsync(async() => await maaService.GetUrlAsync(_apiInfo.Url)));
 }
 private async Task <MaaService.MaaResponse> GetServiceHealthAsync(MaaService maaService)
 {
     return(await WrapServiceCallAsync(async() => await maaService.GetServiceHealthAsync()));
 }
 private async Task <MaaService.MaaResponse> GetOpenIdConfigurationAsync(MaaService maaService)
 {
     return(await WrapServiceCallAsync(async() => await maaService.GetOpenIdConfigurationAsync()));
 }
 private async Task <MaaService.MaaResponse> CallAttestSgxEnclaveGaAsync(MaaService maaService)
 {
     return(await WrapServiceCallAsync(async() => await maaService.AttestSgxEnclaveAsync(new Maa.Ga.AttestSgxEnclaveRequestBody(_enclaveInfo))));
 }
 private async Task <MaaService.MaaResponse> CallAttestOpenEnclavePreviewAsync(MaaService maaService)
 {
     return(await WrapServiceCallAsync(async() => await maaService.AttestOpenEnclaveAsync(new Maa.Preview.AttestOpenEnclaveRequestBody(_enclaveInfo))));
 }
Example #8
0
        private async Task <MaaService.MaaResponse> AttestTpmAsync(MaaService maaService)
        {
            await Task.Run(() => throw new NotImplementedException($"{GetMyName()}"));

            return(default(MaaService.MaaResponse));
        }
Example #9
0
 private async Task <MaaService.MaaResponse> AttestSevSnpVmAsync(MaaService maaService)
 {
     return(await WrapServiceCallAsync(async() => await maaService.AttestSevSnpVmAsync(Maa.Ga.AttestSevSnpRequestBody.CreateFromFile(".\\quotes\\sevsnpvm.report.info.sample.json"))));
 }
Example #10
0
        private async Task <MaaService.MaaResponse> GetServiceHealthAsync(MaaService maaService)
        {
            ApiVersion apiVersion = _apiInfo.UsePreviewApi ? ApiVersion.Preview : ApiVersion.GA;

            return(await WrapServiceCallAsync(async() => await maaService.GetServiceHealthAsync(apiVersion)));
        }