public void Equals_NotEqual()
        {
            var value1 = new FidoPublicKey(Encoding.Default.GetBytes("publickey"));
            var value2 = new FidoPublicKey(Encoding.Default.GetBytes("Publickey"));

            Assert.IsFalse(value1.Equals(value2));
        }
Ejemplo n.º 2
0
        public void FromJson()
        {
            var deviceRegistration = FidoDeviceRegistration.FromJson("{\"Certificate\":\"Y2VydGlmaWNhdGU\",\"Counter\":12345,\"KeyHandle\":\"a2V5aGFuZGxl\",\"PublicKey\":\"cHVibGlja2V5\"}");

            var keyHandle   = new FidoKeyHandle(Encoding.Default.GetBytes("keyhandle"));
            var publicKey   = new FidoPublicKey(Encoding.Default.GetBytes("publickey"));
            var certificate = new FidoAttestationCertificate(Encoding.Default.GetBytes("certificate"));

            Assert.AreEqual(12345, deviceRegistration.Counter);
            Assert.IsTrue(certificate.Equals(deviceRegistration.Certificate));
            Assert.IsTrue(publicKey.Equals(deviceRegistration.PublicKey));
            Assert.IsTrue(keyHandle.Equals(deviceRegistration.KeyHandle));
        }
Ejemplo n.º 3
0
 public void Equals_NotEqual()
 {
     var value1 = new FidoPublicKey(Encoding.Default.GetBytes("publickey"));
     var value2 = new FidoPublicKey(Encoding.Default.GetBytes("Publickey"));
     Assert.IsFalse(value1.Equals(value2));
 }
        public void FromJson()
        {
            var deviceRegistration = FidoDeviceRegistration.FromJson("{\"Certificate\":\"Y2VydGlmaWNhdGU\",\"Counter\":12345,\"KeyHandle\":\"a2V5aGFuZGxl\",\"PublicKey\":\"cHVibGlja2V5\"}");

            var keyHandle = new FidoKeyHandle(Encoding.Default.GetBytes("keyhandle"));
            var publicKey = new FidoPublicKey(Encoding.Default.GetBytes("publickey"));
            var certificate = new FidoAttestationCertificate(Encoding.Default.GetBytes("certificate"));

            Assert.AreEqual(12345, deviceRegistration.Counter);
            Assert.IsTrue(certificate.Equals(deviceRegistration.Certificate));
            Assert.IsTrue(publicKey.Equals(deviceRegistration.PublicKey));
            Assert.IsTrue(keyHandle.Equals(deviceRegistration.KeyHandle));
        }