internal void SignMessage(ISignatureProvider signatureProvider) { if (signatureProvider.ShouldSignMessage(Domain, Identity)) { AssertDomainIsSet(); Signature = signatureProvider.CreateSignature(Domain, GetSignatureFields()); } }
internal void VerifySignature(ISignatureProvider signatureProvider) { if (signatureProvider.ShouldSignMessage(Domain, Identity)) { var mac = signatureProvider.CreateSignature(Domain, GetSignatureFields()); if (!Unsafe.ArraysEqual(Signature, mac)) { throw new WrongMessageSignatureException(); } } }