예제 #1
0
        public string InitiateRelationProofsSession(ProofsRequest proofsRequest)
        {
            string sessionKey = ConfidentialAssetsHelper.GetRandomSeed().ToHexString();

            _relationProofSessions.AddOrUpdate(sessionKey, new RelationProofsSession {
                ProofsRequest = proofsRequest
            }, (k, v) => v);
            return(sessionKey);
        }
예제 #2
0
        public async Task <IActionResult> ChallengeProofs(string key, [FromBody] ProofsRequest proofsRequest)
        {
            string sessionKey = _consentManagementService.InitiateRelationProofsSession(proofsRequest);

            ProofsChallenge proofsChallenge = new ProofsChallenge
            {
                Key                = key,
                PublicSpendKey     = _consentManagementService.PublicSpendKey,
                PublicViewKey      = _consentManagementService.PublicViewKey,
                SessionKey         = sessionKey,
                WithKnowledgeProof = proofsRequest.WithKnowledgeProof,
                WithBiometricProof = proofsRequest.WithBiometricProof
            };

            await _hubContext.Clients.Group(key).SendAsync("ChallengeProofs", proofsChallenge).ConfigureAwait(false);

            return(Ok(new { SessionKey = sessionKey }));
        }