Exemple #1
0
        internal void SignMessage(ISignatureProvider signatureProvider)
        {
            if (signatureProvider.ShouldSignMessage(Domain, Identity))
            {
                AssertDomainIsSet();

                Signature = signatureProvider.CreateSignature(Domain, GetSignatureFields());
            }
        }
Exemple #2
0
        internal void VerifySignature(ISignatureProvider signatureProvider)
        {
            if (signatureProvider.ShouldSignMessage(Domain, Identity))
            {
                var mac = signatureProvider.CreateSignature(Domain, GetSignatureFields());

                if (!Unsafe.ArraysEqual(Signature, mac))
                {
                    throw new WrongMessageSignatureException();
                }
            }
        }