Exemplo n.º 1
0
        public void U2F_FinishRegistration()
        {
            StartedRegistration startedRegistration = new StartedRegistration(TestConts.SERVER_CHALLENGE_REGISTER_BASE64, TestConts.APP_ID_ENROLL);
            RegisterResponse    registerResponse    = new RegisterResponse(TestConts.REGISTRATION_RESPONSE_DATA_BASE64, TestConts.CLIENT_DATA_REGISTER_BASE64);

            DeviceRegistration results = U2F.Core.Crypto.U2F.FinishRegistration(startedRegistration, registerResponse, TestConts.TRUSTED_DOMAINS);

            Assert.NotNull(results);
            Assert.NotNull(results.KeyHandle);
            Assert.NotNull(results.PublicKey);
            Assert.NotNull(results.GetAttestationCertificate());
        }
        public void DeviceRegistration_FromJson()
        {
            DeviceRegistration deviceRegistration = DeviceRegistration.FromJson <DeviceRegistration>(JsonData);

            Assert.IsNotNull(deviceRegistration);
            Assert.IsNotNull(deviceRegistration.KeyHandle);
            Assert.IsNotNull(deviceRegistration.PublicKey);
            Assert.IsNotNull(deviceRegistration.GetAttestationCertificate());
            Assert.IsNotNull(deviceRegistration.ToJsonWithOutAttestionCert());
            Assert.IsNotNull(deviceRegistration.ToJson());
            Assert.IsTrue(deviceRegistration.PublicKey.Length > 0);
            Assert.IsTrue(deviceRegistration.KeyHandle.Length > 0);
            Assert.IsTrue(deviceRegistration.GetHashCode() != 0);
        }