コード例 #1
0
        public async Task ProcessRequestAsync(ChangePinParameters data)
        {
            await _opcoVerifier.CheckIfOpCoHasPinServiceAsync(data.Requestor.OpCoId);

            var param = new VerifyPinParameters()
            {
                Requestor = data.Requestor,
                PinHash   = data.OldPinHash
            };
            var pinmodel = await _pinHashVerifier.VerifyPinHashAsync(param);

            var model = new PinChangeVerificationModel()
            {
                OpCoId  = data.Requestor.OpCoId,
                PinType = data.PinType,
                NewPin  = data.NewPin
            };
            await _pinChangeVerifier.CheckNewPinAgainstRulesAsync(model);

            var newpin = _pinHashGenerator.GeneratePinHashWithNewSalt(data.NewPin);

            pinmodel.PinHash = newpin.Hash;
            pinmodel.PinSalt = newpin.Salt;

            await _pinRepository.CreateOrUpdatePinAsync(data.Requestor, pinmodel);
        }
コード例 #2
0
        public async Task ProcessRequestAsync(VerifyPinParameters data)
        {
            if (data is null)
            {
                throw new ArgumentNullException(nameof(data));
            }
            if (data.Requestor is null)
            {
                throw new ArgumentNullException(nameof(data.Requestor));
            }

            await _opcoVerifier.CheckIfOpCoHasPinServiceAsync(data.Requestor.OpCoId);

            await _pinHashVerifier.VerifyPinHashAsync(data);
        }