Exemplo n.º 1
0
        private static void KeyCheck(PuTTyPrivateKeyBody key)
        {
            Assert.AreEqual(0x100, key.D.Length);
            Assert.AreEqual(new[] { 0x0A, 0xCF }, key.D.Take(2));
            Assert.AreEqual(0x61, key.D.Last());

            Assert.AreEqual(0x81, key.P.Length);
            Assert.AreEqual(new[] { 0x00, 0xD8 }, key.P.Take(2));
            Assert.AreEqual(0x68, key.P.Last());

            Assert.AreEqual(0x81, key.Q.Length);
            Assert.AreEqual(new[] { 0x00, 0x8F }, key.Q.Take(2));
            Assert.AreEqual(0x37, key.Q.Last());

            Assert.AreEqual(0x81, key.Iqmp.Length);
            Assert.AreEqual(new[] { 0x00, 0xEE }, key.Iqmp.Take(2));
            Assert.AreEqual(0x63, key.Iqmp.Last());
        }
Exemplo n.º 2
0
        public void CreateFromBytes()
        {
            var key = PuTTyPrivateKeyBody.Create(Convert.FromBase64String(Base64Key));

            KeyCheck(key);
        }
Exemplo n.º 3
0
        public void CreateFromBase64()
        {
            var key = PuTTyPrivateKeyBody.Create(Base64Key);

            KeyCheck(key);
        }