Inheritance: MonoBehaviour
Esempio n. 1
0
        public void Should_check_key_fingerprint()
        {
            var keyChain = new KeyChain(TLRig.Default, new HashServices());

            foreach (PublicKey testKey in TestData.TestPublicKeys)
            {
                keyChain.CheckKeyFingerprint(testKey).Should().BeTrue();
            }
        }
Esempio n. 2
0
        public void Should_compute_key_fingerprint()
        {
            var keyChain = new KeyChain(TLRig.Default, new HashServices());

            foreach (PublicKey testKey in TestData.TestPublicKeys)
            {
                ulong actual = keyChain.ComputeFingerprint(testKey.Modulus, testKey.Exponent);
                actual.Should().Be(testKey.Fingerprint);
            }
        }
Esempio n. 3
0
        public void Should_add_keys()
        {
            var keyChain = new KeyChain(TLRig.Default, new HashServices());

            keyChain.AddKeys(TestData.TestPublicKeys);

            foreach (PublicKey testKey in TestData.TestPublicKeys)
            {
                keyChain.Contains(testKey.Fingerprint).Should().BeTrue("Because key chain must have added key with fingerprint: {0:X16}.", testKey.Fingerprint);
                PublicKey key = keyChain[testKey.Fingerprint];
                key.Should().NotBeNull();
                key.ShouldBeEquivalentTo(testKey);
            }
        }
Esempio n. 4
0
    void Start()
    {
        // Find the player game object
        Player = (GameObject)GameObject.Find ("Player");

        // Find the keychain component
        if (Player)
        {
            PlayerKeyChain = Player.GetComponent<KeyChain>();
        }
        else
        {
            Debug.Log("No access to player");
        }

        OpenDoorPosition = transform.position + (transform.up*-5);
    }
        private static MTProtoClientBuilder CreateDefault()
        {
            var clientTransportFactory = new ClientTransportFactory();
            var tlRig = new TLRig();
            var messageIdGenerator = new MessageIdGenerator();
            var hashServices = new HashServices();
            var encryptionServices = new EncryptionServices();
            var randomGenerator = new RandomGenerator();
            var messageCodec = new MessageCodec(tlRig, hashServices, encryptionServices, randomGenerator);
            var keyChain = new KeyChain(tlRig, hashServices);
            var nonceGenerator = new NonceGenerator();

            return new MTProtoClientBuilder(clientTransportFactory,
                tlRig,
                messageIdGenerator,
                messageCodec,
                hashServices,
                encryptionServices,
                nonceGenerator,
                keyChain);
        }