Ejemplo n.º 1
0
        private KsiSignature CreateFromResponsePayload(SignRequestResponsePayload payload, ulong requestId, DataHash hash, uint?level)
        {
            try
            {
                Logger.Debug("Creating KSI signature from aggregation response. (request id: {0})", requestId);

                KsiSignature signature = new KsiSignature(false, false, payload.GetSignatureChildTags());

                if (level > 0)
                {
                    signature = CreateSignatureWithLevelCorrection(signature, level.Value);
                }

                Verify(signature, hash);

                Logger.Debug("Creating KSI signature from aggregation response successful. (request id: {0})", requestId);
                return(signature);
            }
            catch (TlvException e)
            {
                Logger.Warn("Creating KSI signature from aggregation response failed: {0} (request id: {1})", e, requestId);
                throw;
            }
        }