public async Task <string> CreateSignatureAsync(byte[] data, CancellationToken cancellationToken) { ProjectsResource.ServiceAccountsResource.SignBlobRequest request = CreateRequest(data); SignBlobResponse response = await request.ExecuteAsync(cancellationToken).ConfigureAwait(false); return(response.Signature); }
private ProjectsResource.ServiceAccountsResource.SignBlobRequest CreateRequest(byte[] data) { SignBlobRequest body = new SignBlobRequest { BytesToSign = Convert.ToBase64String(data) }; string account = $"projects/-/serviceAccounts/{Id}"; ProjectsResource.ServiceAccountsResource.SignBlobRequest request = _iamService.Projects.ServiceAccounts.SignBlob(body, account); return(request); }