Beispiel #1
0
        /// <see cref="VerificationRule.Verify" />
        public override VerificationResult Verify(IVerificationContext context)
        {
            CalendarHashChain calendarHashChain = GetSignature(context).CalendarHashChain;

            // If calendar hash chain is missing, verification successful
            if (calendarHashChain == null)
            {
                return(new VerificationResult(GetRuleName(), VerificationResultCode.Ok));
            }

            return(calendarHashChain.AggregationTime != calendarHashChain.CalculateRegistrationTime()
                ? new VerificationResult(GetRuleName(), VerificationResultCode.Fail, VerificationError.Int05)
                : new VerificationResult(GetRuleName(), VerificationResultCode.Ok));
        }
        /// <see cref="VerificationRule.Verify" />
        public override VerificationResult Verify(IVerificationContext context)
        {
            PublicationData   userPublication           = GetUserPublication(context);
            CalendarHashChain extendedCalendarHashChain = GetExtendedCalendarHashChain(context, userPublication.PublicationTime);

            if (userPublication.PublicationTime != extendedCalendarHashChain.PublicationData.PublicationTime)
            {
                return(new VerificationResult(GetRuleName(), VerificationResultCode.Fail, VerificationError.Pub02));
            }

            return(GetSignature(context).AggregationTime != extendedCalendarHashChain.CalculateRegistrationTime()
                ? new VerificationResult(GetRuleName(), VerificationResultCode.Fail, VerificationError.Pub02)
                : new VerificationResult(GetRuleName(), VerificationResultCode.Ok));
        }
        /// <see cref="VerificationRule.Verify" />
        public override VerificationResult Verify(IVerificationContext context)
        {
            IKsiSignature signature = GetSignature(context);

            PublicationRecordInPublicationFile publicationRecord = GetNearestPublicationRecord(GetPublicationsFile(context), signature.AggregationTime);
            CalendarHashChain extendedCalendarHashChain          = GetExtendedCalendarHashChain(context, publicationRecord.PublicationData.PublicationTime);

            if (publicationRecord.PublicationData.PublicationTime != extendedCalendarHashChain.PublicationTime)
            {
                return(new VerificationResult(GetRuleName(), VerificationResultCode.Fail, VerificationError.Pub02));
            }

            return(signature.AggregationTime != extendedCalendarHashChain.CalculateRegistrationTime()
                ? new VerificationResult(GetRuleName(), VerificationResultCode.Fail, VerificationError.Pub02)
                : new VerificationResult(GetRuleName(), VerificationResultCode.Ok));
        }