Beispiel #1
0
        private void NotifyAttributeUpdate(UserRootAttribute userAttribute)
        {
            UserAttributeDto userAttributeDto = new UserAttributeDto
            {
                SchemeName  = userAttribute.SchemeName,
                Source      = userAttribute.Source,
                Content     = userAttribute.Content,
                Validated   = false,
                IsOverriden = true
            };

            _idenitiesHubContext.Clients.Group(_accountId.ToString(CultureInfo.InvariantCulture)).SendAsync("PushUserAttributeUpdate", userAttributeDto);
        }
Beispiel #2
0
        public IActionResult ValidateAttribute([FromBody] UserAttributeDto userAttribute)
        {
            ulong accountId = ulong.Parse(User.Identity.Name, CultureInfo.InvariantCulture);

            byte[]        assetIdExpected = userAttribute.AssetId.HexStringToByteArray();
            AttributeType attributeType   = Enum.Parse <AttributeType>(userAttribute.AttributeType);

            byte[] assetIdActual = _assetsService.GenerateAssetId(attributeType, userAttribute.Content);

            userAttribute.Validated = assetIdExpected.Equals32(assetIdActual);

            if (!userAttribute.Validated)
            {
                userAttribute.Content = null;
            }

            _dataAccessService.UpdateUserAttributeContent(accountId, userAttribute.OriginalCommitment.HexStringToByteArray(), userAttribute.Content);

            return(Ok(userAttribute));
        }
Beispiel #3
0
        private void NotifyAttributeUpdate(UserRootAttribute userAttribute)
        {
            UserAttributeDto userAttributeDto = new UserAttributeDto
            {
                AttributeType          = ((AttributeType)userAttribute.AttributeType).ToString(),
                Source                 = userAttribute.Source,
                AssetId                = userAttribute.AssetId.ToHexString(),
                OriginalCommitment     = userAttribute.OriginalCommitment.ToHexString(),
                OriginatingCommitment  = userAttribute.IssuanceCommitment.ToHexString(),
                LastCommitment         = userAttribute.LastCommitment.ToHexString(),
                Content                = userAttribute.Content,
                LastBlindingFactor     = userAttribute.LastBlindingFactor.ToHexString(),
                LastDestinationKey     = userAttribute.LastDestinationKey.ToHexString(),
                LastTransactionKey     = userAttribute.LastTransactionKey.ToHexString(),
                OriginalBlindingFactor = userAttribute.OriginalBlindingFactor.ToHexString(),
                Validated              = false,
                IsOverriden            = true
            };

            _idenitiesHubContext.Clients.Group(_accountId.ToString(CultureInfo.InvariantCulture)).SendAsync("PushUserAttributeUpdate", userAttributeDto);
        }