예제 #1
0
 public bool Verify(byte[] data, ECDSASignature signature)
 {
     return ECDsaSigner.VerifySignature(data, signature, this);
 }
예제 #2
0
 public bool VerifySignature(byte[] message, ECDSASignature signature)
 {
     return VerifySignature(message, signature.R, signature.S);
 }
예제 #3
0
        public void ToFromDer()
        {
            var signature = new ECDSASignature(
                TestUtils.HexToBigInteger("657912a72d3ac8169fe8eaecd5ab401c94fc9981717e3e6dd4971889f785790c"),
                TestUtils.HexToBigInteger("00ed3bf3456eb76677fd899c8ccd1cc6d1ebc631b94c42f7c4578f28590d651c6e"));

            var expected = Encoders.Hex.Decode("30450220657912a72d3ac8169fe8eaecd5ab401c94fc9981717e3e6dd4971889f785790c022100ed3bf3456eb76677fd899c8ccd1cc6d1ebc631b94c42f7c4578f28590d651c6e");
            CollectionAssert.AreEqual(expected, signature.ToDER());

            var signature1 = ECDSASignature.FromDER(signature.ToDER());
            Assert.AreEqual(signature.R, signature1.R);
            Assert.AreEqual(signature.S, signature1.S);
        }
예제 #4
0
 public static bool VerifySignature(byte[] message, ECDSASignature signature, PublicKey publicKey)
 {
     return VerifySignature(message, signature.R, signature.S, publicKey.Point);
 }