예제 #1
0
        /// <summary>
        ///     Extend signature to publication.
        /// </summary>
        /// <param name="signature">KSI signature</param>
        /// <param name="publicationRecord">publication</param>
        /// <returns>extended KSI signature</returns>
        public IKsiSignature Extend(IKsiSignature signature, PublicationRecordInSignature publicationRecord)
        {
            if (signature == null)
            {
                throw new ArgumentNullException(nameof(signature));
            }

            if (publicationRecord == null)
            {
                throw new ArgumentNullException(nameof(publicationRecord));
            }

            CalendarHashChain calendarHashChain = _ksiService.Extend(signature.AggregationTime, publicationRecord.PublicationData.PublicationTime);

            return(signature.Extend(calendarHashChain, publicationRecord, _ksiSignatureFactoryForExtending));
        }